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
@@ -98,6 +98,10 @@ typedef struct _UIViewController UIViewController;
98
98
  typedef Uint32 GLuint;
99
99
  #endif
100
100
 
101
+ #if defined(SDL_VIDEO_VULKAN) || defined(SDL_VIDEO_METAL)
102
+ #define SDL_METALVIEW_TAG 255
103
+ #endif
104
+
101
105
  #if defined(SDL_VIDEO_DRIVER_ANDROID)
102
106
  typedef struct ANativeWindow ANativeWindow;
103
107
  typedef void *EGLSurface;
@@ -113,6 +117,10 @@ typedef void *EGLSurface;
113
117
  #endif
114
118
  #endif /* SDL_PROTOTYPES_ONLY */
115
119
 
120
+ #if defined(SDL_VIDEO_DRIVER_KMSDRM)
121
+ struct gbm_device;
122
+ #endif
123
+
116
124
 
117
125
  #include "begin_code.h"
118
126
  /* Set up for C function definitions, even when using C++ */
@@ -138,7 +146,9 @@ typedef enum
138
146
  SDL_SYSWM_ANDROID,
139
147
  SDL_SYSWM_VIVANTE,
140
148
  SDL_SYSWM_OS2,
141
- SDL_SYSWM_HAIKU
149
+ SDL_SYSWM_HAIKU,
150
+ SDL_SYSWM_KMSDRM,
151
+ SDL_SYSWM_RISCOS
142
152
  } SDL_SYSWM_TYPE;
143
153
 
144
154
  /**
@@ -251,8 +261,12 @@ struct SDL_SysWMinfo
251
261
  #if defined(SDL_VIDEO_DRIVER_COCOA)
252
262
  struct
253
263
  {
254
- #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
264
+ #if defined(__OBJC__) && defined(__has_feature)
265
+ #if __has_feature(objc_arc)
255
266
  NSWindow __unsafe_unretained *window; /**< The Cocoa window */
267
+ #else
268
+ NSWindow *window; /**< The Cocoa window */
269
+ #endif
256
270
  #else
257
271
  NSWindow *window; /**< The Cocoa window */
258
272
  #endif
@@ -261,8 +275,12 @@ struct SDL_SysWMinfo
261
275
  #if defined(SDL_VIDEO_DRIVER_UIKIT)
262
276
  struct
263
277
  {
264
- #if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
278
+ #if defined(__OBJC__) && defined(__has_feature)
279
+ #if __has_feature(objc_arc)
265
280
  UIWindow __unsafe_unretained *window; /**< The UIKit window */
281
+ #else
282
+ UIWindow *window; /**< The UIKit window */
283
+ #endif
266
284
  #else
267
285
  UIWindow *window; /**< The UIKit window */
268
286
  #endif
@@ -274,9 +292,12 @@ struct SDL_SysWMinfo
274
292
  #if defined(SDL_VIDEO_DRIVER_WAYLAND)
275
293
  struct
276
294
  {
277
- struct wl_display *display; /**< Wayland display */
278
- struct wl_surface *surface; /**< Wayland surface */
279
- struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
295
+ struct wl_display *display; /**< Wayland display */
296
+ struct wl_surface *surface; /**< Wayland surface */
297
+ void *shell_surface; /**< DEPRECATED Wayland shell_surface (window manager handle) */
298
+ struct wl_egl_window *egl_window; /**< Wayland EGL window (native window) */
299
+ struct xdg_surface *xdg_surface; /**< Wayland xdg surface (window manager handle) */
300
+ struct xdg_toplevel *xdg_toplevel; /**< Wayland xdg toplevel role */
280
301
  } wl;
281
302
  #endif
282
303
  #if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
@@ -311,6 +332,15 @@ struct SDL_SysWMinfo
311
332
  } vivante;
312
333
  #endif
313
334
 
335
+ #if defined(SDL_VIDEO_DRIVER_KMSDRM)
336
+ struct
337
+ {
338
+ int dev_index; /**< Device index (ex: the X in /dev/dri/cardX) */
339
+ int drm_fd; /**< DRM FD (unavailable on Vulkan windows) */
340
+ struct gbm_device *gbm_dev; /**< GBM device (unavailable on Vulkan windows) */
341
+ } kmsdrm;
342
+ #endif
343
+
314
344
  /* Make sure this union is always 64 bytes (8 64-bit pointers). */
315
345
  /* Be careful not to overflow this if you add a new target! */
316
346
  Uint8 dummy[64];
@@ -321,23 +351,23 @@ struct SDL_SysWMinfo
321
351
 
322
352
  typedef struct SDL_SysWMinfo SDL_SysWMinfo;
323
353
 
324
- /* Function prototypes */
354
+
325
355
  /**
326
- * \brief This function allows access to driver-dependent window information.
356
+ * Get driver-specific information about a window.
357
+ *
358
+ * You must include SDL_syswm.h for the declaration of SDL_SysWMinfo.
327
359
  *
328
- * \param window The window about which information is being requested
329
- * \param info This structure must be initialized with the SDL version, and is
330
- * then filled in with information about the given window.
360
+ * The caller must initialize the `info` structure's version by using
361
+ * `SDL_VERSION(&info.version)`, and then this function will fill in the rest
362
+ * of the structure with information about the given window.
331
363
  *
332
- * \return SDL_TRUE if the function is implemented and the version member of
333
- * the \c info struct is valid, SDL_FALSE otherwise.
364
+ * \param window the window about which information is being requested
365
+ * \param info an SDL_SysWMinfo structure filled in with window information
366
+ * \returns SDL_TRUE if the function is implemented and the `version` member
367
+ * of the `info` struct is valid, or SDL_FALSE if the information
368
+ * could not be retrieved; call SDL_GetError() for more information.
334
369
  *
335
- * You typically use this function like this:
336
- * \code
337
- * SDL_SysWMinfo info;
338
- * SDL_VERSION(&info.version);
339
- * if ( SDL_GetWindowWMInfo(window, &info) ) { ... }
340
- * \endcode
370
+ * \since This function is available since SDL 2.0.0.
341
371
  */
342
372
  extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
343
373
  SDL_SysWMinfo * info);
@@ -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
@@ -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
@@ -66,7 +66,7 @@ void SDLTest_Assert(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *as
66
66
  * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0).
67
67
  * \param assertDescription Message to log with the assert describing it.
68
68
  *
69
- * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired.
69
+ * \returns the assertCondition so it can be used to externally to break execution flow if desired.
70
70
  */
71
71
  int SDLTest_AssertCheck(int assertCondition, SDL_PRINTF_FORMAT_STRING const char *assertDescription, ...) SDL_PRINTF_VARARG_FUNC(2);
72
72
 
@@ -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
@@ -37,6 +37,9 @@
37
37
  #if defined(__PSP__)
38
38
  #define DEFAULT_WINDOW_WIDTH 480
39
39
  #define DEFAULT_WINDOW_HEIGHT 272
40
+ #elif defined(__VITA__)
41
+ #define DEFAULT_WINDOW_WIDTH 960
42
+ #define DEFAULT_WINDOW_HEIGHT 544
40
43
  #else
41
44
  #define DEFAULT_WINDOW_WIDTH 640
42
45
  #define DEFAULT_WINDOW_HEIGHT 480
@@ -61,6 +64,7 @@ typedef struct
61
64
  const char *window_title;
62
65
  const char *window_icon;
63
66
  Uint32 window_flags;
67
+ SDL_bool flash_on_focus_loss;
64
68
  int window_x;
65
69
  int window_y;
66
70
  int window_w;
@@ -110,6 +114,10 @@ typedef struct
110
114
  int gl_minor_version;
111
115
  int gl_debug;
112
116
  int gl_profile_mask;
117
+
118
+ /* Additional fields added in 2.0.18 */
119
+ SDL_Rect confine;
120
+
113
121
  } SDLTest_CommonState;
114
122
 
115
123
  #include "begin_code.h"
@@ -126,7 +134,7 @@ extern "C" {
126
134
  * \param argv Array of command line parameters
127
135
  * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO)
128
136
  *
129
- * \returns Returns a newly allocated common state object.
137
+ * \returns a newly allocated common state object.
130
138
  */
131
139
  SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
132
140
 
@@ -136,7 +144,7 @@ SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags);
136
144
  * \param state The common state describing the test window to create.
137
145
  * \param index The index of the argument to process in argv[].
138
146
  *
139
- * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
147
+ * \returns the number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error.
140
148
  */
141
149
  int SDLTest_CommonArg(SDLTest_CommonState * state, int index);
142
150
 
@@ -164,7 +172,7 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState * state, const char *argv0, cons
164
172
  * those strings' memory is freed and can no longer be used.
165
173
  *
166
174
  * \param state The common state describing the test window to create.
167
- * \returns String with usage information
175
+ * \returns a string with usage information
168
176
  */
169
177
  const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
170
178
 
@@ -173,7 +181,7 @@ const char *SDLTest_CommonUsage(SDLTest_CommonState * state);
173
181
  *
174
182
  * \param state The common state describing the test window to create.
175
183
  *
176
- * \returns True if initialization succeeded, false otherwise
184
+ * \returns SDL_TRUE if initialization succeeded, false otherwise
177
185
  */
178
186
  SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
179
187
 
@@ -184,7 +192,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state);
184
192
  * \param argc argc, as supplied to SDL_main
185
193
  * \param argv argv, as supplied to SDL_main
186
194
  *
187
- * \returns False if app should quit, true otherwise.
195
+ * \returns SDL_FALSE if app should quit, true otherwise.
188
196
  */
189
197
  SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState * state, const int argc, char **argv);
190
198
 
@@ -206,6 +214,15 @@ void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *do
206
214
  */
207
215
  void SDLTest_CommonQuit(SDLTest_CommonState * state);
208
216
 
217
+ /**
218
+ * \brief Draws various window information (position, size, etc.) to the renderer.
219
+ *
220
+ * \param renderer The renderer to draw to.
221
+ * \param window The window whose information should be displayed.
222
+ * \param usedHeight Returns the height used, so the caller can draw more below.
223
+ *
224
+ */
225
+ void SDLTest_CommonDrawWindowInfo(SDL_Renderer * renderer, SDL_Window * window, int * usedHeight);
209
226
 
210
227
  /* Ends C function definitions when using C++ */
211
228
  #ifdef __cplusplus
@@ -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
@@ -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
@@ -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
@@ -48,7 +48,7 @@ extern "C" {
48
48
  * \param y The Y coordinate of the upper left corner of the character.
49
49
  * \param c The character to draw.
50
50
  *
51
- * \returns Returns 0 on success, -1 on failure.
51
+ * \returns 0 on success, -1 on failure.
52
52
  */
53
53
  int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
54
54
 
@@ -60,7 +60,7 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
60
60
  * \param y The Y coordinate of the upper left corner of the string.
61
61
  * \param s The string to draw.
62
62
  *
63
- * \returns Returns 0 on success, -1 on failure.
63
+ * \returns 0 on success, -1 on failure.
64
64
  */
65
65
  int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
66
66
 
@@ -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
@@ -66,14 +66,14 @@ void SDLTest_FuzzerInit(Uint64 execKey);
66
66
  /**
67
67
  * Returns a random Uint8
68
68
  *
69
- * \returns Generated integer
69
+ * \returns a generated integer
70
70
  */
71
71
  Uint8 SDLTest_RandomUint8(void);
72
72
 
73
73
  /**
74
74
  * Returns a random Sint8
75
75
  *
76
- * \returns Generated signed integer
76
+ * \returns a generated signed integer
77
77
  */
78
78
  Sint8 SDLTest_RandomSint8(void);
79
79
 
@@ -81,14 +81,14 @@ Sint8 SDLTest_RandomSint8(void);
81
81
  /**
82
82
  * Returns a random Uint16
83
83
  *
84
- * \returns Generated integer
84
+ * \returns a generated integer
85
85
  */
86
86
  Uint16 SDLTest_RandomUint16(void);
87
87
 
88
88
  /**
89
89
  * Returns a random Sint16
90
90
  *
91
- * \returns Generated signed integer
91
+ * \returns a generated signed integer
92
92
  */
93
93
  Sint16 SDLTest_RandomSint16(void);
94
94
 
@@ -96,7 +96,7 @@ Sint16 SDLTest_RandomSint16(void);
96
96
  /**
97
97
  * Returns a random integer
98
98
  *
99
- * \returns Generated integer
99
+ * \returns a generated integer
100
100
  */
101
101
  Sint32 SDLTest_RandomSint32(void);
102
102
 
@@ -104,14 +104,14 @@ Sint32 SDLTest_RandomSint32(void);
104
104
  /**
105
105
  * Returns a random positive integer
106
106
  *
107
- * \returns Generated integer
107
+ * \returns a generated integer
108
108
  */
109
109
  Uint32 SDLTest_RandomUint32(void);
110
110
 
111
111
  /**
112
112
  * Returns random Uint64.
113
113
  *
114
- * \returns Generated integer
114
+ * \returns a generated integer
115
115
  */
116
116
  Uint64 SDLTest_RandomUint64(void);
117
117
 
@@ -119,28 +119,28 @@ Uint64 SDLTest_RandomUint64(void);
119
119
  /**
120
120
  * Returns random Sint64.
121
121
  *
122
- * \returns Generated signed integer
122
+ * \returns a generated signed integer
123
123
  */
124
124
  Sint64 SDLTest_RandomSint64(void);
125
125
 
126
126
  /**
127
- * \returns random float in range [0.0 - 1.0[
127
+ * \returns a random float in range [0.0 - 1.0]
128
128
  */
129
129
  float SDLTest_RandomUnitFloat(void);
130
130
 
131
131
  /**
132
- * \returns random double in range [0.0 - 1.0[
132
+ * \returns a random double in range [0.0 - 1.0]
133
133
  */
134
134
  double SDLTest_RandomUnitDouble(void);
135
135
 
136
136
  /**
137
- * \returns random float.
137
+ * \returns a random float.
138
138
  *
139
139
  */
140
140
  float SDLTest_RandomFloat(void);
141
141
 
142
142
  /**
143
- * \returns random double.
143
+ * \returns a random double.
144
144
  *
145
145
  */
146
146
  double SDLTest_RandomDouble(void);
@@ -162,7 +162,7 @@ double SDLTest_RandomDouble(void);
162
162
  * \param boundary2 Upper boundary limit
163
163
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
164
164
  *
165
- * \returns Random boundary value for the given range and domain or 0 with error set
165
+ * \returns a random boundary value for the given range and domain or 0 with error set
166
166
  */
167
167
  Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain);
168
168
 
@@ -183,7 +183,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
183
183
  * \param boundary2 Upper boundary limit
184
184
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
185
185
  *
186
- * \returns Random boundary value for the given range and domain or 0 with error set
186
+ * \returns a random boundary value for the given range and domain or 0 with error set
187
187
  */
188
188
  Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain);
189
189
 
@@ -204,7 +204,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
204
204
  * \param boundary2 Upper boundary limit
205
205
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
206
206
  *
207
- * \returns Random boundary value for the given range and domain or 0 with error set
207
+ * \returns a random boundary value for the given range and domain or 0 with error set
208
208
  */
209
209
  Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain);
210
210
 
@@ -225,7 +225,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
225
225
  * \param boundary2 Upper boundary limit
226
226
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
227
227
  *
228
- * \returns Random boundary value for the given range and domain or 0 with error set
228
+ * \returns a random boundary value for the given range and domain or 0 with error set
229
229
  */
230
230
  Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain);
231
231
 
@@ -246,7 +246,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
246
246
  * \param boundary2 Upper boundary limit
247
247
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
248
248
  *
249
- * \returns Random boundary value for the given range and domain or SINT8_MIN with error set
249
+ * \returns a random boundary value for the given range and domain or SINT8_MIN with error set
250
250
  */
251
251
  Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain);
252
252
 
@@ -268,7 +268,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
268
268
  * \param boundary2 Upper boundary limit
269
269
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
270
270
  *
271
- * \returns Random boundary value for the given range and domain or SINT16_MIN with error set
271
+ * \returns a random boundary value for the given range and domain or SINT16_MIN with error set
272
272
  */
273
273
  Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain);
274
274
 
@@ -289,7 +289,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
289
289
  * \param boundary2 Upper boundary limit
290
290
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
291
291
  *
292
- * \returns Random boundary value for the given range and domain or SINT32_MIN with error set
292
+ * \returns a random boundary value for the given range and domain or SINT32_MIN with error set
293
293
  */
294
294
  Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain);
295
295
 
@@ -310,7 +310,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
310
310
  * \param boundary2 Upper boundary limit
311
311
  * \param validDomain Should the generated boundary be valid (=within the bounds) or not?
312
312
  *
313
- * \returns Random boundary value for the given range and domain or SINT64_MIN with error set
313
+ * \returns a random boundary value for the given range and domain or SINT64_MIN with error set
314
314
  */
315
315
  Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain);
316
316
 
@@ -324,7 +324,7 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL
324
324
  * \param min Minimum inclusive value of returned random number
325
325
  * \param max Maximum inclusive value of returned random number
326
326
  *
327
- * \returns Generated random integer in range
327
+ * \returns a generated random integer in range
328
328
  */
329
329
  Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
330
330
 
@@ -336,7 +336,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max);
336
336
  *
337
337
  * Note: Returned string needs to be deallocated.
338
338
  *
339
- * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated.
339
+ * \returns a newly allocated random string; or NULL if length was invalid or string could not be allocated.
340
340
  */
341
341
  char * SDLTest_RandomAsciiString(void);
342
342
 
@@ -350,7 +350,7 @@ char * SDLTest_RandomAsciiString(void);
350
350
  *
351
351
  * \param maxLength The maximum length of the generated string.
352
352
  *
353
- * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
353
+ * \returns a newly allocated random string; or NULL if maxLength was invalid or string could not be allocated.
354
354
  */
355
355
  char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
356
356
 
@@ -364,12 +364,14 @@ char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength);
364
364
  *
365
365
  * \param size The length of the generated string
366
366
  *
367
- * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated.
367
+ * \returns a newly allocated random string; or NULL if size was invalid or string could not be allocated.
368
368
  */
369
369
  char * SDLTest_RandomAsciiStringOfSize(int size);
370
370
 
371
371
  /**
372
- * Returns the invocation count for the fuzzer since last ...FuzzerInit.
372
+ * Get the invocation count for the fuzzer since last ...FuzzerInit.
373
+ *
374
+ * \returns the invocation count.
373
375
  */
374
376
  int SDLTest_GetFuzzerInvocationCount(void);
375
377
 
@@ -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
@@ -76,9 +76,9 @@ typedef struct SDLTest_TestCaseReference {
76
76
  /* !< Func2Stress */
77
77
  SDLTest_TestCaseFp testCase;
78
78
  /* !< Short name (or function name) "Func2Stress" */
79
- char *name;
79
+ const char *name;
80
80
  /* !< Long name or full description "This test pushes func2() to the limit." */
81
- char *description;
81
+ const char *description;
82
82
  /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
83
83
  int enabled;
84
84
  } SDLTest_TestCaseReference;
@@ -88,7 +88,7 @@ typedef struct SDLTest_TestCaseReference {
88
88
  */
89
89
  typedef struct SDLTest_TestSuiteReference {
90
90
  /* !< "PlatformSuite" */
91
- char *name;
91
+ const char *name;
92
92
  /* !< The function that is run before each test. NULL skips. */
93
93
  SDLTest_TestCaseSetUpFp testSetUp;
94
94
  /* !< The test cases that are run as part of the suite. Last item should be NULL. */
@@ -105,7 +105,7 @@ typedef struct SDLTest_TestSuiteReference {
105
105
  *
106
106
  * \param length The length of the seed string to generate
107
107
  *
108
- * \returns The generated seed string
108
+ * \returns the generated seed string
109
109
  */
110
110
  char *SDLTest_GenerateRunSeed(const int length);
111
111
 
@@ -118,7 +118,7 @@ char *SDLTest_GenerateRunSeed(const int length);
118
118
  * \param filter Filter specification. NULL disables. Case sensitive.
119
119
  * \param testIterations Number of iterations to run each test case.
120
120
  *
121
- * \returns Test run result; 0 when all tests passed, 1 if any tests failed.
121
+ * \returns the test run result: 0 when all tests passed, 1 if any tests failed.
122
122
  */
123
123
  int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations);
124
124
 
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -98,7 +98,7 @@ extern "C" {
98
98
  *
99
99
  * \param rndContext pointer to context structure
100
100
  *
101
- * \returns A random number (32bit unsigned integer)
101
+ * \returns a random number (32bit unsigned integer)
102
102
  *
103
103
  */
104
104
  unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext);