gosu 1.3.0 → 1.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (223) 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 +104 -70
  87. data/dependencies/SDL_sound/SDL_sound.h +6 -6
  88. data/dependencies/SDL_sound/SDL_sound_aiff.c +32 -32
  89. data/dependencies/SDL_sound/SDL_sound_au.c +14 -14
  90. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +6 -7
  91. data/dependencies/SDL_sound/SDL_sound_flac.c +28 -30
  92. data/dependencies/SDL_sound/SDL_sound_internal.h +21 -14
  93. data/dependencies/SDL_sound/SDL_sound_modplug.c +26 -28
  94. data/dependencies/SDL_sound/SDL_sound_mp3.c +20 -36
  95. data/dependencies/SDL_sound/SDL_sound_raw.c +15 -16
  96. data/dependencies/SDL_sound/SDL_sound_shn.c +11 -10
  97. data/dependencies/SDL_sound/SDL_sound_voc.c +20 -18
  98. data/dependencies/SDL_sound/SDL_sound_vorbis.c +11 -9
  99. data/dependencies/SDL_sound/SDL_sound_wav.c +49 -43
  100. data/dependencies/SDL_sound/dr_flac.h +10925 -4466
  101. data/dependencies/SDL_sound/dr_mp3.h +2802 -844
  102. data/dependencies/SDL_sound/libmodplug/fastmix.c +63 -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 +12 -7
  106. data/dependencies/SDL_sound/libmodplug/load_ams.c +103 -44
  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 +61 -61
  112. data/dependencies/SDL_sound/libmodplug/load_mdl.c +94 -58
  113. data/dependencies/SDL_sound/libmodplug/load_med.c +20 -11
  114. data/dependencies/SDL_sound/libmodplug/load_mod.c +40 -15
  115. data/dependencies/SDL_sound/libmodplug/load_mt2.c +50 -19
  116. data/dependencies/SDL_sound/libmodplug/load_okt.c +59 -28
  117. data/dependencies/SDL_sound/libmodplug/load_psm.c +104 -79
  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 +4 -3
  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 +32 -19
  130. data/dependencies/SDL_sound/libmodplug/sndfile.c +76 -160
  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 +504 -329
  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 +4848 -0
  137. data/dependencies/stb/stb_image.h +208 -73
  138. data/dependencies/stb/stb_image_write.h +57 -23
  139. data/dependencies/stb/stb_truetype.h +345 -279
  140. data/dependencies/utf8proc/utf8proc.c +37 -18
  141. data/dependencies/utf8proc/utf8proc.h +17 -5
  142. data/dependencies/utf8proc/utf8proc_data.h +12012 -10089
  143. data/ext/gosu/extconf.rb +29 -30
  144. data/include/Gosu/Audio.hpp +70 -85
  145. data/include/Gosu/Buttons.hpp +103 -103
  146. data/include/Gosu/Color.hpp +19 -11
  147. data/include/Gosu/Directories.hpp +31 -24
  148. data/include/Gosu/Font.hpp +42 -44
  149. data/include/Gosu/Gosu.hpp +5 -8
  150. data/include/Gosu/Graphics.hpp +58 -71
  151. data/include/Gosu/GraphicsBase.hpp +26 -33
  152. data/include/Gosu/IO.hpp +0 -3
  153. data/include/Gosu/Image.hpp +56 -62
  154. data/include/Gosu/ImageData.hpp +23 -27
  155. data/include/Gosu/Inspection.hpp +1 -4
  156. data/include/Gosu/Math.hpp +0 -3
  157. data/include/Gosu/TextInput.hpp +34 -40
  158. data/include/Gosu/Timing.hpp +2 -8
  159. data/include/Gosu/Version.hpp +2 -2
  160. data/include/Gosu/Window.hpp +71 -70
  161. data/lib/SDL2.dll +0 -0
  162. data/lib/gosu/compat.rb +24 -37
  163. data/lib/gosu.rb +2 -2
  164. data/lib64/SDL2.dll +0 -0
  165. data/src/Audio.cpp +88 -86
  166. data/src/AudioFile.hpp +6 -6
  167. data/src/AudioFileAudioToolbox.cpp +1 -1
  168. data/src/AudioFileSDLSound.cpp +1 -1
  169. data/src/AudioImpl.cpp +0 -7
  170. data/src/AudioImpl.hpp +6 -8
  171. data/src/BitmapIO.cpp +23 -22
  172. data/src/BlockAllocator.cpp +2 -1
  173. data/src/Channel.cpp +22 -20
  174. data/src/Color.cpp +12 -9
  175. data/src/DirectoriesApple.cpp +25 -24
  176. data/src/DirectoriesUnix.cpp +14 -12
  177. data/src/DirectoriesWin.cpp +26 -30
  178. data/src/EmptyImageData.hpp +15 -17
  179. data/src/FileUnix.cpp +1 -1
  180. data/src/FileWin.cpp +1 -1
  181. data/src/Font.cpp +59 -54
  182. data/src/Graphics.cpp +135 -143
  183. data/src/Image.cpp +41 -47
  184. data/src/Input.cpp +1 -1
  185. data/src/InputUIKit.cpp +1 -1
  186. data/src/LargeImageData.cpp +108 -101
  187. data/src/LargeImageData.hpp +17 -15
  188. data/src/Log.hpp +6 -6
  189. data/src/Macro.cpp +35 -37
  190. data/src/Macro.hpp +11 -11
  191. data/src/Math.cpp +8 -1
  192. data/src/Resolution.cpp +12 -7
  193. data/src/RubyGosu.cxx +11 -39
  194. data/src/TexChunk.cpp +50 -41
  195. data/src/TexChunk.hpp +22 -22
  196. data/src/Text.cpp +37 -37
  197. data/src/TextBuilder.cpp +60 -57
  198. data/src/TextBuilder.hpp +20 -20
  199. data/src/TextInput.cpp +127 -135
  200. data/src/TimingApple.cpp +1 -7
  201. data/src/TimingUnix.cpp +0 -6
  202. data/src/TimingWin.cpp +0 -6
  203. data/src/TrueTypeFont.cpp +107 -107
  204. data/src/TrueTypeFont.hpp +39 -38
  205. data/src/TrueTypeFontApple.cpp +19 -22
  206. data/src/TrueTypeFontUnix.cpp +21 -26
  207. data/src/TrueTypeFontWin.cpp +30 -30
  208. data/src/Window.cpp +97 -87
  209. data/src/WindowUIKit.cpp +46 -49
  210. metadata +7 -17
  211. data/dependencies/SDL/include/SDL_config_os2.h +0 -188
  212. data/dependencies/SDL_sound/libmodplug/load_abc.c +0 -4725
  213. data/dependencies/SDL_sound/libmodplug/load_mid.c +0 -1405
  214. data/dependencies/SDL_sound/libmodplug/load_pat.c +0 -1143
  215. data/dependencies/SDL_sound/libmodplug/load_pat.h +0 -25
  216. data/dependencies/al_soft/AL/alext.h +0 -585
  217. data/dependencies/al_soft/AL/efx-creative.h +0 -3
  218. data/dependencies/al_soft/AL/efx-presets.h +0 -402
  219. data/dependencies/al_soft/AL/efx.h +0 -762
  220. data/dependencies/al_soft/x64/libOpenAL32.dll.a +0 -0
  221. data/dependencies/al_soft/x86/libOpenAL32.dll.a +0 -0
  222. data/lib/OpenAL32.dll +0 -0
  223. 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
@@ -112,90 +112,283 @@ typedef enum
112
112
 
113
113
 
114
114
  /**
115
- * \brief Set the priority of all log categories
115
+ * Set the priority of all log categories.
116
+ *
117
+ * \param priority the SDL_LogPriority to assign
118
+ *
119
+ * \since This function is available since SDL 2.0.0.
120
+ *
121
+ * \sa SDL_LogSetPriority
116
122
  */
117
123
  extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
118
124
 
119
125
  /**
120
- * \brief Set the priority of a particular log category
126
+ * Set the priority of a particular log category.
127
+ *
128
+ * \param category the category to assign a priority to
129
+ * \param priority the SDL_LogPriority to assign
130
+ *
131
+ * \since This function is available since SDL 2.0.0.
132
+ *
133
+ * \sa SDL_LogGetPriority
134
+ * \sa SDL_LogSetAllPriority
121
135
  */
122
136
  extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
123
137
  SDL_LogPriority priority);
124
138
 
125
139
  /**
126
- * \brief Get the priority of a particular log category
140
+ * Get the priority of a particular log category.
141
+ *
142
+ * \param category the category to query
143
+ * \returns the SDL_LogPriority for the requested category
144
+ *
145
+ * \since This function is available since SDL 2.0.0.
146
+ *
147
+ * \sa SDL_LogSetPriority
127
148
  */
128
149
  extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
129
150
 
130
151
  /**
131
- * \brief Reset all priorities to default.
152
+ * Reset all priorities to default.
132
153
  *
133
- * \note This is called in SDL_Quit().
154
+ * This is called by SDL_Quit().
155
+ *
156
+ * \since This function is available since SDL 2.0.0.
157
+ *
158
+ * \sa SDL_LogSetAllPriority
159
+ * \sa SDL_LogSetPriority
134
160
  */
135
161
  extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
136
162
 
137
163
  /**
138
- * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
164
+ * Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO.
165
+ *
166
+ * = * \param fmt a printf() style message format string
167
+ *
168
+ * \param ... additional parameters matching % tokens in the `fmt` string, if
169
+ * any
170
+ *
171
+ * \since This function is available since SDL 2.0.0.
172
+ *
173
+ * \sa SDL_LogCritical
174
+ * \sa SDL_LogDebug
175
+ * \sa SDL_LogError
176
+ * \sa SDL_LogInfo
177
+ * \sa SDL_LogMessage
178
+ * \sa SDL_LogMessageV
179
+ * \sa SDL_LogVerbose
180
+ * \sa SDL_LogWarn
139
181
  */
140
182
  extern DECLSPEC void SDLCALL SDL_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1);
141
183
 
142
184
  /**
143
- * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
185
+ * Log a message with SDL_LOG_PRIORITY_VERBOSE.
186
+ *
187
+ * \param category the category of the message
188
+ * \param fmt a printf() style message format string
189
+ * \param ... additional parameters matching % tokens in the **fmt** string,
190
+ * if any
191
+ *
192
+ * \since This function is available since SDL 2.0.0.
193
+ *
194
+ * \sa SDL_Log
195
+ * \sa SDL_LogCritical
196
+ * \sa SDL_LogDebug
197
+ * \sa SDL_LogError
198
+ * \sa SDL_LogInfo
199
+ * \sa SDL_LogMessage
200
+ * \sa SDL_LogMessageV
201
+ * \sa SDL_LogWarn
144
202
  */
145
203
  extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
146
204
 
147
205
  /**
148
- * \brief Log a message with SDL_LOG_PRIORITY_DEBUG
206
+ * Log a message with SDL_LOG_PRIORITY_DEBUG.
207
+ *
208
+ * \param category the category of the message
209
+ * \param fmt a printf() style message format string
210
+ * \param ... additional parameters matching % tokens in the **fmt** string,
211
+ * if any
212
+ *
213
+ * \since This function is available since SDL 2.0.0.
214
+ *
215
+ * \sa SDL_Log
216
+ * \sa SDL_LogCritical
217
+ * \sa SDL_LogError
218
+ * \sa SDL_LogInfo
219
+ * \sa SDL_LogMessage
220
+ * \sa SDL_LogMessageV
221
+ * \sa SDL_LogVerbose
222
+ * \sa SDL_LogWarn
149
223
  */
150
224
  extern DECLSPEC void SDLCALL SDL_LogDebug(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
151
225
 
152
226
  /**
153
- * \brief Log a message with SDL_LOG_PRIORITY_INFO
227
+ * Log a message with SDL_LOG_PRIORITY_INFO.
228
+ *
229
+ * \param category the category of the message
230
+ * \param fmt a printf() style message format string
231
+ * \param ... additional parameters matching % tokens in the **fmt** string,
232
+ * if any
233
+ *
234
+ * \since This function is available since SDL 2.0.0.
235
+ *
236
+ * \sa SDL_Log
237
+ * \sa SDL_LogCritical
238
+ * \sa SDL_LogDebug
239
+ * \sa SDL_LogError
240
+ * \sa SDL_LogMessage
241
+ * \sa SDL_LogMessageV
242
+ * \sa SDL_LogVerbose
243
+ * \sa SDL_LogWarn
154
244
  */
155
245
  extern DECLSPEC void SDLCALL SDL_LogInfo(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
156
246
 
157
247
  /**
158
- * \brief Log a message with SDL_LOG_PRIORITY_WARN
248
+ * Log a message with SDL_LOG_PRIORITY_WARN.
249
+ *
250
+ * \param category the category of the message
251
+ * \param fmt a printf() style message format string
252
+ * \param ... additional parameters matching % tokens in the **fmt** string,
253
+ * if any
254
+ *
255
+ * \since This function is available since SDL 2.0.0.
256
+ *
257
+ * \sa SDL_Log
258
+ * \sa SDL_LogCritical
259
+ * \sa SDL_LogDebug
260
+ * \sa SDL_LogError
261
+ * \sa SDL_LogInfo
262
+ * \sa SDL_LogMessage
263
+ * \sa SDL_LogMessageV
264
+ * \sa SDL_LogVerbose
159
265
  */
160
266
  extern DECLSPEC void SDLCALL SDL_LogWarn(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
161
267
 
162
268
  /**
163
- * \brief Log a message with SDL_LOG_PRIORITY_ERROR
269
+ * Log a message with SDL_LOG_PRIORITY_ERROR.
270
+ *
271
+ * \param category the category of the message
272
+ * \param fmt a printf() style message format string
273
+ * \param ... additional parameters matching % tokens in the **fmt** string,
274
+ * if any
275
+ *
276
+ * \since This function is available since SDL 2.0.0.
277
+ *
278
+ * \sa SDL_Log
279
+ * \sa SDL_LogCritical
280
+ * \sa SDL_LogDebug
281
+ * \sa SDL_LogInfo
282
+ * \sa SDL_LogMessage
283
+ * \sa SDL_LogMessageV
284
+ * \sa SDL_LogVerbose
285
+ * \sa SDL_LogWarn
164
286
  */
165
287
  extern DECLSPEC void SDLCALL SDL_LogError(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
166
288
 
167
289
  /**
168
- * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
290
+ * Log a message with SDL_LOG_PRIORITY_CRITICAL.
291
+ *
292
+ * \param category the category of the message
293
+ * \param fmt a printf() style message format string
294
+ * \param ... additional parameters matching % tokens in the **fmt** string,
295
+ * if any
296
+ *
297
+ * \since This function is available since SDL 2.0.0.
298
+ *
299
+ * \sa SDL_Log
300
+ * \sa SDL_LogDebug
301
+ * \sa SDL_LogError
302
+ * \sa SDL_LogInfo
303
+ * \sa SDL_LogMessage
304
+ * \sa SDL_LogMessageV
305
+ * \sa SDL_LogVerbose
306
+ * \sa SDL_LogWarn
169
307
  */
170
308
  extern DECLSPEC void SDLCALL SDL_LogCritical(int category, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
171
309
 
172
310
  /**
173
- * \brief Log a message with the specified category and priority.
311
+ * Log a message with the specified category and priority.
312
+ *
313
+ * \param category the category of the message
314
+ * \param priority the priority of the message
315
+ * \param fmt a printf() style message format string
316
+ * \param ... additional parameters matching % tokens in the **fmt** string,
317
+ * if any
318
+ *
319
+ * \since This function is available since SDL 2.0.0.
320
+ *
321
+ * \sa SDL_Log
322
+ * \sa SDL_LogCritical
323
+ * \sa SDL_LogDebug
324
+ * \sa SDL_LogError
325
+ * \sa SDL_LogInfo
326
+ * \sa SDL_LogMessageV
327
+ * \sa SDL_LogVerbose
328
+ * \sa SDL_LogWarn
174
329
  */
175
330
  extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
176
331
  SDL_LogPriority priority,
177
332
  SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(3);
178
333
 
179
334
  /**
180
- * \brief Log a message with the specified category and priority.
335
+ * Log a message with the specified category and priority.
336
+ *
337
+ * \param category the category of the message
338
+ * \param priority the priority of the message
339
+ * \param fmt a printf() style message format string
340
+ * \param ap a variable argument list
341
+ *
342
+ * \since This function is available since SDL 2.0.0.
343
+ *
344
+ * \sa SDL_Log
345
+ * \sa SDL_LogCritical
346
+ * \sa SDL_LogDebug
347
+ * \sa SDL_LogError
348
+ * \sa SDL_LogInfo
349
+ * \sa SDL_LogMessage
350
+ * \sa SDL_LogVerbose
351
+ * \sa SDL_LogWarn
181
352
  */
182
353
  extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
183
354
  SDL_LogPriority priority,
184
355
  const char *fmt, va_list ap);
185
356
 
186
357
  /**
187
- * \brief The prototype for the log output function
358
+ * The prototype for the log output callback function.
359
+ *
360
+ * This function is called by SDL when there is new text to be logged.
361
+ *
362
+ * \param userdata what was passed as `userdata` to SDL_LogSetOutputFunction()
363
+ * \param category the category of the message
364
+ * \param priority the priority of the message
365
+ * \param message the message being output
188
366
  */
189
367
  typedef void (SDLCALL *SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
190
368
 
191
369
  /**
192
- * \brief Get the current log output function.
370
+ * Get the current log output function.
371
+ *
372
+ * \param callback an SDL_LogOutputFunction filled in with the current log
373
+ * callback
374
+ * \param userdata a pointer filled in with the pointer that is passed to
375
+ * `callback`
376
+ *
377
+ * \since This function is available since SDL 2.0.0.
378
+ *
379
+ * \sa SDL_LogSetOutputFunction
193
380
  */
194
381
  extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
195
382
 
196
383
  /**
197
- * \brief This function allows you to replace the default log output
198
- * function with one of your own.
384
+ * Replace the default log output function with one of your own.
385
+ *
386
+ * \param callback an SDL_LogOutputFunction to call instead of the default
387
+ * \param userdata a pointer that is passed to `callback`
388
+ *
389
+ * \since This function is available since SDL 2.0.0.
390
+ *
391
+ * \sa SDL_LogGetOutputFunction
199
392
  */
200
393
  extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
201
394
 
@@ -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
@@ -83,6 +83,15 @@
83
83
  */
84
84
  #define SDL_MAIN_NEEDED
85
85
 
86
+ #elif defined(__PSP__)
87
+ /* On PSP SDL provides a main function that sets the module info,
88
+ activates the GPU and starts the thread required to be able to exit
89
+ the software.
90
+
91
+ If you provide this yourself, you may define SDL_MAIN_HANDLED
92
+ */
93
+ #define SDL_MAIN_AVAILABLE
94
+
86
95
  #endif
87
96
  #endif /* SDL_MAIN_HANDLED */
88
97
 
@@ -122,20 +131,62 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
122
131
 
123
132
 
124
133
  /**
125
- * This is called by the real SDL main function to let the rest of the
126
- * library know that initialization was done properly.
134
+ * Circumvent failure of SDL_Init() when not using SDL_main() as an entry
135
+ * point.
136
+ *
137
+ * This function is defined in SDL_main.h, along with the preprocessor rule to
138
+ * redefine main() as SDL_main(). Thus to ensure that your main() function
139
+ * will not be changed it is necessary to define SDL_MAIN_HANDLED before
140
+ * including SDL.h.
127
141
  *
128
- * Calling this yourself without knowing what you're doing can cause
129
- * crashes and hard to diagnose problems with your application.
142
+ * \since This function is available since SDL 2.0.0.
143
+ *
144
+ * \sa SDL_Init
130
145
  */
131
146
  extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
132
147
 
133
148
  #ifdef __WIN32__
134
149
 
135
150
  /**
136
- * This can be called to set the application class at startup
151
+ * Register a win32 window class for SDL's use.
152
+ *
153
+ * This can be called to set the application window class at startup. It is
154
+ * safe to call this multiple times, as long as every call is eventually
155
+ * paired with a call to SDL_UnregisterApp, but a second registration attempt
156
+ * while a previous registration is still active will be ignored, other than
157
+ * to increment a counter.
158
+ *
159
+ * Most applications do not need to, and should not, call this directly; SDL
160
+ * will call it when initializing the video subsystem.
161
+ *
162
+ * \param name the window class name, in UTF-8 encoding. If NULL, SDL
163
+ * currently uses "SDL_app" but this isn't guaranteed.
164
+ * \param style the value to use in WNDCLASSEX::style. If `name` is NULL, SDL
165
+ * currently uses `(CS_BYTEALIGNCLIENT | CS_OWNDC)` regardless of
166
+ * what is specified here.
167
+ * \param hInst the HINSTANCE to use in WNDCLASSEX::hInstance. If zero, SDL
168
+ * will use `GetModuleHandle(NULL)` instead.
169
+ * \returns 0 on success, -1 on error. SDL_GetError() may have details.
170
+ *
171
+ * \since This function is available since SDL 2.0.2.
172
+ */
173
+ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
174
+
175
+ /**
176
+ * Deregister the win32 window class from an SDL_RegisterApp call.
177
+ *
178
+ * This can be called to undo the effects of SDL_RegisterApp.
179
+ *
180
+ * Most applications do not need to, and should not, call this directly; SDL
181
+ * will call it when deinitializing the video subsystem.
182
+ *
183
+ * It is safe to call this multiple times, as long as every call is eventually
184
+ * paired with a prior call to SDL_RegisterApp. The window class will only be
185
+ * deregistered when the registration counter in SDL_RegisterApp decrements to
186
+ * zero through calls to this function.
187
+ *
188
+ * \since This function is available since SDL 2.0.2.
137
189
  */
138
- extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
139
190
  extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
140
191
 
141
192
  #endif /* __WIN32__ */
@@ -144,12 +195,14 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
144
195
  #ifdef __WINRT__
145
196
 
146
197
  /**
147
- * \brief Initializes and launches an SDL/WinRT application.
198
+ * Initialize and launch an SDL/WinRT application.
148
199
  *
149
- * \param mainFunction The SDL app's C-style main().
150
- * \param reserved Reserved for future use; should be NULL
151
- * \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
152
- * information on the failure.
200
+ * \param mainFunction the SDL app's C-style main(), an SDL_main_func
201
+ * \param reserved reserved for future use; should be NULL
202
+ * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
203
+ * more information on the failure.
204
+ *
205
+ * \since This function is available since SDL 2.0.3.
153
206
  */
154
207
  extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
155
208
 
@@ -158,12 +211,14 @@ extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * r
158
211
  #if defined(__IPHONEOS__)
159
212
 
160
213
  /**
161
- * \brief Initializes and launches an SDL application.
214
+ * Initializes and launches an SDL application.
215
+ *
216
+ * \param argc The argc parameter from the application's main() function
217
+ * \param argv The argv parameter from the application's main() function
218
+ * \param mainFunction The SDL app's C-style main(), an SDL_main_func
219
+ * \return the return value from mainFunction
162
220
  *
163
- * \param argc The argc parameter from the application's main() function
164
- * \param argv The argv parameter from the application's main() function
165
- * \param mainFunction The SDL app's C-style main().
166
- * \return the return value from mainFunction
221
+ * \since This function is available since SDL 2.0.10.
167
222
  */
168
223
  extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
169
224
 
@@ -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
@@ -32,7 +32,7 @@ extern "C" {
32
32
  #endif
33
33
 
34
34
  /**
35
- * \brief SDL_MessageBox flags. If supported will display warning icon, etc.
35
+ * SDL_MessageBox flags. If supported will display warning icon, etc.
36
36
  */
37
37
  typedef enum
38
38
  {
@@ -44,7 +44,7 @@ typedef enum
44
44
  } SDL_MessageBoxFlags;
45
45
 
46
46
  /**
47
- * \brief Flags for SDL_MessageBoxButtonData.
47
+ * Flags for SDL_MessageBoxButtonData.
48
48
  */
49
49
  typedef enum
50
50
  {
@@ -53,7 +53,7 @@ typedef enum
53
53
  } SDL_MessageBoxButtonFlags;
54
54
 
55
55
  /**
56
- * \brief Individual button data.
56
+ * Individual button data.
57
57
  */
58
58
  typedef struct
59
59
  {
@@ -63,7 +63,7 @@ typedef struct
63
63
  } SDL_MessageBoxButtonData;
64
64
 
65
65
  /**
66
- * \brief RGB value used in a message box color scheme
66
+ * RGB value used in a message box color scheme
67
67
  */
68
68
  typedef struct
69
69
  {
@@ -81,7 +81,7 @@ typedef enum
81
81
  } SDL_MessageBoxColorType;
82
82
 
83
83
  /**
84
- * \brief A set of colors to use for message box dialogs
84
+ * A set of colors to use for message box dialogs
85
85
  */
86
86
  typedef struct
87
87
  {
@@ -89,7 +89,7 @@ typedef struct
89
89
  } SDL_MessageBoxColorScheme;
90
90
 
91
91
  /**
92
- * \brief MessageBox structure containing title, text, window, etc.
92
+ * MessageBox structure containing title, text, window, etc.
93
93
  */
94
94
  typedef struct
95
95
  {
@@ -105,32 +105,79 @@ typedef struct
105
105
  } SDL_MessageBoxData;
106
106
 
107
107
  /**
108
- * \brief Create a modal message box.
108
+ * Create a modal message box.
109
109
  *
110
- * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
111
- * \param buttonid The pointer to which user id of hit button should be copied.
110
+ * If your needs aren't complex, it might be easier to use
111
+ * SDL_ShowSimpleMessageBox.
112
112
  *
113
- * \return -1 on error, otherwise 0 and buttonid contains user id of button
114
- * hit or -1 if dialog was closed.
113
+ * This function should be called on the thread that created the parent
114
+ * window, or on the main thread if the messagebox has no parent. It will
115
+ * block execution of that thread until the user clicks a button or closes the
116
+ * messagebox.
115
117
  *
116
- * \note This function should be called on the thread that created the parent
117
- * window, or on the main thread if the messagebox has no parent. It will
118
- * block execution of that thread until the user clicks a button or
119
- * closes the messagebox.
118
+ * This function may be called at any time, even before SDL_Init(). This makes
119
+ * it useful for reporting errors like a failure to create a renderer or
120
+ * OpenGL context.
121
+ *
122
+ * On X11, SDL rolls its own dialog box with X11 primitives instead of a
123
+ * formal toolkit like GTK+ or Qt.
124
+ *
125
+ * Note that if SDL_Init() would fail because there isn't any available video
126
+ * target, this function is likely to fail for the same reasons. If this is a
127
+ * concern, check the return value from this function and fall back to writing
128
+ * to stderr if you can.
129
+ *
130
+ * \param messageboxdata the SDL_MessageBoxData structure with title, text and
131
+ * other options
132
+ * \param buttonid the pointer to which user id of hit button should be copied
133
+ * \returns 0 on success or a negative error code on failure; call
134
+ * SDL_GetError() for more information.
135
+ *
136
+ * \since This function is available since SDL 2.0.0.
137
+ *
138
+ * \sa SDL_ShowSimpleMessageBox
120
139
  */
121
140
  extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid);
122
141
 
123
142
  /**
124
- * \brief Create a simple modal message box
143
+ * Display a simple modal message box.
144
+ *
145
+ * If your needs aren't complex, this function is preferred over
146
+ * SDL_ShowMessageBox.
147
+ *
148
+ * `flags` may be any of the following:
149
+ *
150
+ * - `SDL_MESSAGEBOX_ERROR`: error dialog
151
+ * - `SDL_MESSAGEBOX_WARNING`: warning dialog
152
+ * - `SDL_MESSAGEBOX_INFORMATION`: informational dialog
153
+ *
154
+ * This function should be called on the thread that created the parent
155
+ * window, or on the main thread if the messagebox has no parent. It will
156
+ * block execution of that thread until the user clicks a button or closes the
157
+ * messagebox.
158
+ *
159
+ * This function may be called at any time, even before SDL_Init(). This makes
160
+ * it useful for reporting errors like a failure to create a renderer or
161
+ * OpenGL context.
162
+ *
163
+ * On X11, SDL rolls its own dialog box with X11 primitives instead of a
164
+ * formal toolkit like GTK+ or Qt.
165
+ *
166
+ * Note that if SDL_Init() would fail because there isn't any available video
167
+ * target, this function is likely to fail for the same reasons. If this is a
168
+ * concern, check the return value from this function and fall back to writing
169
+ * to stderr if you can.
125
170
  *
126
- * \param flags ::SDL_MessageBoxFlags
127
- * \param title UTF-8 title text
128
- * \param message UTF-8 message text
129
- * \param window The parent window, or NULL for no parent
171
+ * \param flags an SDL_MessageBoxFlags value
172
+ * \param title UTF-8 title text
173
+ * \param message UTF-8 message text
174
+ * \param window the parent window, or NULL for no parent
175
+ * \returns 0 on success or a negative error code on failure; call
176
+ * SDL_GetError() for more information.
130
177
  *
131
- * \return 0 on success, -1 on error
178
+ * \since This function is available since SDL 2.0.0.
132
179
  *
133
- * \sa SDL_ShowMessageBox
180
+ * \sa SDL_ShowMessageBox
134
181
  */
135
182
  extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window);
136
183