gosu 1.4.5.pre1 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -8
  3. data/dependencies/SDL/include/SDL.h +2 -1
  4. data/dependencies/SDL/include/SDL_assert.h +8 -12
  5. data/dependencies/SDL/include/SDL_atomic.h +21 -1
  6. data/dependencies/SDL/include/SDL_audio.h +41 -5
  7. data/dependencies/SDL/include/SDL_bits.h +1 -1
  8. data/dependencies/SDL/include/SDL_blendmode.h +5 -7
  9. data/dependencies/SDL/include/SDL_clipboard.h +48 -1
  10. data/dependencies/SDL/include/SDL_config.h +73 -47
  11. data/dependencies/SDL/include/SDL_cpuinfo.h +40 -5
  12. data/dependencies/SDL/include/SDL_egl.h +60 -10
  13. data/dependencies/SDL/include/SDL_endian.h +35 -4
  14. data/dependencies/SDL/include/SDL_error.h +1 -1
  15. data/dependencies/SDL/include/SDL_events.h +33 -2
  16. data/dependencies/SDL/include/SDL_filesystem.h +6 -2
  17. data/dependencies/SDL/include/SDL_gamecontroller.h +79 -6
  18. data/dependencies/SDL/include/SDL_gesture.h +1 -1
  19. data/dependencies/SDL/include/SDL_guid.h +100 -0
  20. data/dependencies/SDL/include/SDL_haptic.h +1 -1
  21. data/dependencies/SDL/include/SDL_hidapi.h +1 -1
  22. data/dependencies/SDL/include/SDL_hints.h +646 -44
  23. data/dependencies/SDL/include/SDL_joystick.h +128 -8
  24. data/dependencies/SDL/include/SDL_keyboard.h +39 -2
  25. data/dependencies/SDL/include/SDL_keycode.h +7 -2
  26. data/dependencies/SDL/include/SDL_loadso.h +1 -1
  27. data/dependencies/SDL/include/SDL_locale.h +1 -1
  28. data/dependencies/SDL/include/SDL_log.h +3 -3
  29. data/dependencies/SDL/include/SDL_main.h +43 -3
  30. data/dependencies/SDL/include/SDL_messagebox.h +1 -1
  31. data/dependencies/SDL/include/SDL_metal.h +3 -2
  32. data/dependencies/SDL/include/SDL_misc.h +1 -1
  33. data/dependencies/SDL/include/SDL_mouse.h +13 -2
  34. data/dependencies/SDL/include/SDL_mutex.h +1 -1
  35. data/dependencies/SDL/include/SDL_name.h +1 -1
  36. data/dependencies/SDL/include/SDL_opengl.h +1 -52
  37. data/dependencies/SDL/include/SDL_opengl_glext.h +2260 -231
  38. data/dependencies/SDL/include/SDL_opengles.h +1 -1
  39. data/dependencies/SDL/include/SDL_opengles2.h +1 -1
  40. data/dependencies/SDL/include/SDL_opengles2_gl2.h +374 -339
  41. data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +3479 -1496
  42. data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +6 -9
  43. data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +43 -14
  44. data/dependencies/SDL/include/SDL_pixels.h +1 -1
  45. data/dependencies/SDL/include/SDL_platform.h +33 -7
  46. data/dependencies/SDL/include/SDL_power.h +1 -1
  47. data/dependencies/SDL/include/SDL_quit.h +1 -1
  48. data/dependencies/SDL/include/SDL_rect.h +155 -3
  49. data/dependencies/SDL/include/SDL_render.h +47 -18
  50. data/dependencies/SDL/include/SDL_revision.h +6 -1
  51. data/dependencies/SDL/include/SDL_rwops.h +2 -16
  52. data/dependencies/SDL/include/SDL_scancode.h +47 -22
  53. data/dependencies/SDL/include/SDL_sensor.h +25 -4
  54. data/dependencies/SDL/include/SDL_shape.h +1 -1
  55. data/dependencies/SDL/include/SDL_stdinc.h +120 -9
  56. data/dependencies/SDL/include/SDL_surface.h +4 -2
  57. data/dependencies/SDL/include/SDL_system.h +67 -7
  58. data/dependencies/SDL/include/SDL_syswm.h +3 -1
  59. data/dependencies/SDL/include/SDL_test.h +1 -1
  60. data/dependencies/SDL/include/SDL_test_assert.h +1 -1
  61. data/dependencies/SDL/include/SDL_test_common.h +2 -1
  62. data/dependencies/SDL/include/SDL_test_compare.h +1 -1
  63. data/dependencies/SDL/include/SDL_test_crc32.h +1 -1
  64. data/dependencies/SDL/include/SDL_test_font.h +91 -4
  65. data/dependencies/SDL/include/SDL_test_fuzzer.h +1 -1
  66. data/dependencies/SDL/include/SDL_test_harness.h +1 -1
  67. data/dependencies/SDL/include/SDL_test_images.h +1 -1
  68. data/dependencies/SDL/include/SDL_test_log.h +1 -1
  69. data/dependencies/SDL/include/SDL_test_md5.h +1 -1
  70. data/dependencies/SDL/include/SDL_test_memory.h +1 -1
  71. data/dependencies/SDL/include/SDL_test_random.h +1 -1
  72. data/dependencies/SDL/include/SDL_thread.h +6 -6
  73. data/dependencies/SDL/include/SDL_timer.h +1 -1
  74. data/dependencies/SDL/include/SDL_touch.h +9 -1
  75. data/dependencies/SDL/include/SDL_types.h +1 -1
  76. data/dependencies/SDL/include/SDL_version.h +20 -4
  77. data/dependencies/SDL/include/SDL_video.h +72 -10
  78. data/dependencies/SDL/include/begin_code.h +5 -5
  79. data/dependencies/SDL/include/close_code.h +1 -1
  80. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  81. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  82. data/dependencies/SDL_sound/SDL_sound.c +210 -71
  83. data/dependencies/SDL_sound/SDL_sound.h +1 -1
  84. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +111 -168
  85. data/dependencies/SDL_sound/SDL_sound_flac.c +0 -6
  86. data/dependencies/SDL_sound/SDL_sound_internal.h +24 -2
  87. data/dependencies/SDL_sound/SDL_sound_modplug.c +20 -8
  88. data/dependencies/SDL_sound/SDL_sound_mp3.c +11 -7
  89. data/dependencies/SDL_sound/SDL_sound_raw.c +1 -1
  90. data/dependencies/SDL_sound/SDL_sound_shn.c +1 -5
  91. data/dependencies/SDL_sound/SDL_sound_voc.c +1 -1
  92. data/dependencies/SDL_sound/SDL_sound_vorbis.c +2 -4
  93. data/dependencies/SDL_sound/SDL_sound_wav.c +49 -20
  94. data/dependencies/SDL_sound/dr_flac.h +237 -95
  95. data/dependencies/SDL_sound/dr_mp3.h +46 -33
  96. data/dependencies/SDL_sound/libmodplug/fastmix.c +53 -39
  97. data/dependencies/SDL_sound/libmodplug/libmodplug.h +0 -12
  98. data/dependencies/SDL_sound/libmodplug/load_669.c +37 -32
  99. data/dependencies/SDL_sound/libmodplug/load_amf.c +57 -44
  100. data/dependencies/SDL_sound/libmodplug/load_ams.c +127 -100
  101. data/dependencies/SDL_sound/libmodplug/load_dbm.c +40 -37
  102. data/dependencies/SDL_sound/libmodplug/load_dmf.c +61 -49
  103. data/dependencies/SDL_sound/libmodplug/load_dsm.c +18 -13
  104. data/dependencies/SDL_sound/libmodplug/load_far.c +31 -24
  105. data/dependencies/SDL_sound/libmodplug/load_gdm.c +27 -21
  106. data/dependencies/SDL_sound/libmodplug/load_it.c +106 -91
  107. data/dependencies/SDL_sound/libmodplug/load_mdl.c +43 -35
  108. data/dependencies/SDL_sound/libmodplug/load_med.c +66 -52
  109. data/dependencies/SDL_sound/libmodplug/load_mod.c +30 -26
  110. data/dependencies/SDL_sound/libmodplug/load_mt2.c +61 -50
  111. data/dependencies/SDL_sound/libmodplug/load_mtm.c +23 -17
  112. data/dependencies/SDL_sound/libmodplug/load_okt.c +18 -16
  113. data/dependencies/SDL_sound/libmodplug/load_psm.c +44 -32
  114. data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -14
  115. data/dependencies/SDL_sound/libmodplug/load_s3m.c +59 -53
  116. data/dependencies/SDL_sound/libmodplug/load_stm.c +23 -18
  117. data/dependencies/SDL_sound/libmodplug/load_ult.c +33 -29
  118. data/dependencies/SDL_sound/libmodplug/load_xm.c +64 -57
  119. data/dependencies/SDL_sound/libmodplug/mmcmp.c +2 -1
  120. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +30 -20
  121. data/dependencies/SDL_sound/libmodplug/snd_flt.c +6 -4
  122. data/dependencies/SDL_sound/libmodplug/snd_fx.c +91 -65
  123. data/dependencies/SDL_sound/libmodplug/sndfile.c +91 -66
  124. data/dependencies/SDL_sound/libmodplug/sndmix.c +58 -35
  125. data/dependencies/SDL_sound/stb_vorbis.h +14 -9
  126. data/dependencies/mojoAL/mojoal.c +68 -40
  127. data/dependencies/stb/stb_image.h +117 -27
  128. data/dependencies/utf8proc/utf8proc.c +1 -1
  129. data/dependencies/utf8proc/utf8proc.h +1 -1
  130. data/dependencies/utf8proc/utf8proc_data.h +3366 -3184
  131. data/ext/gosu/extconf.rb +1 -1
  132. data/include/Gosu/Version.hpp +1 -1
  133. data/lib/SDL2.dll +0 -0
  134. data/lib64/SDL2.dll +0 -0
  135. data/src/AudioFile.hpp +1 -1
  136. data/src/AudioFileSDLSound.cpp +2 -0
  137. data/src/AudioImpl.hpp +2 -2
  138. data/src/Input.cpp +30 -26
  139. data/src/RubyGosu.cxx +146 -93
  140. data/src/RubyGosu.h +5 -7
  141. data/src/Window.cpp +3 -0
  142. metadata +6 -15
  143. data/dependencies/SDL/include/SDL_config_android.h +0 -157
  144. data/dependencies/SDL/include/SDL_config_iphoneos.h +0 -166
  145. data/dependencies/SDL/include/SDL_config_macosx.h +0 -197
  146. data/dependencies/SDL/include/SDL_config_minimal.h +0 -82
  147. data/dependencies/SDL/include/SDL_config_pandora.h +0 -128
  148. data/dependencies/SDL/include/SDL_config_psp.h +0 -144
  149. data/dependencies/SDL/include/SDL_config_windows.h +0 -225
  150. data/dependencies/SDL/include/SDL_config_winrt.h +0 -215
  151. data/dependencies/SDL/include/SDL_config_wiz.h +0 -121
  152. data/dependencies/SDL/include/SDL_copying.h +0 -20
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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,7 +38,8 @@ extern "C" {
38
38
 
39
39
  /* Function prototypes */
40
40
 
41
- #define FONT_CHARACTER_SIZE 8
41
+ #define FONT_CHARACTER_SIZE 8
42
+ #define FONT_LINE_HEIGHT (FONT_CHARACTER_SIZE + 2)
42
43
 
43
44
  /**
44
45
  * \brief Draw a string in the currently set font.
@@ -50,10 +51,12 @@ extern "C" {
50
51
  *
51
52
  * \returns 0 on success, -1 on failure.
52
53
  */
53
- int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
54
+ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, Uint32 c);
54
55
 
55
56
  /**
56
- * \brief Draw a string in the currently set font.
57
+ * \brief Draw a UTF-8 string in the currently set font.
58
+ *
59
+ * The font currently only supports characters in the Basic Latin and Latin-1 Supplement sets.
57
60
  *
58
61
  * \param renderer The renderer to draw on.
59
62
  * \param x The X coordinate of the upper left corner of the string.
@@ -64,6 +67,90 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, int x, int y, char c);
64
67
  */
65
68
  int SDLTest_DrawString(SDL_Renderer *renderer, int x, int y, const char *s);
66
69
 
70
+ /**
71
+ * \brief Data used for multi-line text output
72
+ */
73
+ typedef struct SDLTest_TextWindow
74
+ {
75
+ SDL_Rect rect;
76
+ int current;
77
+ int numlines;
78
+ char **lines;
79
+ } SDLTest_TextWindow;
80
+
81
+ /**
82
+ * \brief Create a multi-line text output window
83
+ *
84
+ * \param x The X coordinate of the upper left corner of the window.
85
+ * \param y The Y coordinate of the upper left corner of the window.
86
+ * \param w The width of the window (currently ignored)
87
+ * \param h The height of the window (currently ignored)
88
+ *
89
+ * \returns the new window, or NULL on failure.
90
+ *
91
+ * \since This function is available since SDL 2.24.0
92
+ */
93
+ SDLTest_TextWindow *SDLTest_TextWindowCreate(int x, int y, int w, int h);
94
+
95
+ /**
96
+ * \brief Display a multi-line text output window
97
+ *
98
+ * This function should be called every frame to display the text
99
+ *
100
+ * \param textwin The text output window
101
+ * \param renderer The renderer to use for display
102
+ *
103
+ * \since This function is available since SDL 2.24.0
104
+ */
105
+ void SDLTest_TextWindowDisplay(SDLTest_TextWindow *textwin, SDL_Renderer *renderer);
106
+
107
+ /**
108
+ * \brief Add text to a multi-line text output window
109
+ *
110
+ * Adds UTF-8 text to the end of the current text. The newline character starts a
111
+ * new line of text. The backspace character deletes the last character or, if the
112
+ * line is empty, deletes the line and goes to the end of the previous line.
113
+ *
114
+ * \param textwin The text output window
115
+ * \param fmt A printf() style format string
116
+ * \param ... additional parameters matching % tokens in the `fmt` string, if any
117
+ *
118
+ * \since This function is available since SDL 2.24.0
119
+ */
120
+ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(2);
121
+
122
+ /**
123
+ * \brief Add text to a multi-line text output window
124
+ *
125
+ * Adds UTF-8 text to the end of the current text. The newline character starts a
126
+ * new line of text. The backspace character deletes the last character or, if the
127
+ * line is empty, deletes the line and goes to the end of the previous line.
128
+ *
129
+ * \param textwin The text output window
130
+ * \param text The text to add to the window
131
+ * \param len The length, in bytes, of the text to add to the window
132
+ *
133
+ * \since This function is available since SDL 2.24.0
134
+ */
135
+ void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len);
136
+
137
+ /**
138
+ * \brief Clear the text in a multi-line text output window
139
+ *
140
+ * \param textwin The text output window
141
+ *
142
+ * \since This function is available since SDL 2.24.0
143
+ */
144
+ void SDLTest_TextWindowClear(SDLTest_TextWindow *textwin);
145
+
146
+ /**
147
+ * \brief Free the storage associated with a multi-line text output window
148
+ *
149
+ * \param textwin The text output window
150
+ *
151
+ * \since This function is available since SDL 2.24.0
152
+ */
153
+ void SDLTest_TextWindowDestroy(SDLTest_TextWindow *textwin);
67
154
 
68
155
  /**
69
156
  * \brief Cleanup textures used by font drawing functions.
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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,7 +35,7 @@
35
35
  #include "SDL_atomic.h"
36
36
  #include "SDL_mutex.h"
37
37
 
38
- #if defined(__WIN32__)
38
+ #if defined(__WIN32__) || defined(__GDK__)
39
39
  #include <process.h> /* _beginthreadex() and _endthreadex() */
40
40
  #endif
41
41
  #if defined(__OS2__) /* for _beginthread() and _endthread() */
@@ -88,7 +88,7 @@ typedef enum {
88
88
  typedef int (SDLCALL * SDL_ThreadFunction) (void *data);
89
89
 
90
90
 
91
- #if defined(__WIN32__)
91
+ #if defined(__WIN32__) || defined(__GDK__)
92
92
  /**
93
93
  * \file SDL_thread.h
94
94
  *
@@ -129,7 +129,7 @@ SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data,
129
129
  pfnSDL_CurrentEndThread pfnEndThread);
130
130
 
131
131
  extern DECLSPEC SDL_Thread *SDLCALL
132
- SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
132
+ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn,
133
133
  const char *name, const size_t stacksize, void *data,
134
134
  pfnSDL_CurrentBeginThread pfnBeginThread,
135
135
  pfnSDL_CurrentEndThread pfnEndThread);
@@ -142,7 +142,7 @@ SDL_CreateThreadWithStackSize(int (SDLCALL * fn) (void *),
142
142
  #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
143
143
  #else
144
144
  #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
145
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)SDL_endthread)
145
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
146
146
  #endif
147
147
 
148
148
  #elif defined(__OS2__)
@@ -175,7 +175,7 @@ SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, const siz
175
175
  #undef SDL_CreateThread
176
176
  #define SDL_CreateThread(fn, name, data) SDL_CreateThread_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
177
177
  #undef SDL_CreateThreadWithStackSize
178
- #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
178
+ #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize_REAL(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
179
179
  #else
180
180
  #define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
181
181
  #define SDL_CreateThreadWithStackSize(fn, name, stacksize, data) SDL_CreateThreadWithStackSize(fn, name, stacksize, data, (pfnSDL_CurrentBeginThread)SDL_beginthread, (pfnSDL_CurrentEndThread)SDL_endthread)
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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
@@ -95,6 +95,14 @@ extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void);
95
95
  */
96
96
  extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index);
97
97
 
98
+ /**
99
+ * Get the touch device name as reported from the driver or NULL if the index
100
+ * is invalid.
101
+ *
102
+ * \since This function is available since SDL 2.0.22.
103
+ */
104
+ extern DECLSPEC const char* SDLCALL SDL_GetTouchName(int index);
105
+
98
106
  /**
99
107
  * Get the type of the given touch device.
100
108
  *
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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
@@ -58,8 +58,8 @@ typedef struct SDL_version
58
58
  /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
59
59
  */
60
60
  #define SDL_MAJOR_VERSION 2
61
- #define SDL_MINOR_VERSION 0
62
- #define SDL_PATCHLEVEL 20
61
+ #define SDL_MINOR_VERSION 26
62
+ #define SDL_PATCHLEVEL 5
63
63
 
64
64
  /**
65
65
  * Macro to determine SDL version program was compiled against.
@@ -83,6 +83,8 @@ typedef struct SDL_version
83
83
  (x)->patch = SDL_PATCHLEVEL; \
84
84
  }
85
85
 
86
+ /* TODO: Remove this whole block in SDL 3 */
87
+ #if SDL_MAJOR_VERSION < 3
86
88
  /**
87
89
  * This macro turns the version numbers into a numeric value:
88
90
  * \verbatim
@@ -90,21 +92,35 @@ typedef struct SDL_version
90
92
  \endverbatim
91
93
  *
92
94
  * This assumes that there will never be more than 100 patchlevels.
95
+ *
96
+ * In versions higher than 2.9.0, the minor version overflows into
97
+ * the thousands digit: for example, 2.23.0 is encoded as 4300,
98
+ * and 2.255.99 would be encoded as 25799.
99
+ * This macro will not be available in SDL 3.x.
93
100
  */
94
101
  #define SDL_VERSIONNUM(X, Y, Z) \
95
102
  ((X)*1000 + (Y)*100 + (Z))
96
103
 
97
104
  /**
98
105
  * This is the version number macro for the current SDL version.
106
+ *
107
+ * In versions higher than 2.9.0, the minor version overflows into
108
+ * the thousands digit: for example, 2.23.0 is encoded as 4300.
109
+ * This macro will not be available in SDL 3.x.
110
+ *
111
+ * Deprecated, use SDL_VERSION_ATLEAST or SDL_VERSION instead.
99
112
  */
100
113
  #define SDL_COMPILEDVERSION \
101
114
  SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL)
115
+ #endif /* SDL_MAJOR_VERSION < 3 */
102
116
 
103
117
  /**
104
118
  * This macro will evaluate to true if compiled with SDL at least X.Y.Z.
105
119
  */
106
120
  #define SDL_VERSION_ATLEAST(X, Y, Z) \
107
- (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z))
121
+ ((SDL_MAJOR_VERSION >= X) && \
122
+ (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION >= Y) && \
123
+ (SDL_MAJOR_VERSION > X || SDL_MINOR_VERSION > Y || SDL_PATCHLEVEL >= Z))
108
124
 
109
125
  /**
110
126
  * Get the version of SDL that is linked against your program.
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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
@@ -248,7 +248,8 @@ typedef enum
248
248
  SDL_GL_FRAMEBUFFER_SRGB_CAPABLE,
249
249
  SDL_GL_CONTEXT_RELEASE_BEHAVIOR,
250
250
  SDL_GL_CONTEXT_RESET_NOTIFICATION,
251
- SDL_GL_CONTEXT_NO_ERROR
251
+ SDL_GL_CONTEXT_NO_ERROR,
252
+ SDL_GL_FLOATBUFFERS
252
253
  } SDL_GLattr;
253
254
 
254
255
  typedef enum
@@ -444,6 +445,15 @@ extern DECLSPEC int SDLCALL SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rec
444
445
  * A failure of this function usually means that either no DPI information is
445
446
  * available or the `displayIndex` is out of range.
446
447
  *
448
+ * **WARNING**: This reports the DPI that the hardware reports, and it is not
449
+ * always reliable! It is almost always better to use SDL_GetWindowSize() to
450
+ * find the window size, which might be in logical points instead of pixels,
451
+ * and then SDL_GL_GetDrawableSize(), SDL_Vulkan_GetDrawableSize(),
452
+ * SDL_Metal_GetDrawableSize(), or SDL_GetRendererOutputSize(), and compare
453
+ * the two values to get an actual scaling value between the two. We will be
454
+ * rethinking how high-dpi details should be managed in SDL3 to make things
455
+ * more consistent, reliable, and clear.
456
+ *
447
457
  * \param displayIndex the index of the display from which DPI information
448
458
  * should be queried
449
459
  * \param ddpi a pointer filled in with the diagonal DPI of the display; may
@@ -587,6 +597,35 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_Disp
587
597
  */
588
598
  extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
589
599
 
600
+ /**
601
+ * Get the index of the display containing a point
602
+ *
603
+ * \param point the point to query
604
+ * \returns the index of the display containing the point or a negative error
605
+ * code on failure; call SDL_GetError() for more information.
606
+ *
607
+ * \since This function is available since SDL 2.24.0.
608
+ *
609
+ * \sa SDL_GetDisplayBounds
610
+ * \sa SDL_GetNumVideoDisplays
611
+ */
612
+ extern DECLSPEC int SDLCALL SDL_GetPointDisplayIndex(const SDL_Point * point);
613
+
614
+ /**
615
+ * Get the index of the display primarily containing a rect
616
+ *
617
+ * \param rect the rect to query
618
+ * \returns the index of the display entirely containing the rect or closest
619
+ * to the center of the rect on success or a negative error code on
620
+ * failure; call SDL_GetError() for more information.
621
+ *
622
+ * \since This function is available since SDL 2.24.0.
623
+ *
624
+ * \sa SDL_GetDisplayBounds
625
+ * \sa SDL_GetNumVideoDisplays
626
+ */
627
+ extern DECLSPEC int SDLCALL SDL_GetRectDisplayIndex(const SDL_Rect * rect);
628
+
590
629
  /**
591
630
  * Get the index of the display associated with a window.
592
631
  *
@@ -697,7 +736,10 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
697
736
  * in pixels may differ from its size in screen coordinates on platforms with
698
737
  * high-DPI support (e.g. iOS and macOS). Use SDL_GetWindowSize() to query the
699
738
  * client area's size in screen coordinates, and SDL_GL_GetDrawableSize() or
700
- * SDL_GetRendererOutputSize() to query the drawable size in pixels.
739
+ * SDL_GetRendererOutputSize() to query the drawable size in pixels. Note that
740
+ * when this flag is set, the drawable size can vary after the window is
741
+ * created and should be queried after major window events such as when the
742
+ * window is resized or moved between displays.
701
743
  *
702
744
  * If the window is set fullscreen, the width and height parameters `w` and
703
745
  * `h` will not be used. However, invalid size parameters (e.g. too large) may
@@ -1004,6 +1046,27 @@ extern DECLSPEC int SDLCALL SDL_GetWindowBordersSize(SDL_Window * window,
1004
1046
  int *top, int *left,
1005
1047
  int *bottom, int *right);
1006
1048
 
1049
+ /**
1050
+ * Get the size of a window in pixels.
1051
+ *
1052
+ * This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
1053
+ * drawable, i.e. the window was created with `SDL_WINDOW_ALLOW_HIGHDPI` on a
1054
+ * platform with high-DPI support (Apple calls this "Retina"), and not
1055
+ * disabled by the `SDL_HINT_VIDEO_HIGHDPI_DISABLED` hint.
1056
+ *
1057
+ * \param window the window from which the drawable size should be queried
1058
+ * \param w a pointer to variable for storing the width in pixels, may be NULL
1059
+ * \param h a pointer to variable for storing the height in pixels, may be
1060
+ * NULL
1061
+ *
1062
+ * \since This function is available since SDL 2.26.0.
1063
+ *
1064
+ * \sa SDL_CreateWindow
1065
+ * \sa SDL_GetWindowSize
1066
+ */
1067
+ extern DECLSPEC void SDLCALL SDL_GetWindowSizeInPixels(SDL_Window * window,
1068
+ int *w, int *h);
1069
+
1007
1070
  /**
1008
1071
  * Set the minimum size of a window's client area.
1009
1072
  *
@@ -1337,6 +1400,7 @@ extern DECLSPEC void SDLCALL SDL_SetWindowKeyboardGrab(SDL_Window * window,
1337
1400
  * Mouse grab confines the mouse cursor to the window.
1338
1401
  *
1339
1402
  * \param window The window for which the mouse grab mode should be set.
1403
+ * \param grabbed This is SDL_TRUE to grab mouse, and SDL_FALSE to release.
1340
1404
  *
1341
1405
  * \since This function is available since SDL 2.0.16.
1342
1406
  *
@@ -1747,6 +1811,9 @@ extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void);
1747
1811
  * If you disable the screensaver, it is automatically re-enabled when SDL
1748
1812
  * quits.
1749
1813
  *
1814
+ * The screensaver is disabled by default since SDL 2.0.2. Before SDL 2.0.2
1815
+ * the screensaver was enabled by default.
1816
+ *
1750
1817
  * \since This function is available since SDL 2.0.0.
1751
1818
  *
1752
1819
  * \sa SDL_EnableScreenSaver
@@ -2008,13 +2075,8 @@ extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w,
2008
2075
  * retry the call with 1 for the interval.
2009
2076
  *
2010
2077
  * Adaptive vsync is implemented for some glX drivers with
2011
- * GLX_EXT_swap_control_tear:
2012
- *
2013
- * https://www.opengl.org/registry/specs/EXT/glx_swap_control_tear.txt
2014
- *
2015
- * and for some Windows drivers with WGL_EXT_swap_control_tear:
2016
- *
2017
- * https://www.opengl.org/registry/specs/EXT/wgl_swap_control_tear.txt
2078
+ * GLX_EXT_swap_control_tear, and for some Windows drivers with
2079
+ * WGL_EXT_swap_control_tear.
2018
2080
  *
2019
2081
  * Read more on the Khronos wiki:
2020
2082
  * https://www.khronos.org/opengl/wiki/Swap_Interval#Adaptive_Vsync
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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
@@ -34,7 +34,7 @@
34
34
  #define _begin_code_h
35
35
 
36
36
  #ifndef SDL_DEPRECATED
37
- # if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
37
+ # if defined(__GNUC__) && (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */
38
38
  # define SDL_DEPRECATED __attribute__((deprecated))
39
39
  # else
40
40
  # define SDL_DEPRECATED
@@ -51,7 +51,7 @@
51
51
 
52
52
  /* Some compilers use a special export keyword */
53
53
  #ifndef DECLSPEC
54
- # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__)
54
+ # if defined(__WIN32__) || defined(__WINRT__) || defined(__CYGWIN__) || defined(__GDK__)
55
55
  # ifdef DLL_EXPORT
56
56
  # define DECLSPEC __declspec(dllexport)
57
57
  # else
@@ -74,7 +74,7 @@
74
74
 
75
75
  /* By default SDL uses the C calling convention */
76
76
  #ifndef SDLCALL
77
- #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__)
77
+ #if (defined(__WIN32__) || defined(__WINRT__) || defined(__GDK__)) && !defined(__GNUC__)
78
78
  #define SDLCALL __cdecl
79
79
  #elif defined(__OS2__) || defined(__EMX__)
80
80
  #define SDLCALL _System
@@ -107,7 +107,7 @@
107
107
  #ifdef __BORLANDC__
108
108
  #pragma nopackwarning
109
109
  #endif
110
- #ifdef _M_X64
110
+ #ifdef _WIN64
111
111
  /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */
112
112
  #pragma pack(push,8)
113
113
  #else
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2023 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
Binary file
Binary file