gosu 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +108 -14
  3. data/dependencies/SDL/include/SDL_assert.h +81 -50
  4. data/dependencies/SDL/include/SDL_atomic.h +135 -35
  5. data/dependencies/SDL/include/SDL_audio.h +960 -355
  6. data/dependencies/SDL/include/SDL_bits.h +11 -6
  7. data/dependencies/SDL/include/SDL_blendmode.h +91 -14
  8. data/dependencies/SDL/include/SDL_clipboard.h +30 -7
  9. data/dependencies/SDL/include/SDL_config.h +277 -27
  10. data/dependencies/SDL/include/SDL_config_android.h +13 -38
  11. data/dependencies/SDL/include/SDL_config_iphoneos.h +21 -62
  12. data/dependencies/SDL/include/SDL_config_macosx.h +23 -92
  13. data/dependencies/SDL/include/SDL_config_minimal.h +1 -4
  14. data/dependencies/SDL/include/SDL_config_pandora.h +15 -22
  15. data/dependencies/SDL/include/SDL_config_psp.h +16 -37
  16. data/dependencies/SDL/include/SDL_config_windows.h +28 -91
  17. data/dependencies/SDL/include/SDL_config_winrt.h +33 -61
  18. data/dependencies/SDL/include/SDL_config_wiz.h +28 -56
  19. data/dependencies/SDL/include/SDL_copying.h +1 -1
  20. data/dependencies/SDL/include/SDL_cpuinfo.h +331 -71
  21. data/dependencies/SDL/include/SDL_egl.h +906 -280
  22. data/dependencies/SDL/include/SDL_endian.h +101 -47
  23. data/dependencies/SDL/include/SDL_error.h +70 -19
  24. data/dependencies/SDL/include/SDL_events.h +387 -79
  25. data/dependencies/SDL/include/SDL_filesystem.h +73 -64
  26. data/dependencies/SDL/include/SDL_gamecontroller.h +585 -125
  27. data/dependencies/SDL/include/SDL_gesture.h +36 -6
  28. data/dependencies/SDL/include/SDL_haptic.h +304 -210
  29. data/dependencies/SDL/include/SDL_hidapi.h +451 -0
  30. data/dependencies/SDL/include/SDL_hints.h +1286 -897
  31. data/dependencies/SDL/include/SDL_joystick.h +577 -130
  32. data/dependencies/SDL/include/SDL_keyboard.h +162 -63
  33. data/dependencies/SDL/include/SDL_keycode.h +7 -5
  34. data/dependencies/SDL/include/SDL_loadso.h +42 -8
  35. data/dependencies/SDL/include/SDL_locale.h +34 -32
  36. data/dependencies/SDL/include/SDL_log.h +212 -19
  37. data/dependencies/SDL/include/SDL_main.h +72 -17
  38. data/dependencies/SDL/include/SDL_messagebox.h +70 -23
  39. data/dependencies/SDL/include/SDL_metal.h +27 -32
  40. data/dependencies/SDL/include/SDL_misc.h +19 -15
  41. data/dependencies/SDL/include/SDL_mouse.h +262 -110
  42. data/dependencies/SDL/include/SDL_mutex.h +286 -66
  43. data/dependencies/SDL/include/SDL_name.h +1 -1
  44. data/dependencies/SDL/include/SDL_opengl.h +1 -1
  45. data/dependencies/SDL/include/SDL_opengles.h +1 -1
  46. data/dependencies/SDL/include/SDL_opengles2.h +2 -2
  47. data/dependencies/SDL/include/SDL_pixels.h +199 -34
  48. data/dependencies/SDL/include/SDL_platform.h +39 -2
  49. data/dependencies/SDL/include/SDL_power.h +23 -10
  50. data/dependencies/SDL/include/SDL_quit.h +1 -1
  51. data/dependencies/SDL/include/SDL_rect.h +78 -28
  52. data/dependencies/SDL/include/SDL_render.h +1204 -472
  53. data/dependencies/SDL/include/SDL_revision.h +2 -2
  54. data/dependencies/SDL/include/SDL_rwops.h +605 -33
  55. data/dependencies/SDL/include/SDL_scancode.h +1 -1
  56. data/dependencies/SDL/include/SDL_sensor.h +76 -42
  57. data/dependencies/SDL/include/SDL_shape.h +38 -27
  58. data/dependencies/SDL/include/SDL_stdinc.h +96 -24
  59. data/dependencies/SDL/include/SDL_surface.h +571 -139
  60. data/dependencies/SDL/include/SDL_system.h +339 -101
  61. data/dependencies/SDL/include/SDL_syswm.h +50 -20
  62. data/dependencies/SDL/include/SDL_test.h +1 -1
  63. data/dependencies/SDL/include/SDL_test_assert.h +2 -2
  64. data/dependencies/SDL/include/SDL_test_common.h +23 -6
  65. data/dependencies/SDL/include/SDL_test_compare.h +1 -1
  66. data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
  67. data/dependencies/SDL/include/SDL_test_font.h +3 -3
  68. data/dependencies/SDL/include/SDL_test_fuzzer.h +28 -26
  69. data/dependencies/SDL/include/SDL_test_harness.h +6 -6
  70. data/dependencies/SDL/include/SDL_test_images.h +1 -1
  71. data/dependencies/SDL/include/SDL_test_log.h +1 -1
  72. data/dependencies/SDL/include/SDL_test_md5.h +1 -1
  73. data/dependencies/SDL/include/SDL_test_memory.h +1 -1
  74. data/dependencies/SDL/include/SDL_test_random.h +2 -2
  75. data/dependencies/SDL/include/SDL_thread.h +226 -128
  76. data/dependencies/SDL/include/SDL_timer.h +129 -22
  77. data/dependencies/SDL/include/SDL_touch.h +48 -8
  78. data/dependencies/SDL/include/SDL_types.h +1 -1
  79. data/dependencies/SDL/include/SDL_version.h +72 -46
  80. data/dependencies/SDL/include/SDL_video.h +1266 -460
  81. data/dependencies/SDL/include/SDL_vulkan.h +100 -161
  82. data/dependencies/SDL/include/begin_code.h +22 -1
  83. data/dependencies/SDL/include/close_code.h +1 -1
  84. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  85. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  86. data/dependencies/SDL_sound/SDL_sound.c +83 -7
  87. data/dependencies/SDL_sound/SDL_sound.h +4 -4
  88. data/dependencies/SDL_sound/SDL_sound_aiff.c +9 -12
  89. data/dependencies/SDL_sound/SDL_sound_au.c +7 -7
  90. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +3 -3
  91. data/dependencies/SDL_sound/SDL_sound_flac.c +1 -1
  92. data/dependencies/SDL_sound/SDL_sound_internal.h +17 -10
  93. data/dependencies/SDL_sound/SDL_sound_modplug.c +25 -27
  94. data/dependencies/SDL_sound/SDL_sound_mp3.c +5 -17
  95. data/dependencies/SDL_sound/SDL_sound_raw.c +11 -11
  96. data/dependencies/SDL_sound/SDL_sound_shn.c +8 -7
  97. data/dependencies/SDL_sound/SDL_sound_voc.c +6 -4
  98. data/dependencies/SDL_sound/SDL_sound_vorbis.c +6 -11
  99. data/dependencies/SDL_sound/SDL_sound_wav.c +35 -29
  100. data/dependencies/SDL_sound/dr_flac.h +618 -220
  101. data/dependencies/SDL_sound/dr_mp3.h +263 -94
  102. data/dependencies/SDL_sound/libmodplug/fastmix.c +58 -64
  103. data/dependencies/SDL_sound/libmodplug/libmodplug.h +25 -103
  104. data/dependencies/SDL_sound/libmodplug/load_669.c +14 -17
  105. data/dependencies/SDL_sound/libmodplug/load_amf.c +11 -7
  106. data/dependencies/SDL_sound/libmodplug/load_ams.c +65 -22
  107. data/dependencies/SDL_sound/libmodplug/load_dbm.c +8 -4
  108. data/dependencies/SDL_sound/libmodplug/load_dmf.c +55 -25
  109. data/dependencies/SDL_sound/libmodplug/load_far.c +9 -13
  110. data/dependencies/SDL_sound/libmodplug/load_gdm.c +448 -0
  111. data/dependencies/SDL_sound/libmodplug/load_it.c +45 -49
  112. data/dependencies/SDL_sound/libmodplug/load_mdl.c +80 -53
  113. data/dependencies/SDL_sound/libmodplug/load_med.c +20 -12
  114. data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
  115. data/dependencies/SDL_sound/libmodplug/load_mt2.c +29 -17
  116. data/dependencies/SDL_sound/libmodplug/load_okt.c +12 -8
  117. data/dependencies/SDL_sound/libmodplug/load_psm.c +101 -78
  118. data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -17
  119. data/dependencies/SDL_sound/libmodplug/load_s3m.c +9 -7
  120. data/dependencies/SDL_sound/libmodplug/load_stm.c +3 -2
  121. data/dependencies/SDL_sound/libmodplug/load_ult.c +2 -2
  122. data/dependencies/SDL_sound/libmodplug/load_umx.c +315 -35
  123. data/dependencies/SDL_sound/libmodplug/load_xm.c +25 -21
  124. data/dependencies/SDL_sound/libmodplug/mmcmp.c +295 -149
  125. data/dependencies/SDL_sound/libmodplug/modplug.c +7 -123
  126. data/dependencies/SDL_sound/libmodplug/modplug.h +32 -29
  127. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +0 -1
  128. data/dependencies/SDL_sound/libmodplug/snd_flt.c +2 -2
  129. data/dependencies/SDL_sound/libmodplug/snd_fx.c +24 -18
  130. data/dependencies/SDL_sound/libmodplug/sndfile.c +55 -156
  131. data/dependencies/SDL_sound/libmodplug/sndmix.c +7 -12
  132. data/dependencies/SDL_sound/libmodplug/tables.h +10 -15
  133. data/dependencies/SDL_sound/stb_vorbis.h +508 -325
  134. data/dependencies/{al_soft → mojoAL}/AL/al.h +38 -30
  135. data/dependencies/{al_soft → mojoAL}/AL/alc.h +27 -56
  136. data/dependencies/mojoAL/mojoal.c +4594 -0
  137. data/ext/gosu/extconf.rb +29 -30
  138. data/include/Gosu/Audio.hpp +70 -85
  139. data/include/Gosu/Color.hpp +19 -11
  140. data/include/Gosu/Font.hpp +40 -44
  141. data/include/Gosu/Graphics.hpp +58 -71
  142. data/include/Gosu/GraphicsBase.hpp +26 -33
  143. data/include/Gosu/Image.hpp +56 -62
  144. data/include/Gosu/ImageData.hpp +23 -27
  145. data/include/Gosu/Inspection.hpp +1 -4
  146. data/include/Gosu/TextInput.hpp +34 -40
  147. data/include/Gosu/Version.hpp +1 -1
  148. data/include/Gosu/Window.hpp +71 -70
  149. data/lib/SDL2.dll +0 -0
  150. data/lib/gosu/compat.rb +24 -37
  151. data/lib/gosu.rb +2 -2
  152. data/lib64/SDL2.dll +0 -0
  153. data/src/Audio.cpp +86 -86
  154. data/src/AudioFile.hpp +6 -6
  155. data/src/AudioFileAudioToolbox.cpp +1 -1
  156. data/src/AudioFileSDLSound.cpp +1 -1
  157. data/src/AudioImpl.hpp +5 -5
  158. data/src/BitmapIO.cpp +0 -20
  159. data/src/BlockAllocator.cpp +2 -1
  160. data/src/Channel.cpp +22 -20
  161. data/src/Color.cpp +12 -9
  162. data/src/EmptyImageData.hpp +15 -17
  163. data/src/FileUnix.cpp +1 -1
  164. data/src/FileWin.cpp +1 -1
  165. data/src/Font.cpp +48 -53
  166. data/src/Graphics.cpp +135 -143
  167. data/src/Image.cpp +41 -42
  168. data/src/Input.cpp +1 -1
  169. data/src/InputUIKit.cpp +1 -1
  170. data/src/LargeImageData.cpp +108 -101
  171. data/src/LargeImageData.hpp +17 -15
  172. data/src/Log.hpp +6 -6
  173. data/src/Macro.cpp +35 -37
  174. data/src/Macro.hpp +11 -11
  175. data/src/Math.cpp +8 -1
  176. data/src/Resolution.cpp +12 -7
  177. data/src/RubyGosu.cxx +5 -5
  178. data/src/TexChunk.cpp +50 -41
  179. data/src/TexChunk.hpp +22 -22
  180. data/src/Text.cpp +37 -37
  181. data/src/TextBuilder.cpp +60 -57
  182. data/src/TextBuilder.hpp +20 -20
  183. data/src/TextInput.cpp +127 -135
  184. data/src/TrueTypeFont.cpp +107 -107
  185. data/src/TrueTypeFont.hpp +39 -38
  186. data/src/TrueTypeFontApple.cpp +19 -22
  187. data/src/TrueTypeFontUnix.cpp +21 -26
  188. data/src/TrueTypeFontWin.cpp +30 -30
  189. data/src/Window.cpp +95 -86
  190. data/src/WindowUIKit.cpp +46 -49
  191. metadata +7 -17
  192. data/dependencies/SDL/include/SDL_config_os2.h +0 -188
  193. data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
  194. data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
  195. data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
  196. data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
  197. data/dependencies/al_soft/AL/alext.h +0 -585
  198. data/dependencies/al_soft/AL/efx-creative.h +0 -3
  199. data/dependencies/al_soft/AL/efx-presets.h +0 -402
  200. data/dependencies/al_soft/AL/efx.h +0 -762
  201. data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
  202. data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
  203. data/lib/OpenAL32.dll +0 -0
  204. data/lib64/OpenAL32.dll +0 -0
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
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
- * \brief Get the window which currently has keyboard focus.
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
- * \brief Get a snapshot of the current state of the keyboard.
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
- * \param numkeys if non-NULL, receives the length of the returned array.
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
- * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
84
+ * Note: This function doesn't take into account whether shift has been
85
+ * pressed or not.
68
86
  *
69
- * \b Example:
70
- * \code
71
- * const Uint8 *state = SDL_GetKeyboardState(NULL);
72
- * if ( state[SDL_SCANCODE_RETURN] ) {
73
- * printf("<RETURN> is pressed.\n");
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
- * \brief Get the current key modifier state for the keyboard.
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
- * \brief Set the current key modifier state for the keyboard.
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
- * \note This does not change the keyboard state, only the key modifier flags.
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
- * \brief Get the key code corresponding to the given scancode according
93
- * to the current keyboard layout.
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
- * See ::SDL_Keycode for details.
134
+ * \param scancode the desired SDL_Scancode to query
135
+ * \returns the SDL_Keycode that corresponds to the given SDL_Scancode.
96
136
  *
97
- * \sa SDL_GetKeyName()
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
- * \brief Get the scancode corresponding to the given key code according to the
103
- * current keyboard layout.
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
- * See ::SDL_Scancode for details.
150
+ * \param key the desired SDL_Keycode to query
151
+ * \returns the SDL_Scancode that corresponds to the given SDL_Keycode.
106
152
  *
107
- * \sa SDL_GetScancodeName()
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
- * \brief Get a human-readable name for a scancode.
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
- * \return A pointer to the name for the scancode.
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
- * \sa SDL_Scancode
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
- * \brief Get a scancode from a human-readable name
186
+ * Get a scancode from a human-readable name.
124
187
  *
125
- * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
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
- * \sa SDL_Scancode
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
- * \brief Get a human-readable name for a key.
201
+ * Get a human-readable name for a key.
202
+ *
203
+ * See SDL_Scancode and SDL_Keycode for details.
133
204
  *
134
- * \return A pointer to a UTF-8 string that stays valid at least until the next
135
- * call to this function. If you need it around any longer, you must
136
- * copy it. If the key doesn't have a name, this function returns an
137
- * empty string ("").
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
- * \sa SDL_Keycode
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
- * \brief Get a key code from a human-readable name
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
- * \return key code, or SDLK_UNKNOWN if the name wasn't recognized
226
+ * \since This function is available since SDL 2.0.0.
147
227
  *
148
- * \sa SDL_Keycode
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
- * \brief Start accepting Unicode text input events.
154
- * This function will show the on-screen keyboard if supported.
235
+ * Start accepting Unicode text input events.
155
236
  *
156
- * \sa SDL_StopTextInput()
157
- * \sa SDL_SetTextInputRect()
158
- * \sa SDL_HasScreenKeyboardSupport()
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
- * \brief Return whether or not Unicode text input events are enabled.
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
- * \sa SDL_StartTextInput()
166
- * \sa SDL_StopTextInput()
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
- * \brief Stop receiving any text input events.
172
- * This function will hide the on-screen keyboard if supported.
263
+ * Stop receiving any text input events.
264
+ *
265
+ * \since This function is available since SDL 2.0.0.
173
266
  *
174
- * \sa SDL_StartTextInput()
175
- * \sa SDL_HasScreenKeyboardSupport()
267
+ * \sa SDL_StartTextInput
176
268
  */
177
269
  extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
178
270
 
179
271
  /**
180
- * \brief Set the rectangle used to type Unicode text inputs.
181
- * This is used as a hint for IME and on-screen keyboard placement.
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
- * \sa SDL_StartTextInput()
279
+ * \sa SDL_StartTextInput
184
280
  */
185
281
  extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
186
282
 
187
283
  /**
188
- * \brief Returns whether the platform has some screen keyboard support.
284
+ * Check whether the platform has screen keyboard support.
189
285
  *
190
- * \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
286
+ * \returns SDL_TRUE if the platform has some screen keyboard support or
287
+ * SDL_FALSE if not.
191
288
  *
192
- * \note Not all screen keyboard functions are supported on all platforms.
289
+ * \since This function is available since SDL 2.0.0.
193
290
  *
194
- * \sa SDL_IsScreenKeyboardShown()
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
- * \brief Returns whether the screen keyboard is shown for given window.
297
+ * Check whether the screen keyboard is shown for given window.
200
298
  *
201
- * \param window The window for which screen keyboard should be queried.
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
- * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
302
+ * \since This function is available since SDL 2.0.0.
204
303
  *
205
- * \sa SDL_HasScreenKeyboardSupport()
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-2020 Sam Lantinga <slouken@libsdl.org>
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 = '\033',
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 = '\177',
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
- KMOD_RESERVED = 0x8000,
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-2020 Sam Lantinga <slouken@libsdl.org>
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
- * This function dynamically loads a shared object and returns a pointer
55
- * to the object handle (or NULL if there was an error).
56
- * The 'sofile' parameter is a system dependent name of the object file.
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
- * Given an object handle, this function looks up the address of the
62
- * named function in the shared object and returns it. This address
63
- * is no longer valid after calling SDL_UnloadObject().
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
- * Unload a shared object from memory.
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-2020 Sam Lantinga <slouken@libsdl.org>
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
- * \brief Report the user's preferred locale.
50
+ * Report the user's preferred locale.
51
51
  *
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
54
- * the returned value; all the memory involved is allocated in a single
55
- * block, so a single SDL_free() will suffice.
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
- * 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.
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
- * Please note that not all of these strings are 2 characters; some are
67
- * three or more.
66
+ * Please note that not all of these strings are 2 characters; some are three
67
+ * or more.
68
68
  *
69
- * The returned list of locales are in the order of the user's preference.
70
- * For example, a German citizen that is fluent in US English and knows
71
- * enough Japanese to navigate around Tokyo might have a list like:
72
- * { "de", "en_US", "jp", NULL }. Someone from England might prefer British
73
- * English (where "color" is spelled "colour", etc), but will settle for
74
- * anything like it: { "en_GB", "en", NULL }.
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
- * This function returns NULL on error, including when the platform does not
77
- * supply this information at all.
76
+ * This function returns NULL on error, including when the platform does not
77
+ * supply this information at all.
78
78
  *
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
82
- * of your program; SDL will send an SDL_LOCALECHANGED event in this case,
83
- * if possible, and you can call this function again to get an updated copy
84
- * of preferred locales.
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
- * \return array of locales, terminated with a locale with a NULL language
87
- * field. Will return NULL on error.
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