gosu 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/COPYING +1 -1
- data/dependencies/SDL/include/SDL.h +108 -14
- data/dependencies/SDL/include/SDL_assert.h +81 -50
- data/dependencies/SDL/include/SDL_atomic.h +135 -35
- data/dependencies/SDL/include/SDL_audio.h +960 -355
- data/dependencies/SDL/include/SDL_bits.h +11 -6
- data/dependencies/SDL/include/SDL_blendmode.h +91 -14
- data/dependencies/SDL/include/SDL_clipboard.h +30 -7
- data/dependencies/SDL/include/SDL_config.h +277 -27
- data/dependencies/SDL/include/SDL_config_android.h +13 -38
- data/dependencies/SDL/include/SDL_config_iphoneos.h +21 -62
- data/dependencies/SDL/include/SDL_config_macosx.h +23 -92
- data/dependencies/SDL/include/SDL_config_minimal.h +1 -4
- data/dependencies/SDL/include/SDL_config_pandora.h +15 -22
- data/dependencies/SDL/include/SDL_config_psp.h +16 -37
- data/dependencies/SDL/include/SDL_config_windows.h +28 -91
- data/dependencies/SDL/include/SDL_config_winrt.h +33 -61
- data/dependencies/SDL/include/SDL_config_wiz.h +28 -56
- data/dependencies/SDL/include/SDL_copying.h +1 -1
- data/dependencies/SDL/include/SDL_cpuinfo.h +331 -71
- data/dependencies/SDL/include/SDL_egl.h +906 -280
- data/dependencies/SDL/include/SDL_endian.h +101 -47
- data/dependencies/SDL/include/SDL_error.h +70 -19
- data/dependencies/SDL/include/SDL_events.h +387 -79
- data/dependencies/SDL/include/SDL_filesystem.h +73 -64
- data/dependencies/SDL/include/SDL_gamecontroller.h +585 -125
- data/dependencies/SDL/include/SDL_gesture.h +36 -6
- data/dependencies/SDL/include/SDL_haptic.h +304 -210
- data/dependencies/SDL/include/SDL_hidapi.h +451 -0
- data/dependencies/SDL/include/SDL_hints.h +1286 -897
- data/dependencies/SDL/include/SDL_joystick.h +577 -130
- data/dependencies/SDL/include/SDL_keyboard.h +162 -63
- data/dependencies/SDL/include/SDL_keycode.h +7 -5
- data/dependencies/SDL/include/SDL_loadso.h +42 -8
- data/dependencies/SDL/include/SDL_locale.h +34 -32
- data/dependencies/SDL/include/SDL_log.h +212 -19
- data/dependencies/SDL/include/SDL_main.h +72 -17
- data/dependencies/SDL/include/SDL_messagebox.h +70 -23
- data/dependencies/SDL/include/SDL_metal.h +27 -32
- data/dependencies/SDL/include/SDL_misc.h +19 -15
- data/dependencies/SDL/include/SDL_mouse.h +262 -110
- data/dependencies/SDL/include/SDL_mutex.h +286 -66
- data/dependencies/SDL/include/SDL_name.h +1 -1
- data/dependencies/SDL/include/SDL_opengl.h +1 -1
- data/dependencies/SDL/include/SDL_opengles.h +1 -1
- data/dependencies/SDL/include/SDL_opengles2.h +2 -2
- data/dependencies/SDL/include/SDL_pixels.h +199 -34
- data/dependencies/SDL/include/SDL_platform.h +39 -2
- data/dependencies/SDL/include/SDL_power.h +23 -10
- data/dependencies/SDL/include/SDL_quit.h +1 -1
- data/dependencies/SDL/include/SDL_rect.h +78 -28
- data/dependencies/SDL/include/SDL_render.h +1204 -472
- data/dependencies/SDL/include/SDL_revision.h +2 -2
- data/dependencies/SDL/include/SDL_rwops.h +605 -33
- data/dependencies/SDL/include/SDL_scancode.h +1 -1
- data/dependencies/SDL/include/SDL_sensor.h +76 -42
- data/dependencies/SDL/include/SDL_shape.h +38 -27
- data/dependencies/SDL/include/SDL_stdinc.h +96 -24
- data/dependencies/SDL/include/SDL_surface.h +571 -139
- data/dependencies/SDL/include/SDL_system.h +339 -101
- data/dependencies/SDL/include/SDL_syswm.h +50 -20
- data/dependencies/SDL/include/SDL_test.h +1 -1
- data/dependencies/SDL/include/SDL_test_assert.h +2 -2
- data/dependencies/SDL/include/SDL_test_common.h +23 -6
- data/dependencies/SDL/include/SDL_test_compare.h +1 -1
- data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
- data/dependencies/SDL/include/SDL_test_font.h +3 -3
- data/dependencies/SDL/include/SDL_test_fuzzer.h +28 -26
- data/dependencies/SDL/include/SDL_test_harness.h +6 -6
- data/dependencies/SDL/include/SDL_test_images.h +1 -1
- data/dependencies/SDL/include/SDL_test_log.h +1 -1
- data/dependencies/SDL/include/SDL_test_md5.h +1 -1
- data/dependencies/SDL/include/SDL_test_memory.h +1 -1
- data/dependencies/SDL/include/SDL_test_random.h +2 -2
- data/dependencies/SDL/include/SDL_thread.h +226 -128
- data/dependencies/SDL/include/SDL_timer.h +129 -22
- data/dependencies/SDL/include/SDL_touch.h +48 -8
- data/dependencies/SDL/include/SDL_types.h +1 -1
- data/dependencies/SDL/include/SDL_version.h +72 -46
- data/dependencies/SDL/include/SDL_video.h +1266 -460
- data/dependencies/SDL/include/SDL_vulkan.h +100 -161
- data/dependencies/SDL/include/begin_code.h +22 -1
- data/dependencies/SDL/include/close_code.h +1 -1
- data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
- data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
- data/dependencies/SDL_sound/SDL_sound.c +83 -7
- data/dependencies/SDL_sound/SDL_sound.h +4 -4
- data/dependencies/SDL_sound/SDL_sound_aiff.c +9 -12
- data/dependencies/SDL_sound/SDL_sound_au.c +7 -7
- data/dependencies/SDL_sound/SDL_sound_coreaudio.c +3 -3
- data/dependencies/SDL_sound/SDL_sound_flac.c +1 -1
- data/dependencies/SDL_sound/SDL_sound_internal.h +17 -10
- data/dependencies/SDL_sound/SDL_sound_modplug.c +25 -27
- data/dependencies/SDL_sound/SDL_sound_mp3.c +5 -17
- data/dependencies/SDL_sound/SDL_sound_raw.c +11 -11
- data/dependencies/SDL_sound/SDL_sound_shn.c +8 -7
- data/dependencies/SDL_sound/SDL_sound_voc.c +6 -4
- data/dependencies/SDL_sound/SDL_sound_vorbis.c +6 -11
- data/dependencies/SDL_sound/SDL_sound_wav.c +35 -29
- data/dependencies/SDL_sound/dr_flac.h +618 -220
- data/dependencies/SDL_sound/dr_mp3.h +263 -94
- data/dependencies/SDL_sound/libmodplug/fastmix.c +58 -64
- data/dependencies/SDL_sound/libmodplug/libmodplug.h +25 -103
- data/dependencies/SDL_sound/libmodplug/load_669.c +14 -17
- data/dependencies/SDL_sound/libmodplug/load_amf.c +11 -7
- data/dependencies/SDL_sound/libmodplug/load_ams.c +65 -22
- data/dependencies/SDL_sound/libmodplug/load_dbm.c +8 -4
- data/dependencies/SDL_sound/libmodplug/load_dmf.c +55 -25
- data/dependencies/SDL_sound/libmodplug/load_far.c +9 -13
- data/dependencies/SDL_sound/libmodplug/load_gdm.c +448 -0
- data/dependencies/SDL_sound/libmodplug/load_it.c +45 -49
- data/dependencies/SDL_sound/libmodplug/load_mdl.c +80 -53
- data/dependencies/SDL_sound/libmodplug/load_med.c +20 -12
- data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
- data/dependencies/SDL_sound/libmodplug/load_mt2.c +29 -17
- data/dependencies/SDL_sound/libmodplug/load_okt.c +12 -8
- data/dependencies/SDL_sound/libmodplug/load_psm.c +101 -78
- data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -17
- data/dependencies/SDL_sound/libmodplug/load_s3m.c +9 -7
- data/dependencies/SDL_sound/libmodplug/load_stm.c +3 -2
- data/dependencies/SDL_sound/libmodplug/load_ult.c +2 -2
- data/dependencies/SDL_sound/libmodplug/load_umx.c +315 -35
- data/dependencies/SDL_sound/libmodplug/load_xm.c +25 -21
- data/dependencies/SDL_sound/libmodplug/mmcmp.c +295 -149
- data/dependencies/SDL_sound/libmodplug/modplug.c +7 -123
- data/dependencies/SDL_sound/libmodplug/modplug.h +32 -29
- data/dependencies/SDL_sound/libmodplug/snd_dsp.c +0 -1
- data/dependencies/SDL_sound/libmodplug/snd_flt.c +2 -2
- data/dependencies/SDL_sound/libmodplug/snd_fx.c +24 -18
- data/dependencies/SDL_sound/libmodplug/sndfile.c +55 -156
- data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -12
- data/dependencies/SDL_sound/libmodplug/tables.h +10 -15
- data/dependencies/SDL_sound/stb_vorbis.h +508 -325
- data/dependencies/{al_soft → mojoAL}/AL/al.h +38 -30
- data/dependencies/{al_soft → mojoAL}/AL/alc.h +27 -56
- data/dependencies/mojoAL/mojoal.c +4594 -0
- data/ext/gosu/extconf.rb +33 -30
- data/include/Gosu/Audio.hpp +70 -85
- data/include/Gosu/Color.hpp +63 -107
- data/include/Gosu/Font.hpp +44 -50
- data/include/Gosu/Fwd.hpp +1 -1
- data/include/Gosu/Graphics.hpp +64 -75
- data/include/Gosu/GraphicsBase.hpp +32 -39
- data/include/Gosu/Image.hpp +56 -62
- data/include/Gosu/ImageData.hpp +23 -27
- data/include/Gosu/Inspection.hpp +1 -4
- data/include/Gosu/Math.hpp +4 -16
- data/include/Gosu/Platform.hpp +1 -51
- data/include/Gosu/Text.hpp +37 -40
- data/include/Gosu/TextInput.hpp +34 -40
- data/include/Gosu/Utility.hpp +10 -8
- data/include/Gosu/Version.hpp +1 -1
- data/include/Gosu/Window.hpp +73 -70
- data/lib/SDL2.dll +0 -0
- data/lib/gosu/compat.rb +28 -37
- data/lib/gosu/swig_patches.rb +31 -3
- data/lib/gosu.rb +2 -2
- data/lib64/SDL2.dll +0 -0
- data/rdoc/gosu.rb +9 -1
- data/src/Audio.cpp +86 -86
- data/src/AudioFile.hpp +6 -6
- data/src/AudioFileAudioToolbox.cpp +1 -1
- data/src/AudioFileSDLSound.cpp +1 -1
- data/src/AudioImpl.hpp +5 -5
- data/src/Bitmap.cpp +13 -13
- data/src/BitmapIO.cpp +0 -20
- data/src/BlockAllocator.cpp +2 -1
- data/src/Channel.cpp +22 -20
- data/src/Color.cpp +62 -55
- data/src/EmptyImageData.hpp +16 -18
- data/src/FileUnix.cpp +1 -1
- data/src/FileWin.cpp +1 -1
- data/src/Font.cpp +52 -57
- data/src/GosuViewController.cpp +2 -0
- data/src/Graphics.cpp +135 -143
- data/src/Image.cpp +42 -42
- data/src/Input.cpp +1 -1
- data/src/InputUIKit.cpp +1 -1
- data/src/LargeImageData.cpp +120 -113
- data/src/LargeImageData.hpp +18 -16
- data/src/Log.hpp +6 -6
- data/src/Macro.cpp +124 -169
- data/src/Macro.hpp +11 -11
- data/src/Math.cpp +8 -1
- data/src/RenderState.hpp +5 -5
- data/src/Resolution.cpp +114 -61
- data/src/RubyGosu.cxx +470 -501
- data/src/RubyGosu.h +3 -2
- data/src/TexChunk.cpp +50 -41
- data/src/TexChunk.hpp +22 -22
- data/src/Text.cpp +58 -59
- data/src/TextBuilder.cpp +60 -57
- data/src/TextBuilder.hpp +20 -20
- data/src/TextInput.cpp +127 -135
- data/src/TrueTypeFont.cpp +108 -108
- data/src/TrueTypeFont.hpp +39 -38
- data/src/TrueTypeFontApple.cpp +27 -23
- data/src/TrueTypeFontUnix.cpp +21 -26
- data/src/TrueTypeFontWin.cpp +30 -30
- data/src/Utility.cpp +82 -23
- data/src/WinUtility.hpp +2 -1
- data/src/Window.cpp +103 -86
- data/src/WindowUIKit.cpp +48 -51
- metadata +8 -20
- data/dependencies/SDL/include/SDL_config_os2.h +0 -188
- data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
- data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
- data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
- data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
- data/dependencies/al_soft/AL/alext.h +0 -585
- data/dependencies/al_soft/AL/efx-creative.h +0 -3
- data/dependencies/al_soft/AL/efx-presets.h +0 -402
- data/dependencies/al_soft/AL/efx.h +0 -762
- data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
- data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
- data/lib/OpenAL32.dll +0 -0
- data/lib64/OpenAL32.dll +0 -0
- data/src/UtilityApple.cpp +0 -16
- data/src/UtilityWin.cpp +0 -17
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -55,154 +55,253 @@ typedef struct SDL_Keysym
|
|
55
55
|
/* Function prototypes */
|
56
56
|
|
57
57
|
/**
|
58
|
-
*
|
58
|
+
* Query the window which currently has keyboard focus.
|
59
|
+
*
|
60
|
+
* \returns the window with keyboard focus.
|
61
|
+
*
|
62
|
+
* \since This function is available since SDL 2.0.0.
|
59
63
|
*/
|
60
64
|
extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
|
61
65
|
|
62
66
|
/**
|
63
|
-
*
|
67
|
+
* Get a snapshot of the current state of the keyboard.
|
68
|
+
*
|
69
|
+
* The pointer returned is a pointer to an internal SDL array. It will be
|
70
|
+
* valid for the whole lifetime of the application and should not be freed by
|
71
|
+
* the caller.
|
72
|
+
*
|
73
|
+
* A array element with a value of 1 means that the key is pressed and a value
|
74
|
+
* of 0 means that it is not. Indexes into this array are obtained by using
|
75
|
+
* SDL_Scancode values.
|
76
|
+
*
|
77
|
+
* Use SDL_PumpEvents() to update the state array.
|
64
78
|
*
|
65
|
-
*
|
79
|
+
* This function gives you the current state after all events have been
|
80
|
+
* processed, so if a key or button has been pressed and released before you
|
81
|
+
* process events, then the pressed state will never show up in the
|
82
|
+
* SDL_GetKeyboardState() calls.
|
66
83
|
*
|
67
|
-
*
|
84
|
+
* Note: This function doesn't take into account whether shift has been
|
85
|
+
* pressed or not.
|
68
86
|
*
|
69
|
-
*
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
73
|
-
*
|
74
|
-
*
|
75
|
-
* \endcode
|
87
|
+
* \param numkeys if non-NULL, receives the length of the returned array
|
88
|
+
* \returns a pointer to an array of key states.
|
89
|
+
*
|
90
|
+
* \since This function is available since SDL 2.0.0.
|
91
|
+
*
|
92
|
+
* \sa SDL_PumpEvents
|
76
93
|
*/
|
77
94
|
extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
|
78
95
|
|
79
96
|
/**
|
80
|
-
*
|
97
|
+
* Get the current key modifier state for the keyboard.
|
98
|
+
*
|
99
|
+
* \returns an OR'd combination of the modifier keys for the keyboard. See
|
100
|
+
* SDL_Keymod for details.
|
101
|
+
*
|
102
|
+
* \since This function is available since SDL 2.0.0.
|
103
|
+
*
|
104
|
+
* \sa SDL_GetKeyboardState
|
105
|
+
* \sa SDL_SetModState
|
81
106
|
*/
|
82
107
|
extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
|
83
108
|
|
84
109
|
/**
|
85
|
-
*
|
110
|
+
* Set the current key modifier state for the keyboard.
|
111
|
+
*
|
112
|
+
* The inverse of SDL_GetModState(), SDL_SetModState() allows you to impose
|
113
|
+
* modifier key states on your application. Simply pass your desired modifier
|
114
|
+
* states into `modstate`. This value may be a bitwise, OR'd combination of
|
115
|
+
* SDL_Keymod values.
|
116
|
+
*
|
117
|
+
* This does not change the keyboard state, only the key modifier flags that
|
118
|
+
* SDL reports.
|
119
|
+
*
|
120
|
+
* \param modstate the desired SDL_Keymod for the keyboard
|
86
121
|
*
|
87
|
-
*
|
122
|
+
* \since This function is available since SDL 2.0.0.
|
123
|
+
*
|
124
|
+
* \sa SDL_GetModState
|
88
125
|
*/
|
89
126
|
extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
|
90
127
|
|
91
128
|
/**
|
92
|
-
*
|
93
|
-
*
|
129
|
+
* Get the key code corresponding to the given scancode according to the
|
130
|
+
* current keyboard layout.
|
131
|
+
*
|
132
|
+
* See SDL_Keycode for details.
|
94
133
|
*
|
95
|
-
*
|
134
|
+
* \param scancode the desired SDL_Scancode to query
|
135
|
+
* \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
|
96
136
|
*
|
97
|
-
*
|
137
|
+
* \since This function is available since SDL 2.0.0.
|
138
|
+
*
|
139
|
+
* \sa SDL_GetKeyName
|
140
|
+
* \sa SDL_GetScancodeFromKey
|
98
141
|
*/
|
99
142
|
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
|
100
143
|
|
101
144
|
/**
|
102
|
-
*
|
103
|
-
*
|
145
|
+
* Get the scancode corresponding to the given key code according to the
|
146
|
+
* current keyboard layout.
|
147
|
+
*
|
148
|
+
* See SDL_Scancode for details.
|
104
149
|
*
|
105
|
-
*
|
150
|
+
* \param key the desired SDL_Keycode to query
|
151
|
+
* \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
|
106
152
|
*
|
107
|
-
*
|
153
|
+
* \since This function is available since SDL 2.0.0.
|
154
|
+
*
|
155
|
+
* \sa SDL_GetKeyFromScancode
|
156
|
+
* \sa SDL_GetScancodeName
|
108
157
|
*/
|
109
158
|
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
|
110
159
|
|
111
160
|
/**
|
112
|
-
*
|
161
|
+
* Get a human-readable name for a scancode.
|
162
|
+
*
|
163
|
+
* See SDL_Scancode for details.
|
164
|
+
*
|
165
|
+
* **Warning**: The returned name is by design not stable across platforms,
|
166
|
+
* e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left
|
167
|
+
* Windows" under Microsoft Windows, and some scancodes like
|
168
|
+
* `SDL_SCANCODE_NONUSBACKSLASH` don't have any name at all. There are even
|
169
|
+
* scancodes that share names, e.g. `SDL_SCANCODE_RETURN` and
|
170
|
+
* `SDL_SCANCODE_RETURN2` (both called "Return"). This function is therefore
|
171
|
+
* unsuitable for creating a stable cross-platform two-way mapping between
|
172
|
+
* strings and scancodes.
|
173
|
+
*
|
174
|
+
* \param scancode the desired SDL_Scancode to query
|
175
|
+
* \returns a pointer to the name for the scancode. If the scancode doesn't
|
176
|
+
* have a name this function returns an empty string ("").
|
113
177
|
*
|
114
|
-
*
|
115
|
-
* If the scancode doesn't have a name, this function returns
|
116
|
-
* an empty string ("").
|
178
|
+
* \since This function is available since SDL 2.0.0.
|
117
179
|
*
|
118
|
-
*
|
180
|
+
* \sa SDL_GetScancodeFromKey
|
181
|
+
* \sa SDL_GetScancodeFromName
|
119
182
|
*/
|
120
183
|
extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
|
121
184
|
|
122
185
|
/**
|
123
|
-
*
|
186
|
+
* Get a scancode from a human-readable name.
|
124
187
|
*
|
125
|
-
*
|
188
|
+
* \param name the human-readable scancode name
|
189
|
+
* \returns the SDL_Scancode, or `SDL_SCANCODE_UNKNOWN` if the name wasn't
|
190
|
+
* recognized; call SDL_GetError() for more information.
|
126
191
|
*
|
127
|
-
*
|
192
|
+
* \since This function is available since SDL 2.0.0.
|
193
|
+
*
|
194
|
+
* \sa SDL_GetKeyFromName
|
195
|
+
* \sa SDL_GetScancodeFromKey
|
196
|
+
* \sa SDL_GetScancodeName
|
128
197
|
*/
|
129
198
|
extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
|
130
199
|
|
131
200
|
/**
|
132
|
-
*
|
201
|
+
* Get a human-readable name for a key.
|
202
|
+
*
|
203
|
+
* See SDL_Scancode and SDL_Keycode for details.
|
133
204
|
*
|
134
|
-
*
|
135
|
-
*
|
136
|
-
*
|
137
|
-
*
|
205
|
+
* \param key the desired SDL_Keycode to query
|
206
|
+
* \returns a pointer to a UTF-8 string that stays valid at least until the
|
207
|
+
* next call to this function. If you need it around any longer, you
|
208
|
+
* must copy it. If the key doesn't have a name, this function
|
209
|
+
* returns an empty string ("").
|
138
210
|
*
|
139
|
-
*
|
211
|
+
* \since This function is available since SDL 2.0.0.
|
212
|
+
*
|
213
|
+
* \sa SDL_GetKeyFromName
|
214
|
+
* \sa SDL_GetKeyFromScancode
|
215
|
+
* \sa SDL_GetScancodeFromKey
|
140
216
|
*/
|
141
217
|
extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
|
142
218
|
|
143
219
|
/**
|
144
|
-
*
|
220
|
+
* Get a key code from a human-readable name.
|
221
|
+
*
|
222
|
+
* \param name the human-readable key name
|
223
|
+
* \returns key code, or `SDLK_UNKNOWN` if the name wasn't recognized; call
|
224
|
+
* SDL_GetError() for more information.
|
145
225
|
*
|
146
|
-
*
|
226
|
+
* \since This function is available since SDL 2.0.0.
|
147
227
|
*
|
148
|
-
*
|
228
|
+
* \sa SDL_GetKeyFromScancode
|
229
|
+
* \sa SDL_GetKeyName
|
230
|
+
* \sa SDL_GetScancodeFromName
|
149
231
|
*/
|
150
232
|
extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
|
151
233
|
|
152
234
|
/**
|
153
|
-
*
|
154
|
-
* This function will show the on-screen keyboard if supported.
|
235
|
+
* Start accepting Unicode text input events.
|
155
236
|
*
|
156
|
-
*
|
157
|
-
*
|
158
|
-
*
|
237
|
+
* This function will start accepting Unicode text input events in the focused
|
238
|
+
* SDL window, and start emitting SDL_TextInputEvent (SDL_TEXTINPUT) and
|
239
|
+
* SDL_TextEditingEvent (SDL_TEXTEDITING) events. Please use this function in
|
240
|
+
* pair with SDL_StopTextInput().
|
241
|
+
*
|
242
|
+
* On some platforms using this function activates the screen keyboard.
|
243
|
+
*
|
244
|
+
* \since This function is available since SDL 2.0.0.
|
245
|
+
*
|
246
|
+
* \sa SDL_SetTextInputRect
|
247
|
+
* \sa SDL_StopTextInput
|
159
248
|
*/
|
160
249
|
extern DECLSPEC void SDLCALL SDL_StartTextInput(void);
|
161
250
|
|
162
251
|
/**
|
163
|
-
*
|
252
|
+
* Check whether or not Unicode text input events are enabled.
|
253
|
+
*
|
254
|
+
* \returns SDL_TRUE if text input events are enabled else SDL_FALSE.
|
164
255
|
*
|
165
|
-
*
|
166
|
-
*
|
256
|
+
* \since This function is available since SDL 2.0.0.
|
257
|
+
*
|
258
|
+
* \sa SDL_StartTextInput
|
167
259
|
*/
|
168
260
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
|
169
261
|
|
170
262
|
/**
|
171
|
-
*
|
172
|
-
*
|
263
|
+
* Stop receiving any text input events.
|
264
|
+
*
|
265
|
+
* \since This function is available since SDL 2.0.0.
|
173
266
|
*
|
174
|
-
*
|
175
|
-
* \sa SDL_HasScreenKeyboardSupport()
|
267
|
+
* \sa SDL_StartTextInput
|
176
268
|
*/
|
177
269
|
extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
|
178
270
|
|
179
271
|
/**
|
180
|
-
*
|
181
|
-
*
|
272
|
+
* Set the rectangle used to type Unicode text inputs.
|
273
|
+
*
|
274
|
+
* \param rect the SDL_Rect structure representing the rectangle to receive
|
275
|
+
* text (ignored if NULL)
|
276
|
+
*
|
277
|
+
* \since This function is available since SDL 2.0.0.
|
182
278
|
*
|
183
|
-
*
|
279
|
+
* \sa SDL_StartTextInput
|
184
280
|
*/
|
185
281
|
extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
|
186
282
|
|
187
283
|
/**
|
188
|
-
*
|
284
|
+
* Check whether the platform has screen keyboard support.
|
189
285
|
*
|
190
|
-
*
|
286
|
+
* \returns SDL_TRUE if the platform has some screen keyboard support or
|
287
|
+
* SDL_FALSE if not.
|
191
288
|
*
|
192
|
-
*
|
289
|
+
* \since This function is available since SDL 2.0.0.
|
193
290
|
*
|
194
|
-
*
|
291
|
+
* \sa SDL_StartTextInput
|
292
|
+
* \sa SDL_IsScreenKeyboardShown
|
195
293
|
*/
|
196
294
|
extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void);
|
197
295
|
|
198
296
|
/**
|
199
|
-
*
|
297
|
+
* Check whether the screen keyboard is shown for given window.
|
200
298
|
*
|
201
|
-
*
|
299
|
+
* \param window the window for which screen keyboard should be queried
|
300
|
+
* \returns SDL_TRUE if screen keyboard is shown or SDL_FALSE if not.
|
202
301
|
*
|
203
|
-
*
|
302
|
+
* \since This function is available since SDL 2.0.0.
|
204
303
|
*
|
205
|
-
*
|
304
|
+
* \sa SDL_HasScreenKeyboardSupport
|
206
305
|
*/
|
207
306
|
extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window);
|
208
307
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -52,7 +52,7 @@ typedef enum
|
|
52
52
|
SDLK_UNKNOWN = 0,
|
53
53
|
|
54
54
|
SDLK_RETURN = '\r',
|
55
|
-
SDLK_ESCAPE = '\
|
55
|
+
SDLK_ESCAPE = '\x1B',
|
56
56
|
SDLK_BACKSPACE = '\b',
|
57
57
|
SDLK_TAB = '\t',
|
58
58
|
SDLK_SPACE = ' ',
|
@@ -147,7 +147,7 @@ typedef enum
|
|
147
147
|
SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT),
|
148
148
|
SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME),
|
149
149
|
SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP),
|
150
|
-
SDLK_DELETE = '\
|
150
|
+
SDLK_DELETE = '\x7F',
|
151
151
|
SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END),
|
152
152
|
SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN),
|
153
153
|
SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT),
|
@@ -338,12 +338,14 @@ typedef enum
|
|
338
338
|
KMOD_NUM = 0x1000,
|
339
339
|
KMOD_CAPS = 0x2000,
|
340
340
|
KMOD_MODE = 0x4000,
|
341
|
-
|
341
|
+
KMOD_SCROLL = 0x8000,
|
342
342
|
|
343
343
|
KMOD_CTRL = KMOD_LCTRL | KMOD_RCTRL,
|
344
344
|
KMOD_SHIFT = KMOD_LSHIFT | KMOD_RSHIFT,
|
345
345
|
KMOD_ALT = KMOD_LALT | KMOD_RALT,
|
346
|
-
KMOD_GUI = KMOD_LGUI | KMOD_RGUI
|
346
|
+
KMOD_GUI = KMOD_LGUI | KMOD_RGUI,
|
347
|
+
|
348
|
+
KMOD_RESERVED = KMOD_SCROLL /* This is for source-level compatibility with SDL 2.0.0. */
|
347
349
|
} SDL_Keymod;
|
348
350
|
|
349
351
|
#endif /* SDL_keycode_h_ */
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -51,22 +51,56 @@ extern "C" {
|
|
51
51
|
#endif
|
52
52
|
|
53
53
|
/**
|
54
|
-
*
|
55
|
-
*
|
56
|
-
*
|
54
|
+
* Dynamically load a shared object.
|
55
|
+
*
|
56
|
+
* \param sofile a system-dependent name of the object file
|
57
|
+
* \returns an opaque pointer to the object handle or NULL if there was an
|
58
|
+
* error; call SDL_GetError() for more information.
|
59
|
+
*
|
60
|
+
* \since This function is available since SDL 2.0.0.
|
61
|
+
*
|
62
|
+
* \sa SDL_LoadFunction
|
63
|
+
* \sa SDL_UnloadObject
|
57
64
|
*/
|
58
65
|
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
|
59
66
|
|
60
67
|
/**
|
61
|
-
*
|
62
|
-
*
|
63
|
-
*
|
68
|
+
* Look up the address of the named function in a shared object.
|
69
|
+
*
|
70
|
+
* This function pointer is no longer valid after calling SDL_UnloadObject().
|
71
|
+
*
|
72
|
+
* This function can only look up C function names. Other languages may have
|
73
|
+
* name mangling and intrinsic language support that varies from compiler to
|
74
|
+
* compiler.
|
75
|
+
*
|
76
|
+
* Make sure you declare your function pointers with the same calling
|
77
|
+
* convention as the actual library function. Your code will crash
|
78
|
+
* mysteriously if you do not do this.
|
79
|
+
*
|
80
|
+
* If the requested function doesn't exist, NULL is returned.
|
81
|
+
*
|
82
|
+
* \param handle a valid shared object handle returned by SDL_LoadObject()
|
83
|
+
* \param name the name of the function to look up
|
84
|
+
* \returns a pointer to the function or NULL if there was an error; call
|
85
|
+
* SDL_GetError() for more information.
|
86
|
+
*
|
87
|
+
* \since This function is available since SDL 2.0.0.
|
88
|
+
*
|
89
|
+
* \sa SDL_LoadObject
|
90
|
+
* \sa SDL_UnloadObject
|
64
91
|
*/
|
65
92
|
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
|
66
93
|
const char *name);
|
67
94
|
|
68
95
|
/**
|
69
|
-
*
|
96
|
+
* Unload a shared object from memory.
|
97
|
+
*
|
98
|
+
* \param handle a valid shared object handle returned by SDL_LoadObject()
|
99
|
+
*
|
100
|
+
* \since This function is available since SDL 2.0.0.
|
101
|
+
*
|
102
|
+
* \sa SDL_LoadFunction
|
103
|
+
* \sa SDL_LoadObject
|
70
104
|
*/
|
71
105
|
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
|
72
106
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -47,44 +47,46 @@ typedef struct SDL_Locale
|
|
47
47
|
} SDL_Locale;
|
48
48
|
|
49
49
|
/**
|
50
|
-
*
|
50
|
+
* Report the user's preferred locale.
|
51
51
|
*
|
52
|
-
*
|
53
|
-
*
|
54
|
-
*
|
55
|
-
*
|
52
|
+
* This returns an array of SDL_Locale structs, the final item zeroed out.
|
53
|
+
* When the caller is done with this array, it should call SDL_free() on the
|
54
|
+
* returned value; all the memory involved is allocated in a single block, so
|
55
|
+
* a single SDL_free() will suffice.
|
56
56
|
*
|
57
|
-
*
|
58
|
-
*
|
59
|
-
*
|
60
|
-
*
|
61
|
-
*
|
62
|
-
*
|
63
|
-
*
|
64
|
-
*
|
57
|
+
* Returned language strings are in the format xx, where 'xx' is an ISO-639
|
58
|
+
* language specifier (such as "en" for English, "de" for German, etc).
|
59
|
+
* Country strings are in the format YY, where "YY" is an ISO-3166 country
|
60
|
+
* code (such as "US" for the United States, "CA" for Canada, etc). Country
|
61
|
+
* might be NULL if there's no specific guidance on them (so you might get {
|
62
|
+
* "en", "US" } for American English, but { "en", NULL } means "English
|
63
|
+
* language, generically"). Language strings are never NULL, except to
|
64
|
+
* terminate the array.
|
65
65
|
*
|
66
|
-
*
|
67
|
-
*
|
66
|
+
* Please note that not all of these strings are 2 characters; some are three
|
67
|
+
* or more.
|
68
68
|
*
|
69
|
-
*
|
70
|
-
*
|
71
|
-
*
|
72
|
-
*
|
73
|
-
*
|
74
|
-
*
|
69
|
+
* The returned list of locales are in the order of the user's preference. For
|
70
|
+
* example, a German citizen that is fluent in US English and knows enough
|
71
|
+
* Japanese to navigate around Tokyo might have a list like: { "de", "en_US",
|
72
|
+
* "jp", NULL }. Someone from England might prefer British English (where
|
73
|
+
* "color" is spelled "colour", etc), but will settle for anything like it: {
|
74
|
+
* "en_GB", "en", NULL }.
|
75
75
|
*
|
76
|
-
*
|
77
|
-
*
|
76
|
+
* This function returns NULL on error, including when the platform does not
|
77
|
+
* supply this information at all.
|
78
78
|
*
|
79
|
-
*
|
80
|
-
*
|
81
|
-
*
|
82
|
-
*
|
83
|
-
*
|
84
|
-
*
|
79
|
+
* This might be a "slow" call that has to query the operating system. It's
|
80
|
+
* best to ask for this once and save the results. However, this list can
|
81
|
+
* change, usually because the user has changed a system preference outside of
|
82
|
+
* your program; SDL will send an SDL_LOCALECHANGED event in this case, if
|
83
|
+
* possible, and you can call this function again to get an updated copy of
|
84
|
+
* preferred locales.
|
85
85
|
*
|
86
|
-
*
|
87
|
-
*
|
86
|
+
* \return array of locales, terminated with a locale with a NULL language
|
87
|
+
* field. Will return NULL on error.
|
88
|
+
*
|
89
|
+
* \since This function is available since SDL 2.0.14.
|
88
90
|
*/
|
89
91
|
extern DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void);
|
90
92
|
|