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,88 +38,97 @@ extern "C" {
38
38
  #endif
39
39
 
40
40
  /**
41
- * \brief Get the path where the application resides.
41
+ * Get the directory where the application was run from.
42
42
  *
43
- * Get the "base path". This is the directory where the application was run
44
- * from, which is probably the installation directory, and may or may not
45
- * be the process's current working directory.
43
+ * This is not necessarily a fast call, so you should call this once near
44
+ * startup and save the string if you need it.
46
45
  *
47
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
48
- * end with a path separator ('\\' on Windows, '/' most other places).
46
+ * **Mac OS X and iOS Specific Functionality**: If the application is in a
47
+ * ".app" bundle, this function returns the Resource directory (e.g.
48
+ * MyApp.app/Contents/Resources/). This behaviour can be overridden by adding
49
+ * a property to the Info.plist file. Adding a string key with the name
50
+ * SDL_FILESYSTEM_BASE_DIR_TYPE with a supported value will change the
51
+ * behaviour.
49
52
  *
50
- * The pointer returned by this function is owned by you. Please call
51
- * SDL_free() on the pointer when you are done with it, or it will be a
52
- * memory leak. This is not necessarily a fast call, though, so you should
53
- * call this once near startup and save the string if you need it.
53
+ * Supported values for the SDL_FILESYSTEM_BASE_DIR_TYPE property (Given an
54
+ * application in /Applications/SDLApp/MyApp.app):
54
55
  *
55
- * Some platforms can't determine the application's path, and on other
56
- * platforms, this might be meaningless. In such cases, this function will
57
- * return NULL.
56
+ * - `resource`: bundle resource directory (the default). For example:
57
+ * `/Applications/SDLApp/MyApp.app/Contents/Resources`
58
+ * - `bundle`: the Bundle directory. For example:
59
+ * `/Applications/SDLApp/MyApp.app/`
60
+ * - `parent`: the containing directory of the bundle. For example:
61
+ * `/Applications/SDLApp/`
58
62
  *
59
- * \return String of base dir in UTF-8 encoding, or NULL on error.
63
+ * The returned path is guaranteed to end with a path separator ('\' on
64
+ * Windows, '/' on most other platforms).
65
+ *
66
+ * The pointer returned is owned by the caller. Please call SDL_free() on the
67
+ * pointer when done with it.
68
+ *
69
+ * \returns an absolute path in UTF-8 encoding to the application data
70
+ * directory. NULL will be returned on error or when the platform
71
+ * doesn't implement this functionality, call SDL_GetError() for more
72
+ * information.
73
+ *
74
+ * \since This function is available since SDL 2.0.1.
60
75
  *
61
76
  * \sa SDL_GetPrefPath
62
77
  */
63
78
  extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
64
79
 
65
80
  /**
66
- * \brief Get the user-and-app-specific path where files can be written.
81
+ * Get the user-and-app-specific path where files can be written.
67
82
  *
68
83
  * Get the "pref dir". This is meant to be where users can write personal
69
- * files (preferences and save games, etc) that are specific to your
70
- * application. This directory is unique per user, per application.
84
+ * files (preferences and save games, etc) that are specific to your
85
+ * application. This directory is unique per user, per application.
71
86
  *
72
- * This function will decide the appropriate location in the native filesystem,
73
- * create the directory if necessary, and return a string of the absolute
74
- * path to the directory in UTF-8 encoding.
87
+ * This function will decide the appropriate location in the native
88
+ * filesystem, create the directory if necessary, and return a string of the
89
+ * absolute path to the directory in UTF-8 encoding.
75
90
  *
76
91
  * On Windows, the string might look like:
77
- * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
78
92
  *
79
- * On Linux, the string might look like:
80
- * "/home/bob/.local/share/My Program Name/"
93
+ * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
94
+ *
95
+ * On Linux, the string might look like"
96
+ *
97
+ * `/home/bob/.local/share/My Program Name/`
81
98
  *
82
99
  * On Mac OS X, the string might look like:
83
- * "/Users/bob/Library/Application Support/My Program Name/"
84
- *
85
- * (etc.)
86
- *
87
- * You specify the name of your organization (if it's not a real organization,
88
- * your name or an Internet domain you own might do) and the name of your
89
- * application. These should be untranslated proper names.
90
- *
91
- * Both the org and app strings may become part of a directory name, so
92
- * please follow these rules:
93
- *
94
- * - Try to use the same org string (including case-sensitivity) for
95
- * all your applications that use this function.
96
- * - Always use a unique app string for each one, and make sure it never
97
- * changes for an app once you've decided on it.
98
- * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
99
- * - ...only use letters, numbers, and spaces. Avoid punctuation like
100
- * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
101
- *
102
- * This returns an absolute path in UTF-8 encoding, and is guaranteed to
103
- * end with a path separator ('\\' on Windows, '/' most other places).
104
- *
105
- * The pointer returned by this function is owned by you. Please call
106
- * SDL_free() on the pointer when you are done with it, or it will be a
107
- * memory leak. This is not necessarily a fast call, though, so you should
108
- * call this once near startup and save the string if you need it.
109
- *
110
- * You should assume the path returned by this function is the only safe
111
- * place to write files (and that SDL_GetBasePath(), while it might be
112
- * writable, or even the parent of the returned path, aren't where you
113
- * should be writing things).
114
- *
115
- * Some platforms can't determine the pref path, and on other
116
- * platforms, this might be meaningless. In such cases, this function will
117
- * return NULL.
118
- *
119
- * \param org The name of your organization.
120
- * \param app The name of your application.
121
- * \return UTF-8 string of user dir in platform-dependent notation. NULL
122
- * if there's a problem (creating directory failed, etc).
100
+ *
101
+ * `/Users/bob/Library/Application Support/My Program Name/`
102
+ *
103
+ * You should assume the path returned by this function is the only safe place
104
+ * to write files (and that SDL_GetBasePath(), while it might be writable, or
105
+ * even the parent of the returned path, isn't where you should be writing
106
+ * things).
107
+ *
108
+ * Both the org and app strings may become part of a directory name, so please
109
+ * follow these rules:
110
+ *
111
+ * - Try to use the same org string (_including case-sensitivity_) for all
112
+ * your applications that use this function.
113
+ * - Always use a unique app string for each one, and make sure it never
114
+ * changes for an app once you've decided on it.
115
+ * - Unicode characters are legal, as long as it's UTF-8 encoded, but...
116
+ * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game
117
+ * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
118
+ *
119
+ * The returned path is guaranteed to end with a path separator ('\' on
120
+ * Windows, '/' on most other platforms).
121
+ *
122
+ * The pointer returned is owned by the caller. Please call SDL_free() on the
123
+ * pointer when done with it.
124
+ *
125
+ * \param org the name of your organization
126
+ * \param app the name of your application
127
+ * \returns a UTF-8 string of the user directory in platform-dependent
128
+ * notation. NULL if there's a problem (creating directory failed,
129
+ * etc.).
130
+ *
131
+ * \since This function is available since SDL 2.0.1.
123
132
  *
124
133
  * \sa SDL_GetBasePath
125
134
  */