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
@@ -38,45 +38,121 @@ extern "C" {
38
38
  #endif
39
39
 
40
40
  /**
41
- * \brief Get the number of milliseconds since the SDL library initialization.
41
+ * Get the number of milliseconds since SDL library initialization.
42
42
  *
43
- * \note This value wraps if the program runs for more than ~49 days.
43
+ * This value wraps if the program runs for more than ~49 days.
44
+ *
45
+ * This function is not recommended as of SDL 2.0.18; use SDL_GetTicks64()
46
+ * instead, where the value doesn't wrap every ~49 days. There are places in
47
+ * SDL where we provide a 32-bit timestamp that can not change without
48
+ * breaking binary compatibility, though, so this function isn't officially
49
+ * deprecated.
50
+ *
51
+ * \returns an unsigned 32-bit value representing the number of milliseconds
52
+ * since the SDL library initialized.
53
+ *
54
+ * \since This function is available since SDL 2.0.0.
55
+ *
56
+ * \sa SDL_TICKS_PASSED
44
57
  */
45
58
  extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
46
59
 
47
60
  /**
48
- * \brief Compare SDL ticks values, and return true if A has passed B
61
+ * Get the number of milliseconds since SDL library initialization.
62
+ *
63
+ * Note that you should not use the SDL_TICKS_PASSED macro with values
64
+ * returned by this function, as that macro does clever math to compensate for
65
+ * the 32-bit overflow every ~49 days that SDL_GetTicks() suffers from. 64-bit
66
+ * values from this function can be safely compared directly.
49
67
  *
50
- * e.g. if you want to wait 100 ms, you could do this:
51
- * Uint32 timeout = SDL_GetTicks() + 100;
52
- * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
53
- * ... do work until timeout has elapsed
54
- * }
68
+ * For example, if you want to wait 100 ms, you could do this:
69
+ *
70
+ * ```c
71
+ * const Uint64 timeout = SDL_GetTicks64() + 100;
72
+ * while (SDL_GetTicks64() < timeout) {
73
+ * // ... do work until timeout has elapsed
74
+ * }
75
+ * ```
76
+ *
77
+ * \returns an unsigned 64-bit value representing the number of milliseconds
78
+ * since the SDL library initialized.
79
+ *
80
+ * \since This function is available since SDL 2.0.18.
81
+ */
82
+ extern DECLSPEC Uint64 SDLCALL SDL_GetTicks64(void);
83
+
84
+ /**
85
+ * Compare 32-bit SDL ticks values, and return true if `A` has passed `B`.
86
+ *
87
+ * This should be used with results from SDL_GetTicks(), as this macro
88
+ * attempts to deal with the 32-bit counter wrapping back to zero every ~49
89
+ * days, but should _not_ be used with SDL_GetTicks64(), which does not have
90
+ * that problem.
91
+ *
92
+ * For example, with SDL_GetTicks(), if you want to wait 100 ms, you could
93
+ * do this:
94
+ *
95
+ * ```c
96
+ * const Uint32 timeout = SDL_GetTicks() + 100;
97
+ * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
98
+ * // ... do work until timeout has elapsed
99
+ * }
100
+ * ```
101
+ *
102
+ * Note that this does not handle tick differences greater
103
+ * than 2^31 so take care when using the above kind of code
104
+ * with large timeout delays (tens of days).
55
105
  */
56
106
  #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0)
57
107
 
58
108
  /**
59
- * \brief Get the current value of the high resolution counter
109
+ * Get the current value of the high resolution counter.
110
+ *
111
+ * This function is typically used for profiling.
112
+ *
113
+ * The counter values are only meaningful relative to each other. Differences
114
+ * between values can be converted to times by using
115
+ * SDL_GetPerformanceFrequency().
116
+ *
117
+ * \returns the current counter value.
118
+ *
119
+ * \since This function is available since SDL 2.0.0.
120
+ *
121
+ * \sa SDL_GetPerformanceFrequency
60
122
  */
61
123
  extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void);
62
124
 
63
125
  /**
64
- * \brief Get the count per second of the high resolution counter
126
+ * Get the count per second of the high resolution counter.
127
+ *
128
+ * \returns a platform-specific count per second.
129
+ *
130
+ * \since This function is available since SDL 2.0.0.
131
+ *
132
+ * \sa SDL_GetPerformanceCounter
65
133
  */
66
134
  extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void);
67
135
 
68
136
  /**
69
- * \brief Wait a specified number of milliseconds before returning.
137
+ * Wait a specified number of milliseconds before returning.
138
+ *
139
+ * This function waits a specified number of milliseconds before returning. It
140
+ * waits at least the specified time, but possibly longer due to OS
141
+ * scheduling.
142
+ *
143
+ * \param ms the number of milliseconds to delay
144
+ *
145
+ * \since This function is available since SDL 2.0.0.
70
146
  */
71
147
  extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
72
148
 
73
149
  /**
74
- * Function prototype for the timer callback function.
150
+ * Function prototype for the timer callback function.
75
151
  *
76
- * The callback function is passed the current timer interval and returns
77
- * the next timer interval. If the returned value is the same as the one
78
- * passed in, the periodic alarm continues, otherwise a new alarm is
79
- * scheduled. If the callback returns 0, the periodic alarm is cancelled.
152
+ * The callback function is passed the current timer interval and returns
153
+ * the next timer interval. If the returned value is the same as the one
154
+ * passed in, the periodic alarm continues, otherwise a new alarm is
155
+ * scheduled. If the callback returns 0, the periodic alarm is cancelled.
80
156
  */
81
157
  typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
82
158
 
@@ -86,20 +162,51 @@ typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
86
162
  typedef int SDL_TimerID;
87
163
 
88
164
  /**
89
- * \brief Add a new timer to the pool of timers already running.
165
+ * Call a callback function at a future time.
90
166
  *
91
- * \return A timer ID, or 0 when an error occurs.
167
+ * If you use this function, you must pass `SDL_INIT_TIMER` to SDL_Init().
168
+ *
169
+ * The callback function is passed the current timer interval and the user
170
+ * supplied parameter from the SDL_AddTimer() call and should return the next
171
+ * timer interval. If the value returned from the callback is 0, the timer is
172
+ * canceled.
173
+ *
174
+ * The callback is run on a separate thread.
175
+ *
176
+ * Timers take into account the amount of time it took to execute the
177
+ * callback. For example, if the callback took 250 ms to execute and returned
178
+ * 1000 (ms), the timer would only wait another 750 ms before its next
179
+ * iteration.
180
+ *
181
+ * Timing may be inexact due to OS scheduling. Be sure to note the current
182
+ * time with SDL_GetTicks() or SDL_GetPerformanceCounter() in case your
183
+ * callback needs to adjust for variances.
184
+ *
185
+ * \param interval the timer delay, in milliseconds, passed to `callback`
186
+ * \param callback the SDL_TimerCallback function to call when the specified
187
+ * `interval` elapses
188
+ * \param param a pointer that is passed to `callback`
189
+ * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more
190
+ * information.
191
+ *
192
+ * \since This function is available since SDL 2.0.0.
193
+ *
194
+ * \sa SDL_RemoveTimer
92
195
  */
93
196
  extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
94
197
  SDL_TimerCallback callback,
95
198
  void *param);
96
199
 
97
200
  /**
98
- * \brief Remove a timer knowing its ID.
201
+ * Remove a timer created with SDL_AddTimer().
202
+ *
203
+ * \param id the ID of the timer to remove
204
+ * \returns SDL_TRUE if the timer is removed or SDL_FALSE if the timer wasn't
205
+ * found.
99
206
  *
100
- * \return A boolean value indicating success or failure.
207
+ * \since This function is available since SDL 2.0.0.
101
208
  *
102
- * \warning It is not safe to remove a timer multiple times.
209
+ * \sa SDL_AddTimer
103
210
  */
104
211
  extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id);
105
212
 
@@ -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
@@ -64,30 +64,70 @@ typedef struct SDL_Finger
64
64
  #define SDL_MOUSE_TOUCHID ((Sint64)-1)
65
65
 
66
66
 
67
- /* Function prototypes */
68
-
69
67
  /**
70
- * \brief Get the number of registered touch devices.
68
+ * Get the number of registered touch devices.
69
+ *
70
+ * On some platforms SDL first sees the touch device if it was actually used.
71
+ * Therefore SDL_GetNumTouchDevices() may return 0 although devices are
72
+ * available. After using all devices at least once the number will be
73
+ * correct.
74
+ *
75
+ * This was fixed for Android in SDL 2.0.1.
76
+ *
77
+ * \returns the number of registered touch devices.
78
+ *
79
+ * \since This function is available since SDL 2.0.0.
80
+ *
81
+ * \sa SDL_GetTouchDevice
71
82
  */
72
83
  extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
73
84
 
74
85
  /**
75
- * \brief Get the touch ID with the given index, or 0 if the index is invalid.
86
+ * Get the touch ID with the given index.
87
+ *
88
+ * \param index the touch device index
89
+ * \returns the touch ID with the given index on success or 0 if the index is
90
+ * invalid; call SDL_GetError() for more information.
91
+ *
92
+ * \since This function is available since SDL 2.0.0.
93
+ *
94
+ * \sa SDL_GetNumTouchDevices
76
95
  */
77
96
  extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
78
97
 
79
98
  /**
80
- * \brief Get the type of the given touch device.
99
+ * Get the type of the given touch device.
100
+ *
101
+ * \since This function is available since SDL 2.0.10.
81
102
  */
82
103
  extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID);
83
104
 
84
105
  /**
85
- * \brief Get the number of active fingers for a given touch device.
106
+ * Get the number of active fingers for a given touch device.
107
+ *
108
+ * \param touchID the ID of a touch device
109
+ * \returns the number of active fingers for a given touch device on success
110
+ * or 0 on failure; call SDL_GetError() for more information.
111
+ *
112
+ * \since This function is available since SDL 2.0.0.
113
+ *
114
+ * \sa SDL_GetTouchFinger
86
115
  */
87
116
  extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID);
88
117
 
89
118
  /**
90
- * \brief Get the finger object of the given touch, with the given index.
119
+ * Get the finger object for specified touch device ID and finger index.
120
+ *
121
+ * The returned resource is owned by SDL and should not be deallocated.
122
+ *
123
+ * \param touchID the ID of the requested touch device
124
+ * \param index the index of the requested finger
125
+ * \returns a pointer to the SDL_Finger object or NULL if no object at the
126
+ * given ID and index could be found.
127
+ *
128
+ * \since This function is available since SDL 2.0.0.
129
+ *
130
+ * \sa SDL_RecordGesture
91
131
  */
92
132
  extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index);
93
133
 
@@ -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
@@ -37,16 +37,16 @@ extern "C" {
37
37
  #endif
38
38
 
39
39
  /**
40
- * \brief Information the version of SDL in use.
40
+ * Information about the version of SDL in use.
41
41
  *
42
- * Represents the library's version as three levels: major revision
43
- * (increments with massive changes, additions, and enhancements),
44
- * minor revision (increments with backwards-compatible changes to the
45
- * major revision), and patchlevel (increments with fixes to the minor
46
- * revision).
42
+ * Represents the library's version as three levels: major revision
43
+ * (increments with massive changes, additions, and enhancements),
44
+ * minor revision (increments with backwards-compatible changes to the
45
+ * major revision), and patchlevel (increments with fixes to the minor
46
+ * revision).
47
47
  *
48
- * \sa SDL_VERSION
49
- * \sa SDL_GetVersion
48
+ * \sa SDL_VERSION
49
+ * \sa SDL_GetVersion
50
50
  */
51
51
  typedef struct SDL_version
52
52
  {
@@ -59,22 +59,22 @@ typedef struct SDL_version
59
59
  */
60
60
  #define SDL_MAJOR_VERSION 2
61
61
  #define SDL_MINOR_VERSION 0
62
- #define SDL_PATCHLEVEL 14
62
+ #define SDL_PATCHLEVEL 20
63
63
 
64
64
  /**
65
- * \brief Macro to determine SDL version program was compiled against.
65
+ * Macro to determine SDL version program was compiled against.
66
66
  *
67
- * This macro fills in a SDL_version structure with the version of the
68
- * library you compiled against. This is determined by what header the
69
- * compiler uses. Note that if you dynamically linked the library, you might
70
- * have a slightly newer or older version at runtime. That version can be
71
- * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
72
- * is not a macro.
67
+ * This macro fills in a SDL_version structure with the version of the
68
+ * library you compiled against. This is determined by what header the
69
+ * compiler uses. Note that if you dynamically linked the library, you might
70
+ * have a slightly newer or older version at runtime. That version can be
71
+ * determined with SDL_GetVersion(), which, unlike SDL_VERSION(),
72
+ * is not a macro.
73
73
  *
74
- * \param x A pointer to a SDL_version struct to initialize.
74
+ * \param x A pointer to a SDL_version struct to initialize.
75
75
  *
76
- * \sa SDL_version
77
- * \sa SDL_GetVersion
76
+ * \sa SDL_version
77
+ * \sa SDL_GetVersion
78
78
  */
79
79
  #define SDL_VERSION(x) \
80
80
  { \
@@ -107,48 +107,74 @@ typedef struct SDL_version
107
107
  (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
108
108
 
109
109
  /**
110
- * \brief Get the version of SDL that is linked against your program.
110
+ * Get the version of SDL that is linked against your program.
111
111
  *
112
- * If you are linking to SDL dynamically, then it is possible that the
113
- * current version will be different than the version you compiled against.
114
- * This function returns the current version, while SDL_VERSION() is a
115
- * macro that tells you what version you compiled with.
112
+ * If you are linking to SDL dynamically, then it is possible that the current
113
+ * version will be different than the version you compiled against. This
114
+ * function returns the current version, while SDL_VERSION() is a macro that
115
+ * tells you what version you compiled with.
116
116
  *
117
- * \code
118
- * SDL_version compiled;
119
- * SDL_version linked;
117
+ * This function may be called safely at any time, even before SDL_Init().
120
118
  *
121
- * SDL_VERSION(&compiled);
122
- * SDL_GetVersion(&linked);
123
- * printf("We compiled against SDL version %d.%d.%d ...\n",
124
- * compiled.major, compiled.minor, compiled.patch);
125
- * printf("But we linked against SDL version %d.%d.%d.\n",
126
- * linked.major, linked.minor, linked.patch);
127
- * \endcode
119
+ * \param ver the SDL_version structure that contains the version information
128
120
  *
129
- * This function may be called safely at any time, even before SDL_Init().
121
+ * \since This function is available since SDL 2.0.0.
130
122
  *
131
- * \sa SDL_VERSION
123
+ * \sa SDL_GetRevision
132
124
  */
133
125
  extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver);
134
126
 
135
127
  /**
136
- * \brief Get the code revision of SDL that is linked against your program.
128
+ * Get the code revision of SDL that is linked against your program.
137
129
  *
138
- * Returns an arbitrary string (a hash value) uniquely identifying the
139
- * exact revision of the SDL library in use, and is only useful in comparing
140
- * against other revisions. It is NOT an incrementing number.
130
+ * This value is the revision of the code you are linked with and may be
131
+ * different from the code you are compiling with, which is found in the
132
+ * constant SDL_REVISION.
133
+ *
134
+ * The revision is arbitrary string (a hash value) uniquely identifying the
135
+ * exact revision of the SDL library in use, and is only useful in comparing
136
+ * against other revisions. It is NOT an incrementing number.
137
+ *
138
+ * If SDL wasn't built from a git repository with the appropriate tools, this
139
+ * will return an empty string.
140
+ *
141
+ * Prior to SDL 2.0.16, before development moved to GitHub, this returned a
142
+ * hash for a Mercurial repository.
143
+ *
144
+ * You shouldn't use this function for anything but logging it for debugging
145
+ * purposes. The string is not intended to be reliable in any way.
146
+ *
147
+ * \returns an arbitrary string, uniquely identifying the exact revision of
148
+ * the SDL library in use.
149
+ *
150
+ * \since This function is available since SDL 2.0.0.
151
+ *
152
+ * \sa SDL_GetVersion
141
153
  */
142
154
  extern DECLSPEC const char *SDLCALL SDL_GetRevision(void);
143
155
 
144
156
  /**
145
- * \brief Get the revision number of SDL that is linked against your program.
157
+ * Obsolete function, do not use.
158
+ *
159
+ * When SDL was hosted in a Mercurial repository, and was built carefully,
160
+ * this would return the revision number that the build was created from. This
161
+ * number was not reliable for several reasons, but more importantly, SDL is
162
+ * now hosted in a git repository, which does not offer numbers at all, only
163
+ * hashes. This function only ever returns zero now. Don't use it.
164
+ *
165
+ * Before SDL 2.0.16, this might have returned an unreliable, but non-zero
166
+ * number.
167
+ *
168
+ * \deprecated Use SDL_GetRevision() instead; if SDL was carefully built, it
169
+ * will return a git hash.
170
+ *
171
+ * \returns zero, always, in modern SDL releases.
172
+ *
173
+ * \since This function is available since SDL 2.0.0.
146
174
  *
147
- * Returns a number uniquely identifying the exact revision of the SDL
148
- * library in use. It is an incrementing number based on commits to
149
- * hg.libsdl.org.
175
+ * \sa SDL_GetRevision
150
176
  */
151
- extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
177
+ extern SDL_DEPRECATED DECLSPEC int SDLCALL SDL_GetRevisionNumber(void);
152
178
 
153
179
 
154
180
  /* Ends C function definitions when using C++ */