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
@@ -45,13 +45,12 @@ extern "C" {
45
45
  * with 0. This operation can also be stated as "count leading zeroes" and
46
46
  * "log base 2".
47
47
  *
48
- * \return Index of the most significant bit, or -1 if the value is 0.
48
+ * \return the index of the most significant bit, or -1 if the value is 0.
49
49
  */
50
50
  #if defined(__WATCOMC__) && defined(__386__)
51
- extern _inline int _SDL_clz_watcom (Uint32);
52
- #pragma aux _SDL_clz_watcom = \
51
+ extern __inline int _SDL_bsr_watcom(Uint32);
52
+ #pragma aux _SDL_bsr_watcom = \
53
53
  "bsr eax, eax" \
54
- "xor eax, 31" \
55
54
  parm [eax] nomemory \
56
55
  value [eax] \
57
56
  modify exact [eax] nomemory;
@@ -72,7 +71,13 @@ SDL_MostSignificantBitIndex32(Uint32 x)
72
71
  if (x == 0) {
73
72
  return -1;
74
73
  }
75
- return 31 - _SDL_clz_watcom(x);
74
+ return _SDL_bsr_watcom(x);
75
+ #elif defined(_MSC_VER)
76
+ unsigned long index;
77
+ if (_BitScanReverse(&index, x)) {
78
+ return index;
79
+ }
80
+ return -1;
76
81
  #else
77
82
  /* Based off of Bit Twiddling Hacks by Sean Eron Anderson
78
83
  * <seander@cs.stanford.edu>, released in the public domain.
@@ -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
@@ -91,19 +91,96 @@ typedef enum
91
91
  } SDL_BlendFactor;
92
92
 
93
93
  /**
94
- * \brief Create a custom blend mode, which may or may not be supported by a given renderer
95
- *
96
- * \param srcColorFactor source color factor
97
- * \param dstColorFactor destination color factor
98
- * \param colorOperation color operation
99
- * \param srcAlphaFactor source alpha factor
100
- * \param dstAlphaFactor destination alpha factor
101
- * \param alphaOperation alpha operation
102
- *
103
- * The result of the blend mode operation will be:
104
- * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor
105
- * and
106
- * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor
94
+ * Compose a custom blend mode for renderers.
95
+ *
96
+ * The functions SDL_SetRenderDrawBlendMode and SDL_SetTextureBlendMode accept
97
+ * the SDL_BlendMode returned by this function if the renderer supports it.
98
+ *
99
+ * A blend mode controls how the pixels from a drawing operation (source) get
100
+ * combined with the pixels from the render target (destination). First, the
101
+ * components of the source and destination pixels get multiplied with their
102
+ * blend factors. Then, the blend operation takes the two products and
103
+ * calculates the result that will get stored in the render target.
104
+ *
105
+ * Expressed in pseudocode, it would look like this:
106
+ *
107
+ * ```c
108
+ * dstRGB = colorOperation(srcRGB * srcColorFactor, dstRGB * dstColorFactor);
109
+ * dstA = alphaOperation(srcA * srcAlphaFactor, dstA * dstAlphaFactor);
110
+ * ```
111
+ *
112
+ * Where the functions `colorOperation(src, dst)` and `alphaOperation(src,
113
+ * dst)` can return one of the following:
114
+ *
115
+ * - `src + dst`
116
+ * - `src - dst`
117
+ * - `dst - src`
118
+ * - `min(src, dst)`
119
+ * - `max(src, dst)`
120
+ *
121
+ * The red, green, and blue components are always multiplied with the first,
122
+ * second, and third components of the SDL_BlendFactor, respectively. The
123
+ * fourth component is not used.
124
+ *
125
+ * The alpha component is always multiplied with the fourth component of the
126
+ * SDL_BlendFactor. The other components are not used in the alpha
127
+ * calculation.
128
+ *
129
+ * Support for these blend modes varies for each renderer. To check if a
130
+ * specific SDL_BlendMode is supported, create a renderer and pass it to
131
+ * either SDL_SetRenderDrawBlendMode or SDL_SetTextureBlendMode. They will
132
+ * return with an error if the blend mode is not supported.
133
+ *
134
+ * This list describes the support of custom blend modes for each renderer in
135
+ * SDL 2.0.6. All renderers support the four blend modes listed in the
136
+ * SDL_BlendMode enumeration.
137
+ *
138
+ * - **direct3d**: Supports `SDL_BLENDOPERATION_ADD` with all factors.
139
+ * - **direct3d11**: Supports all operations with all factors. However, some
140
+ * factors produce unexpected results with `SDL_BLENDOPERATION_MINIMUM` and
141
+ * `SDL_BLENDOPERATION_MAXIMUM`.
142
+ * - **opengl**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
143
+ * factors. OpenGL versions 1.1, 1.2, and 1.3 do not work correctly with SDL
144
+ * 2.0.6.
145
+ * - **opengles**: Supports the `SDL_BLENDOPERATION_ADD` operation with all
146
+ * factors. Color and alpha factors need to be the same. OpenGL ES 1
147
+ * implementation specific: May also support `SDL_BLENDOPERATION_SUBTRACT`
148
+ * and `SDL_BLENDOPERATION_REV_SUBTRACT`. May support color and alpha
149
+ * operations being different from each other. May support color and alpha
150
+ * factors being different from each other.
151
+ * - **opengles2**: Supports the `SDL_BLENDOPERATION_ADD`,
152
+ * `SDL_BLENDOPERATION_SUBTRACT`, `SDL_BLENDOPERATION_REV_SUBTRACT`
153
+ * operations with all factors.
154
+ * - **psp**: No custom blend mode support.
155
+ * - **software**: No custom blend mode support.
156
+ *
157
+ * Some renderers do not provide an alpha component for the default render
158
+ * target. The `SDL_BLENDFACTOR_DST_ALPHA` and
159
+ * `SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA` factors do not have an effect in this
160
+ * case.
161
+ *
162
+ * \param srcColorFactor the SDL_BlendFactor applied to the red, green, and
163
+ * blue components of the source pixels
164
+ * \param dstColorFactor the SDL_BlendFactor applied to the red, green, and
165
+ * blue components of the destination pixels
166
+ * \param colorOperation the SDL_BlendOperation used to combine the red,
167
+ * green, and blue components of the source and
168
+ * destination pixels
169
+ * \param srcAlphaFactor the SDL_BlendFactor applied to the alpha component of
170
+ * the source pixels
171
+ * \param dstAlphaFactor the SDL_BlendFactor applied to the alpha component of
172
+ * the destination pixels
173
+ * \param alphaOperation the SDL_BlendOperation used to combine the alpha
174
+ * component of the source and destination pixels
175
+ * \returns an SDL_BlendMode that represents the chosen factors and
176
+ * operations.
177
+ *
178
+ * \since This function is available since SDL 2.0.6.
179
+ *
180
+ * \sa SDL_SetRenderDrawBlendMode
181
+ * \sa SDL_GetRenderDrawBlendMode
182
+ * \sa SDL_SetTextureBlendMode
183
+ * \sa SDL_GetTextureBlendMode
107
184
  */
108
185
  extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor,
109
186
  SDL_BlendFactor dstColorFactor,
@@ -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
@@ -39,23 +39,46 @@ extern "C" {
39
39
  /* Function prototypes */
40
40
 
41
41
  /**
42
- * \brief Put UTF-8 text into the clipboard
42
+ * Put UTF-8 text into the clipboard.
43
43
  *
44
- * \sa SDL_GetClipboardText()
44
+ * \param text the text to store in the clipboard
45
+ * \returns 0 on success or a negative error code on failure; call
46
+ * SDL_GetError() for more information.
47
+ *
48
+ * \since This function is available since SDL 2.0.0.
49
+ *
50
+ * \sa SDL_GetClipboardText
51
+ * \sa SDL_HasClipboardText
45
52
  */
46
53
  extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text);
47
54
 
48
55
  /**
49
- * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
56
+ * Get UTF-8 text from the clipboard, which must be freed with SDL_free().
57
+ *
58
+ * This functions returns empty string if there was not enough memory left for
59
+ * a copy of the clipboard's content.
60
+ *
61
+ * \returns the clipboard text on success or an empty string on failure; call
62
+ * SDL_GetError() for more information. Caller must call SDL_free()
63
+ * on the returned pointer when done with it (even if there was an
64
+ * error).
50
65
  *
51
- * \sa SDL_SetClipboardText()
66
+ * \since This function is available since SDL 2.0.0.
67
+ *
68
+ * \sa SDL_HasClipboardText
69
+ * \sa SDL_SetClipboardText
52
70
  */
53
71
  extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void);
54
72
 
55
73
  /**
56
- * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
74
+ * Query whether the clipboard exists and contains a non-empty text string.
75
+ *
76
+ * \returns SDL_TRUE if the clipboard has text, or SDL_FALSE if it does not.
77
+ *
78
+ * \since This function is available since SDL 2.0.0.
57
79
  *
58
- * \sa SDL_GetClipboardText()
80
+ * \sa SDL_GetClipboardText
81
+ * \sa SDL_SetClipboardText
59
82
  */
60
83
  extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void);
61
84
 
@@ -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
@@ -19,37 +19,287 @@
19
19
  3. This notice may not be removed or altered from any source distribution.
20
20
  */
21
21
 
22
- #ifndef SDL_config_h_
22
+ #ifndef SDL_config_windows_h_
23
+ #define SDL_config_windows_h_
23
24
  #define SDL_config_h_
24
25
 
25
26
  #include "SDL_platform.h"
26
27
 
27
- /**
28
- * \file SDL_config.h
29
- */
30
-
31
- /* Add any platform that doesn't build using the configure system. */
32
- #if defined(__WIN32__)
33
- #include "SDL_config_windows.h"
34
- #elif defined(__WINRT__)
35
- #include "SDL_config_winrt.h"
36
- #elif defined(__MACOSX__)
37
- #include "SDL_config_macosx.h"
38
- #elif defined(__IPHONEOS__)
39
- #include "SDL_config_iphoneos.h"
40
- #elif defined(__ANDROID__)
41
- #include "SDL_config_android.h"
42
- #elif defined(__PSP__)
43
- #include "SDL_config_psp.h"
44
- #elif defined(__OS2__)
45
- #include "SDL_config_os2.h"
28
+ /* winsdkver.h defines _WIN32_MAXVER for SDK version detection. It is present since at least the Windows 7 SDK,
29
+ * but out of caution we'll only use it if the compiler supports __has_include() to confirm its presence.
30
+ * If your compiler doesn't support __has_include() but you have winsdkver.h, define HAVE_WINSDKVER_H. */
31
+ #if !defined(HAVE_WINSDKVER_H) && defined(__has_include)
32
+ #if __has_include(<winsdkver.h>)
33
+ #define HAVE_WINSDKVER_H 1
34
+ #endif
35
+ #endif
36
+
37
+ #ifdef HAVE_WINSDKVER_H
38
+ #include <winsdkver.h>
39
+ #endif
40
+
41
+ /* This is a set of defines to configure the SDL features */
42
+
43
+ #if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
44
+ #if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) || defined(__clang__) || defined(__BORLANDC__) || defined(__CODEGEARC__)
45
+ #define HAVE_STDINT_H 1
46
+ #elif defined(_MSC_VER)
47
+ typedef signed __int8 int8_t;
48
+ typedef unsigned __int8 uint8_t;
49
+ typedef signed __int16 int16_t;
50
+ typedef unsigned __int16 uint16_t;
51
+ typedef signed __int32 int32_t;
52
+ typedef unsigned __int32 uint32_t;
53
+ typedef signed __int64 int64_t;
54
+ typedef unsigned __int64 uint64_t;
55
+ #ifndef _UINTPTR_T_DEFINED
56
+ #ifdef _WIN64
57
+ typedef unsigned __int64 uintptr_t;
46
58
  #else
47
- /* This is a minimal configuration just to get SDL running on new platforms. */
48
- #include "SDL_config_minimal.h"
49
- #endif /* platform config */
59
+ typedef unsigned int uintptr_t;
60
+ #endif
61
+ #define _UINTPTR_T_DEFINED
62
+ #endif
63
+ /* Older Visual C++ headers don't have the Win64-compatible typedefs... */
64
+ #if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR)))
65
+ #define DWORD_PTR DWORD
66
+ #endif
67
+ #if ((_MSC_VER <= 1200) && (!defined(LONG_PTR)))
68
+ #define LONG_PTR LONG
69
+ #endif
70
+ #else /* !__GNUC__ && !_MSC_VER */
71
+ typedef signed char int8_t;
72
+ typedef unsigned char uint8_t;
73
+ typedef signed short int16_t;
74
+ typedef unsigned short uint16_t;
75
+ typedef signed int int32_t;
76
+ typedef unsigned int uint32_t;
77
+ typedef signed long long int64_t;
78
+ typedef unsigned long long uint64_t;
79
+ #ifndef _SIZE_T_DEFINED_
80
+ #define _SIZE_T_DEFINED_
81
+ typedef unsigned int size_t;
82
+ #endif
83
+ typedef unsigned int uintptr_t;
84
+ #endif /* __GNUC__ || _MSC_VER */
85
+ #endif /* !_STDINT_H_ && !HAVE_STDINT_H */
50
86
 
51
- #ifdef USING_GENERATED_CONFIG_H
52
- #error Wrong SDL_config.h, check your include path?
87
+ #ifdef _WIN64
88
+ # define SIZEOF_VOIDP 8
89
+ #else
90
+ # define SIZEOF_VOIDP 4
53
91
  #endif
54
92
 
55
- #endif /* SDL_config_h_ */
93
+ #define HAVE_DDRAW_H 1
94
+ #define HAVE_DINPUT_H 1
95
+ #define HAVE_DSOUND_H 1
96
+ #define HAVE_DXGI_H 1
97
+ #define HAVE_XINPUT_H 1
98
+ #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0A00 /* Windows 10 SDK */
99
+ #define HAVE_WINDOWS_GAMING_INPUT_H 1
100
+ #endif
101
+ #if defined(_WIN32_MAXVER) && _WIN32_MAXVER >= 0x0602 /* Windows 8 SDK */
102
+ #define HAVE_D3D11_H 1
103
+ #endif
104
+ #define HAVE_MMDEVICEAPI_H 1
105
+ #define HAVE_AUDIOCLIENT_H 1
106
+ #define HAVE_TPCSHRD_H 1
107
+ #define HAVE_SENSORSAPI_H 1
108
+ #if (defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)) && (defined(_MSC_VER) && _MSC_VER >= 1600)
109
+ #define HAVE_IMMINTRIN_H 1
110
+ #elif defined(__has_include) && (defined(__i386__) || defined(__x86_64))
111
+ # if __has_include(<immintrin.h>)
112
+ # define HAVE_IMMINTRIN_H 1
113
+ # endif
114
+ #endif
115
+
116
+ /* This is disabled by default to avoid C runtime dependencies and manifest requirements */
117
+ #ifdef HAVE_LIBC
118
+ /* Useful headers */
119
+ #define STDC_HEADERS 1
120
+ #define HAVE_CTYPE_H 1
121
+ #define HAVE_FLOAT_H 1
122
+ #define HAVE_LIMITS_H 1
123
+ #define HAVE_MATH_H 1
124
+ #define HAVE_SIGNAL_H 1
125
+ #define HAVE_STDIO_H 1
126
+ #define HAVE_STRING_H 1
127
+
128
+ /* C library functions */
129
+ #define HAVE_MALLOC 1
130
+ #define HAVE_CALLOC 1
131
+ #define HAVE_REALLOC 1
132
+ #define HAVE_FREE 1
133
+ #define HAVE_ALLOCA 1
134
+ #define HAVE_QSORT 1
135
+ #define HAVE_ABS 1
136
+ #define HAVE_MEMSET 1
137
+ #define HAVE_MEMCPY 1
138
+ #define HAVE_MEMMOVE 1
139
+ #define HAVE_MEMCMP 1
140
+ #define HAVE_STRLEN 1
141
+ #define HAVE__STRREV 1
142
+ /* These functions have security warnings, so we won't use them */
143
+ /* #undef HAVE__STRUPR */
144
+ /* #undef HAVE__STRLWR */
145
+ #define HAVE_STRCHR 1
146
+ #define HAVE_STRRCHR 1
147
+ #define HAVE_STRSTR 1
148
+ /* #undef HAVE_STRTOK_R */
149
+ /* These functions have security warnings, so we won't use them */
150
+ /* #undef HAVE__LTOA */
151
+ /* #undef HAVE__ULTOA */
152
+ #define HAVE_STRTOL 1
153
+ #define HAVE_STRTOUL 1
154
+ #define HAVE_STRTOD 1
155
+ #define HAVE_ATOI 1
156
+ #define HAVE_ATOF 1
157
+ #define HAVE_STRCMP 1
158
+ #define HAVE_STRNCMP 1
159
+ #define HAVE__STRICMP 1
160
+ #define HAVE__STRNICMP 1
161
+ #define HAVE__WCSICMP 1
162
+ #define HAVE__WCSNICMP 1
163
+ #define HAVE__WCSDUP 1
164
+ #define HAVE_ACOS 1
165
+ #define HAVE_ACOSF 1
166
+ #define HAVE_ASIN 1
167
+ #define HAVE_ASINF 1
168
+ #define HAVE_ATAN 1
169
+ #define HAVE_ATANF 1
170
+ #define HAVE_ATAN2 1
171
+ #define HAVE_ATAN2F 1
172
+ #define HAVE_CEILF 1
173
+ #define HAVE__COPYSIGN 1
174
+ #define HAVE_COS 1
175
+ #define HAVE_COSF 1
176
+ #define HAVE_EXP 1
177
+ #define HAVE_EXPF 1
178
+ #define HAVE_FABS 1
179
+ #define HAVE_FABSF 1
180
+ #define HAVE_FLOOR 1
181
+ #define HAVE_FLOORF 1
182
+ #define HAVE_FMOD 1
183
+ #define HAVE_FMODF 1
184
+ #define HAVE_LOG 1
185
+ #define HAVE_LOGF 1
186
+ #define HAVE_LOG10 1
187
+ #define HAVE_LOG10F 1
188
+ #define HAVE_POW 1
189
+ #define HAVE_POWF 1
190
+ #define HAVE_SIN 1
191
+ #define HAVE_SINF 1
192
+ #define HAVE_SQRT 1
193
+ #define HAVE_SQRTF 1
194
+ #define HAVE_TAN 1
195
+ #define HAVE_TANF 1
196
+ #if defined(_MSC_VER)
197
+ /* These functions were added with the VC++ 2013 C runtime library */
198
+ #if _MSC_VER >= 1800
199
+ #define HAVE_STRTOLL 1
200
+ #define HAVE_STRTOULL 1
201
+ #define HAVE_VSSCANF 1
202
+ #define HAVE_LROUND 1
203
+ #define HAVE_LROUNDF 1
204
+ #define HAVE_ROUND 1
205
+ #define HAVE_ROUNDF 1
206
+ #define HAVE_SCALBN 1
207
+ #define HAVE_SCALBNF 1
208
+ #define HAVE_TRUNC 1
209
+ #define HAVE_TRUNCF 1
210
+ #endif
211
+ /* This function is available with at least the VC++ 2008 C runtime library */
212
+ #if _MSC_VER >= 1400
213
+ #define HAVE__FSEEKI64 1
214
+ #endif
215
+ #endif
216
+ #if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES)
217
+ #define HAVE_M_PI 1
218
+ #endif
219
+ #else
220
+ #define HAVE_STDARG_H 1
221
+ #define HAVE_STDDEF_H 1
222
+ #endif
223
+
224
+ /* Enable various audio drivers */
225
+ #define SDL_AUDIO_DRIVER_WASAPI 1
226
+ #define SDL_AUDIO_DRIVER_DSOUND 1
227
+ #define SDL_AUDIO_DRIVER_WINMM 1
228
+ #define SDL_AUDIO_DRIVER_DISK 1
229
+ #define SDL_AUDIO_DRIVER_DUMMY 1
230
+
231
+ /* Enable various input drivers */
232
+ #define SDL_JOYSTICK_DINPUT 1
233
+ #define SDL_JOYSTICK_HIDAPI 1
234
+ #ifndef __WINRT__
235
+ #define SDL_JOYSTICK_RAWINPUT 1
236
+ #endif
237
+ #define SDL_JOYSTICK_VIRTUAL 1
238
+ #ifdef HAVE_WINDOWS_GAMING_INPUT_H
239
+ #define SDL_JOYSTICK_WGI 1
240
+ #endif
241
+ #define SDL_JOYSTICK_XINPUT 1
242
+ #define SDL_HAPTIC_DINPUT 1
243
+ #define SDL_HAPTIC_XINPUT 1
244
+
245
+ /* Enable the sensor driver */
246
+ #define SDL_SENSOR_WINDOWS 1
247
+
248
+ /* Enable various shared object loading systems */
249
+ #define SDL_LOADSO_WINDOWS 1
250
+
251
+ /* Enable various threading systems */
252
+ #define SDL_THREAD_GENERIC_COND_SUFFIX 1
253
+ #define SDL_THREAD_WINDOWS 1
254
+
255
+ /* Enable various timer systems */
256
+ #define SDL_TIMER_WINDOWS 1
257
+
258
+ /* Enable various video drivers */
259
+ #define SDL_VIDEO_DRIVER_DUMMY 1
260
+ #define SDL_VIDEO_DRIVER_WINDOWS 1
261
+
262
+ #ifndef SDL_VIDEO_RENDER_D3D
263
+ #define SDL_VIDEO_RENDER_D3D 1
264
+ #endif
265
+ #if !defined(SDL_VIDEO_RENDER_D3D11) && defined(HAVE_D3D11_H)
266
+ #define SDL_VIDEO_RENDER_D3D11 1
267
+ #endif
268
+
269
+ /* Enable OpenGL support */
270
+ #ifndef SDL_VIDEO_OPENGL
271
+ #define SDL_VIDEO_OPENGL 1
272
+ #endif
273
+ #ifndef SDL_VIDEO_OPENGL_WGL
274
+ #define SDL_VIDEO_OPENGL_WGL 1
275
+ #endif
276
+ #ifndef SDL_VIDEO_RENDER_OGL
277
+ #define SDL_VIDEO_RENDER_OGL 1
278
+ #endif
279
+ #ifndef SDL_VIDEO_RENDER_OGL_ES2
280
+ #define SDL_VIDEO_RENDER_OGL_ES2 1
281
+ #endif
282
+ #ifndef SDL_VIDEO_OPENGL_ES2
283
+ #define SDL_VIDEO_OPENGL_ES2 1
284
+ #endif
285
+ #ifndef SDL_VIDEO_OPENGL_EGL
286
+ #define SDL_VIDEO_OPENGL_EGL 1
287
+ #endif
288
+
289
+ /* Enable Vulkan support */
290
+ #define SDL_VIDEO_VULKAN 1
291
+
292
+ /* Enable system power support */
293
+ #define SDL_POWER_WINDOWS 1
294
+
295
+ /* Enable filesystem support */
296
+ #define SDL_FILESYSTEM_WINDOWS 1
297
+
298
+ /* Enable assembly routines (Win64 doesn't have inline asm) */
299
+ #ifndef _WIN64
300
+ #define SDL_ASSEMBLY_ROUTINES 1
301
+ #endif
302
+
303
+ #endif /* SDL_config_windows_h_ */
304
+
305
+ /* vi: set ts=4 sw=4 expandtab: */
@@ -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-2017 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
@@ -35,17 +35,16 @@
35
35
 
36
36
  #define HAVE_GCC_ATOMICS 1
37
37
 
38
- #define STDC_HEADERS 1
39
38
  #define HAVE_ALLOCA_H 1
40
- #define HAVE_CTYPE_H 1
39
+ #define HAVE_SYS_TYPES_H 1
40
+ #define HAVE_STDIO_H 1
41
+ #define STDC_HEADERS 1
42
+ #define HAVE_STRING_H 1
41
43
  #define HAVE_INTTYPES_H 1
42
- #define HAVE_LIMITS_H 1
44
+ #define HAVE_STDINT_H 1
45
+ #define HAVE_CTYPE_H 1
43
46
  #define HAVE_MATH_H 1
44
47
  #define HAVE_SIGNAL_H 1
45
- #define HAVE_STDINT_H 1
46
- #define HAVE_STDIO_H 1
47
- #define HAVE_STRING_H 1
48
- #define HAVE_SYS_TYPES_H 1
49
48
 
50
49
  /* C library functions */
51
50
  #define HAVE_MALLOC 1
@@ -68,10 +67,10 @@
68
67
  #define HAVE_STRLEN 1
69
68
  #define HAVE_STRLCPY 1
70
69
  #define HAVE_STRLCAT 1
70
+ #define HAVE_STRDUP 1
71
71
  #define HAVE_STRCHR 1
72
72
  #define HAVE_STRRCHR 1
73
73
  #define HAVE_STRSTR 1
74
- #define HAVE_STRTOK_R 1
75
74
  #define HAVE_STRTOL 1
76
75
  #define HAVE_STRTOUL 1
77
76
  #define HAVE_STRTOLL 1
@@ -85,65 +84,41 @@
85
84
  #define HAVE_STRNCASECMP 1
86
85
  #define HAVE_VSSCANF 1
87
86
  #define HAVE_VSNPRINTF 1
88
- #define HAVE_ACOS 1
89
- #define HAVE_ACOSF 1
90
- #define HAVE_ASIN 1
91
- #define HAVE_ASINF 1
87
+ #define HAVE_M_PI 1
92
88
  #define HAVE_ATAN 1
93
- #define HAVE_ATANF 1
94
89
  #define HAVE_ATAN2 1
95
- #define HAVE_ATAN2F 1
90
+ #define HAVE_ACOS 1
91
+ #define HAVE_ASIN 1
96
92
  #define HAVE_CEIL 1
97
- #define HAVE_CEILF 1
98
93
  #define HAVE_COPYSIGN 1
99
- #define HAVE_COPYSIGNF 1
100
94
  #define HAVE_COS 1
101
95
  #define HAVE_COSF 1
102
- #define HAVE_EXP 1
103
- #define HAVE_EXPF 1
104
96
  #define HAVE_FABS 1
105
- #define HAVE_FABSF 1
106
97
  #define HAVE_FLOOR 1
107
- #define HAVE_FLOORF 1
108
- #define HAVE_FMOD 1
109
- #define HAVE_FMODF 1
110
98
  #define HAVE_LOG 1
111
- #define HAVE_LOGF 1
112
- #define HAVE_LOG10 1
113
- #define HAVE_LOG10F 1
114
99
  #define HAVE_POW 1
115
- #define HAVE_POWF 1
116
100
  #define HAVE_SCALBN 1
117
- #define HAVE_SCALBNF 1
118
101
  #define HAVE_SIN 1
119
102
  #define HAVE_SINF 1
120
103
  #define HAVE_SQRT 1
121
104
  #define HAVE_SQRTF 1
122
105
  #define HAVE_TAN 1
123
106
  #define HAVE_TANF 1
124
- #define HAVE_TRUNC 1
125
- #define HAVE_TRUNCF 1
126
107
  #define HAVE_SIGACTION 1
127
108
  #define HAVE_SETJMP 1
128
109
  #define HAVE_NANOSLEEP 1
129
110
  #define HAVE_SYSCONF 1
130
- #define HAVE_CLOCK_GETTIME 1
111
+ #define HAVE_CLOCK_GETTIME 1
131
112
 
132
113
  #define SIZEOF_VOIDP 4
133
114
 
134
115
  /* Enable various audio drivers */
135
116
  #define SDL_AUDIO_DRIVER_ANDROID 1
136
- #define SDL_AUDIO_DRIVER_OPENSLES 1
137
117
  #define SDL_AUDIO_DRIVER_DUMMY 1
138
118
 
139
119
  /* Enable various input drivers */
140
120
  #define SDL_JOYSTICK_ANDROID 1
141
- #define SDL_JOYSTICK_HIDAPI 1
142
- #define SDL_JOYSTICK_VIRTUAL 1
143
- #define SDL_HAPTIC_ANDROID 1
144
-
145
- /* Enable sensor driver */
146
- #define SDL_SENSOR_ANDROID 1
121
+ #define SDL_HAPTIC_ANDROID 1
147
122
 
148
123
  /* Enable various shared object loading systems */
149
124
  #define SDL_LOADSO_DLOPEN 1