gosu 1.4.4 → 1.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/dependencies/SDL/include/SDL.h +1 -0
  3. data/dependencies/SDL/include/SDL_assert.h +4 -2
  4. data/dependencies/SDL/include/SDL_atomic.h +20 -0
  5. data/dependencies/SDL/include/SDL_audio.h +40 -4
  6. data/dependencies/SDL/include/SDL_blendmode.h +4 -6
  7. data/dependencies/SDL/include/SDL_clipboard.h +47 -0
  8. data/dependencies/SDL/include/SDL_config.h +71 -45
  9. data/dependencies/SDL/include/SDL_cpuinfo.h +39 -4
  10. data/dependencies/SDL/include/SDL_egl.h +59 -9
  11. data/dependencies/SDL/include/SDL_endian.h +34 -3
  12. data/dependencies/SDL/include/SDL_events.h +32 -1
  13. data/dependencies/SDL/include/SDL_filesystem.h +5 -1
  14. data/dependencies/SDL/include/SDL_gamecontroller.h +78 -5
  15. data/dependencies/SDL/include/SDL_guid.h +100 -0
  16. data/dependencies/SDL/include/SDL_hints.h +645 -43
  17. data/dependencies/SDL/include/SDL_joystick.h +127 -7
  18. data/dependencies/SDL/include/SDL_keyboard.h +38 -1
  19. data/dependencies/SDL/include/SDL_keycode.h +6 -1
  20. data/dependencies/SDL/include/SDL_log.h +2 -2
  21. data/dependencies/SDL/include/SDL_main.h +42 -2
  22. data/dependencies/SDL/include/SDL_metal.h +2 -1
  23. data/dependencies/SDL/include/SDL_mouse.h +12 -1
  24. data/dependencies/SDL/include/SDL_opengl.h +0 -51
  25. data/dependencies/SDL/include/SDL_opengl_glext.h +2260 -231
  26. data/dependencies/SDL/include/SDL_opengles2_gl2.h +374 -339
  27. data/dependencies/SDL/include/SDL_opengles2_gl2ext.h +3479 -1496
  28. data/dependencies/SDL/include/SDL_opengles2_gl2platform.h +6 -9
  29. data/dependencies/SDL/include/SDL_opengles2_khrplatform.h +43 -14
  30. data/dependencies/SDL/include/SDL_platform.h +32 -6
  31. data/dependencies/SDL/include/SDL_rect.h +154 -2
  32. data/dependencies/SDL/include/SDL_render.h +46 -17
  33. data/dependencies/SDL/include/SDL_revision.h +6 -1
  34. data/dependencies/SDL/include/SDL_rwops.h +1 -15
  35. data/dependencies/SDL/include/SDL_scancode.h +46 -21
  36. data/dependencies/SDL/include/SDL_sensor.h +24 -3
  37. data/dependencies/SDL/include/SDL_stdinc.h +119 -8
  38. data/dependencies/SDL/include/SDL_surface.h +3 -1
  39. data/dependencies/SDL/include/SDL_system.h +66 -6
  40. data/dependencies/SDL/include/SDL_syswm.h +2 -0
  41. data/dependencies/SDL/include/SDL_test_common.h +1 -0
  42. data/dependencies/SDL/include/SDL_test_font.h +90 -3
  43. data/dependencies/SDL/include/SDL_thread.h +3 -3
  44. data/dependencies/SDL/include/SDL_touch.h +8 -0
  45. data/dependencies/SDL/include/SDL_version.h +19 -3
  46. data/dependencies/SDL/include/SDL_video.h +71 -9
  47. data/dependencies/SDL/include/begin_code.h +4 -4
  48. data/dependencies/SDL/lib/x64/libSDL2.dll.a +0 -0
  49. data/dependencies/SDL/lib/x86/libSDL2.dll.a +0 -0
  50. data/dependencies/SDL_sound/SDL_sound.c +210 -71
  51. data/dependencies/SDL_sound/SDL_sound.h +1 -1
  52. data/dependencies/SDL_sound/SDL_sound_coreaudio.c +111 -168
  53. data/dependencies/SDL_sound/SDL_sound_flac.c +0 -6
  54. data/dependencies/SDL_sound/SDL_sound_internal.h +27 -5
  55. data/dependencies/SDL_sound/SDL_sound_modplug.c +20 -8
  56. data/dependencies/SDL_sound/SDL_sound_mp3.c +11 -7
  57. data/dependencies/SDL_sound/SDL_sound_raw.c +1 -1
  58. data/dependencies/SDL_sound/SDL_sound_shn.c +1 -5
  59. data/dependencies/SDL_sound/SDL_sound_voc.c +1 -1
  60. data/dependencies/SDL_sound/SDL_sound_vorbis.c +2 -4
  61. data/dependencies/SDL_sound/SDL_sound_wav.c +44 -20
  62. data/dependencies/SDL_sound/dr_flac.h +237 -95
  63. data/dependencies/SDL_sound/dr_mp3.h +46 -33
  64. data/dependencies/SDL_sound/libmodplug/fastmix.c +53 -39
  65. data/dependencies/SDL_sound/libmodplug/libmodplug.h +0 -12
  66. data/dependencies/SDL_sound/libmodplug/load_669.c +37 -32
  67. data/dependencies/SDL_sound/libmodplug/load_amf.c +57 -44
  68. data/dependencies/SDL_sound/libmodplug/load_ams.c +127 -100
  69. data/dependencies/SDL_sound/libmodplug/load_dbm.c +40 -37
  70. data/dependencies/SDL_sound/libmodplug/load_dmf.c +61 -49
  71. data/dependencies/SDL_sound/libmodplug/load_dsm.c +18 -13
  72. data/dependencies/SDL_sound/libmodplug/load_far.c +31 -24
  73. data/dependencies/SDL_sound/libmodplug/load_gdm.c +27 -21
  74. data/dependencies/SDL_sound/libmodplug/load_it.c +106 -91
  75. data/dependencies/SDL_sound/libmodplug/load_mdl.c +43 -35
  76. data/dependencies/SDL_sound/libmodplug/load_med.c +66 -52
  77. data/dependencies/SDL_sound/libmodplug/load_mod.c +30 -26
  78. data/dependencies/SDL_sound/libmodplug/load_mt2.c +61 -50
  79. data/dependencies/SDL_sound/libmodplug/load_mtm.c +23 -17
  80. data/dependencies/SDL_sound/libmodplug/load_okt.c +18 -16
  81. data/dependencies/SDL_sound/libmodplug/load_psm.c +44 -32
  82. data/dependencies/SDL_sound/libmodplug/load_ptm.c +18 -14
  83. data/dependencies/SDL_sound/libmodplug/load_s3m.c +59 -53
  84. data/dependencies/SDL_sound/libmodplug/load_stm.c +23 -18
  85. data/dependencies/SDL_sound/libmodplug/load_ult.c +33 -29
  86. data/dependencies/SDL_sound/libmodplug/load_xm.c +64 -57
  87. data/dependencies/SDL_sound/libmodplug/mmcmp.c +2 -1
  88. data/dependencies/SDL_sound/libmodplug/snd_dsp.c +30 -20
  89. data/dependencies/SDL_sound/libmodplug/snd_flt.c +6 -4
  90. data/dependencies/SDL_sound/libmodplug/snd_fx.c +91 -65
  91. data/dependencies/SDL_sound/libmodplug/sndfile.c +91 -66
  92. data/dependencies/SDL_sound/libmodplug/sndmix.c +58 -35
  93. data/dependencies/SDL_sound/stb_vorbis.h +14 -9
  94. data/dependencies/mojoAL/mojoal.c +41 -24
  95. data/dependencies/utf8proc/utf8proc.c +1 -1
  96. data/dependencies/utf8proc/utf8proc.h +1 -1
  97. data/dependencies/utf8proc/utf8proc_data.h +3366 -3184
  98. data/include/Gosu/Version.hpp +1 -1
  99. data/lib/SDL2.dll +0 -0
  100. data/lib64/SDL2.dll +0 -0
  101. data/src/RubyGosu.cxx +1 -1
  102. data/src/Window.cpp +6 -4
  103. metadata +3 -2
@@ -192,6 +192,20 @@ typedef int64_t khronos_int64_t;
192
192
  typedef uint64_t khronos_uint64_t;
193
193
  #define KHRONOS_SUPPORT_INT64 1
194
194
  #define KHRONOS_SUPPORT_FLOAT 1
195
+ /*
196
+ * To support platform where unsigned long cannot be used interchangeably with
197
+ * inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
198
+ * Ideally, we could just use (u)intptr_t everywhere, but this could result in
199
+ * ABI breakage if khronos_uintptr_t is changed from unsigned long to
200
+ * unsigned long long or similar (this results in different C++ name mangling).
201
+ * To avoid changes for existing platforms, we restrict usage of intptr_t to
202
+ * platforms where the size of a pointer is larger than the size of long.
203
+ */
204
+ #if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
205
+ #if __SIZEOF_POINTER__ > __SIZEOF_LONG__
206
+ #define KHRONOS_USE_INTPTR_T
207
+ #endif
208
+ #endif
195
209
 
196
210
  #elif defined(__VMS ) || defined(__sgi)
197
211
 
@@ -274,14 +288,21 @@ typedef unsigned short int khronos_uint16_t;
274
288
  * pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
275
289
  * to be the only LLP64 architecture in current use.
276
290
  */
277
- #ifdef _WIN64
291
+ #ifdef KHRONOS_USE_INTPTR_T
292
+ typedef intptr_t khronos_intptr_t;
293
+ typedef uintptr_t khronos_uintptr_t;
294
+ #elif defined(_WIN64)
278
295
  typedef signed long long int khronos_intptr_t;
279
296
  typedef unsigned long long int khronos_uintptr_t;
280
- typedef signed long long int khronos_ssize_t;
281
- typedef unsigned long long int khronos_usize_t;
282
297
  #else
283
298
  typedef signed long int khronos_intptr_t;
284
299
  typedef unsigned long int khronos_uintptr_t;
300
+ #endif
301
+
302
+ #if defined(_WIN64)
303
+ typedef signed long long int khronos_ssize_t;
304
+ typedef unsigned long long int khronos_usize_t;
305
+ #else
285
306
  typedef signed long int khronos_ssize_t;
286
307
  typedef unsigned long int khronos_usize_t;
287
308
  #endif
@@ -516,7 +537,7 @@ extern "C" {
516
537
  ** used to make the header, and the header can be found at
517
538
  ** http://www.khronos.org/registry/egl
518
539
  **
519
- ** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
540
+ ** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
520
541
  */
521
542
 
522
543
  /*#include <EGL/eglplatform.h>*/
@@ -525,7 +546,7 @@ extern "C" {
525
546
  #define EGL_EGL_PROTOTYPES 1
526
547
  #endif
527
548
 
528
- /* Generated on date 20210901 */
549
+ /* Generated on date 20220525 */
529
550
 
530
551
  /* Generated C header for:
531
552
  * API: egl
@@ -860,12 +881,12 @@ extern "C" {
860
881
  ** used to make the header, and the header can be found at
861
882
  ** http://www.khronos.org/registry/egl
862
883
  **
863
- ** Khronos $Git commit SHA1: b35e89ca9a $ on $Git commit date: 2021-09-01 09:34:00 +0530 $
884
+ ** Khronos $Git commit SHA1: 6fb1daea15 $ on $Git commit date: 2022-05-25 09:41:13 -0600 $
864
885
  */
865
886
 
866
887
  /*#include <EGL/eglplatform.h>*/
867
888
 
868
- #define EGL_EGLEXT_VERSION 20210901
889
+ #define EGL_EGLEXT_VERSION 20220525
869
890
 
870
891
  /* Generated C header for:
871
892
  * API: egl
@@ -1569,6 +1590,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceBinaryEXT (EGLDeviceEXT device, EGLi
1569
1590
  #define EGL_RENDERER_EXT 0x335F
1570
1591
  #endif /* EGL_EXT_device_query_name */
1571
1592
 
1593
+ #ifndef EGL_EXT_explicit_device
1594
+ #define EGL_EXT_explicit_device 1
1595
+ #endif /* EGL_EXT_explicit_device */
1596
+
1572
1597
  #ifndef EGL_EXT_gl_colorspace_bt2020_linear
1573
1598
  #define EGL_EXT_gl_colorspace_bt2020_linear 1
1574
1599
  #define EGL_GL_COLORSPACE_BT2020_LINEAR_EXT 0x333F
@@ -1794,6 +1819,31 @@ EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStr
1794
1819
  #define EGL_METADATA_SCALING_EXT 50000
1795
1820
  #endif /* EGL_EXT_surface_SMPTE2086_metadata */
1796
1821
 
1822
+ #ifndef EGL_EXT_surface_compression
1823
+ #define EGL_EXT_surface_compression 1
1824
+ #define EGL_SURFACE_COMPRESSION_EXT 0x34B0
1825
+ #define EGL_SURFACE_COMPRESSION_PLANE1_EXT 0x328E
1826
+ #define EGL_SURFACE_COMPRESSION_PLANE2_EXT 0x328F
1827
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_NONE_EXT 0x34B1
1828
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_DEFAULT_EXT 0x34B2
1829
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_1BPC_EXT 0x34B4
1830
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_2BPC_EXT 0x34B5
1831
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_3BPC_EXT 0x34B6
1832
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_4BPC_EXT 0x34B7
1833
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_5BPC_EXT 0x34B8
1834
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_6BPC_EXT 0x34B9
1835
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_7BPC_EXT 0x34BA
1836
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_8BPC_EXT 0x34BB
1837
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_9BPC_EXT 0x34BC
1838
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_10BPC_EXT 0x34BD
1839
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_11BPC_EXT 0x34BE
1840
+ #define EGL_SURFACE_COMPRESSION_FIXED_RATE_12BPC_EXT 0x34BF
1841
+ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSUPPORTEDCOMPRESSIONRATESEXTPROC) (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
1842
+ #ifdef EGL_EGLEXT_PROTOTYPES
1843
+ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySupportedCompressionRatesEXT (EGLDisplay dpy, EGLConfig config, const EGLAttrib *attrib_list, EGLint *rates, EGLint rate_size, EGLint *num_rates);
1844
+ #endif
1845
+ #endif /* EGL_EXT_surface_compression */
1846
+
1797
1847
  #ifndef EGL_EXT_swap_buffers_with_damage
1798
1848
  #define EGL_EXT_swap_buffers_with_damage 1
1799
1849
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, const EGLint *rects, EGLint n_rects);
@@ -2028,12 +2078,12 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface sur
2028
2078
  #define EGL_STREAM_IMAGE_ADD_NV 0x3374
2029
2079
  #define EGL_STREAM_IMAGE_REMOVE_NV 0x3375
2030
2080
  #define EGL_STREAM_IMAGE_AVAILABLE_NV 0x3376
2031
- typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
2081
+ typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMIMAGECONSUMERCONNECTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
2032
2082
  typedef EGLint (EGLAPIENTRYP PFNEGLQUERYSTREAMCONSUMEREVENTNVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
2033
2083
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMACQUIREIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
2034
2084
  typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMRELEASEIMAGENVPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
2035
2085
  #ifdef EGL_EGLEXT_PROTOTYPES
2036
- EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, EGLuint64KHR *modifiers, EGLAttrib *attrib_list);
2086
+ EGLAPI EGLBoolean EGLAPIENTRY eglStreamImageConsumerConnectNV (EGLDisplay dpy, EGLStreamKHR stream, EGLint num_modifiers, const EGLuint64KHR *modifiers, const EGLAttrib *attrib_list);
2037
2087
  EGLAPI EGLint EGLAPIENTRY eglQueryStreamConsumerEventNV (EGLDisplay dpy, EGLStreamKHR stream, EGLTime timeout, EGLenum *event, EGLAttrib *aux);
2038
2088
  EGLAPI EGLBoolean EGLAPIENTRY eglStreamAcquireImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage *pImage, EGLSync sync);
2039
2089
  EGLAPI EGLBoolean EGLAPIENTRY eglStreamReleaseImageNV (EGLDisplay dpy, EGLStreamKHR stream, EGLImage image, EGLSync sync);
@@ -39,7 +39,7 @@
39
39
  static __inline__ void __attribute__((__always_inline__, __nodebug__))
40
40
  _m_prefetch(void *__P)
41
41
  {
42
- __builtin_prefetch (__P, 0, 3 /* _MM_HINT_T0 */);
42
+ __builtin_prefetch(__P, 0, 3 /* _MM_HINT_T0 */);
43
43
  }
44
44
  #endif /* __PRFCHWINTRIN_H */
45
45
  #endif /* __clang__ */
@@ -59,17 +59,26 @@ _m_prefetch(void *__P)
59
59
  #ifdef __linux__
60
60
  #include <endian.h>
61
61
  #define SDL_BYTEORDER __BYTE_ORDER
62
- #elif defined(__OpenBSD__)
62
+ #elif defined(__OpenBSD__) || defined(__DragonFly__)
63
63
  #include <endian.h>
64
64
  #define SDL_BYTEORDER BYTE_ORDER
65
65
  #elif defined(__FreeBSD__) || defined(__NetBSD__)
66
66
  #include <sys/endian.h>
67
67
  #define SDL_BYTEORDER BYTE_ORDER
68
+ /* predefs from newer gcc and clang versions: */
69
+ #elif defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__BYTE_ORDER__)
70
+ #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
71
+ #define SDL_BYTEORDER SDL_LIL_ENDIAN
72
+ #elif (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
73
+ #define SDL_BYTEORDER SDL_BIG_ENDIAN
74
+ #else
75
+ #error Unsupported endianness
76
+ #endif /**/
68
77
  #else
69
78
  #if defined(__hppa__) || \
70
79
  defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
71
80
  (defined(__MIPS__) && defined(__MIPSEB__)) || \
72
- defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \
81
+ defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \
73
82
  defined(__sparc__)
74
83
  #define SDL_BYTEORDER SDL_BIG_ENDIAN
75
84
  #else
@@ -78,6 +87,28 @@ _m_prefetch(void *__P)
78
87
  #endif /* __linux__ */
79
88
  #endif /* !SDL_BYTEORDER */
80
89
 
90
+ #ifndef SDL_FLOATWORDORDER /* Not defined in SDL_config.h? */
91
+ /* predefs from newer gcc versions: */
92
+ #if defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__) && defined(__FLOAT_WORD_ORDER__)
93
+ #if (__FLOAT_WORD_ORDER__ == __ORDER_LITTLE_ENDIAN__)
94
+ #define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
95
+ #elif (__FLOAT_WORD_ORDER__ == __ORDER_BIG_ENDIAN__)
96
+ #define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
97
+ #else
98
+ #error Unsupported endianness
99
+ #endif /**/
100
+ #elif defined(__MAVERICK__)
101
+ /* For Maverick, float words are always little-endian. */
102
+ #define SDL_FLOATWORDORDER SDL_LIL_ENDIAN
103
+ #elif (defined(__arm__) || defined(__thumb__)) && !defined(__VFP_FP__) && !defined(__ARM_EABI__)
104
+ /* For FPA, float words are always big-endian. */
105
+ #define SDL_FLOATWORDORDER SDL_BIG_ENDIAN
106
+ #else
107
+ /* By default, assume that floats words follow the memory system mode. */
108
+ #define SDL_FLOATWORDORDER SDL_BYTEORDER
109
+ #endif /* __FLOAT_WORD_ORDER__ */
110
+ #endif /* !SDL_FLOATWORDORDER */
111
+
81
112
 
82
113
  #include "begin_code.h"
83
114
  /* Set up for C function definitions, even when using C++ */
@@ -102,6 +102,7 @@ typedef enum
102
102
  SDL_KEYMAPCHANGED, /**< Keymap changed due to a system event such as an
103
103
  input language or keyboard layout change.
104
104
  */
105
+ SDL_TEXTEDITING_EXT, /**< Extended keyboard text editing (composition) */
105
106
 
106
107
  /* Mouse events */
107
108
  SDL_MOUSEMOTION = 0x400, /**< Mouse moved */
@@ -117,6 +118,7 @@ typedef enum
117
118
  SDL_JOYBUTTONUP, /**< Joystick button released */
118
119
  SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */
119
120
  SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */
121
+ SDL_JOYBATTERYUPDATED, /**< Joystick battery level change */
120
122
 
121
123
  /* Game controller events */
122
124
  SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */
@@ -141,7 +143,7 @@ typedef enum
141
143
  SDL_MULTIGESTURE,
142
144
 
143
145
  /* Clipboard events */
144
- SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */
146
+ SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard or primary selection changed */
145
147
 
146
148
  /* Drag and drop events */
147
149
  SDL_DROPFILE = 0x1000, /**< The system requests a file open */
@@ -243,6 +245,19 @@ typedef struct SDL_TextEditingEvent
243
245
  Sint32 length; /**< The length of selected editing text */
244
246
  } SDL_TextEditingEvent;
245
247
 
248
+ /**
249
+ * \brief Extended keyboard text editing event structure (event.editExt.*) when text would be
250
+ * truncated if stored in the text buffer SDL_TextEditingEvent
251
+ */
252
+ typedef struct SDL_TextEditingExtEvent
253
+ {
254
+ Uint32 type; /**< ::SDL_TEXTEDITING_EXT */
255
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
256
+ Uint32 windowID; /**< The window with keyboard focus, if any */
257
+ char* text; /**< The editing text, which should be freed with SDL_free(), and will not be NULL */
258
+ Sint32 start; /**< The start cursor of selected editing text */
259
+ Sint32 length; /**< The length of selected editing text */
260
+ } SDL_TextEditingExtEvent;
246
261
 
247
262
  #define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
248
263
  /**
@@ -303,6 +318,8 @@ typedef struct SDL_MouseWheelEvent
303
318
  Uint32 direction; /**< Set to one of the SDL_MOUSEWHEEL_* defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back */
304
319
  float preciseX; /**< The amount scrolled horizontally, positive to the right and negative to the left, with float precision (added in 2.0.18) */
305
320
  float preciseY; /**< The amount scrolled vertically, positive away from the user and negative toward the user, with float precision (added in 2.0.18) */
321
+ Sint32 mouseX; /**< X coordinate, relative to window (added in 2.26.0) */
322
+ Sint32 mouseY; /**< Y coordinate, relative to window (added in 2.26.0) */
306
323
  } SDL_MouseWheelEvent;
307
324
 
308
325
  /**
@@ -381,6 +398,16 @@ typedef struct SDL_JoyDeviceEvent
381
398
  Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */
382
399
  } SDL_JoyDeviceEvent;
383
400
 
401
+ /**
402
+ * \brief Joysick battery level change event structure (event.jbattery.*)
403
+ */
404
+ typedef struct SDL_JoyBatteryEvent
405
+ {
406
+ Uint32 type; /**< ::SDL_JOYBATTERYUPDATED */
407
+ Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
408
+ SDL_JoystickID which; /**< The joystick instance id */
409
+ SDL_JoystickPowerLevel level; /**< The joystick battery level */
410
+ } SDL_JoyBatteryEvent;
384
411
 
385
412
  /**
386
413
  * \brief Game controller axis motion event structure (event.caxis.*)
@@ -449,6 +476,7 @@ typedef struct SDL_ControllerSensorEvent
449
476
  SDL_JoystickID which; /**< The joystick instance id */
450
477
  Sint32 sensor; /**< The type of the sensor, one of the values of ::SDL_SensorType */
451
478
  float data[3]; /**< Up to 3 values from the sensor, as defined in SDL_sensor.h */
479
+ Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
452
480
  } SDL_ControllerSensorEvent;
453
481
 
454
482
  /**
@@ -540,6 +568,7 @@ typedef struct SDL_SensorEvent
540
568
  Uint32 timestamp; /**< In milliseconds, populated using SDL_GetTicks() */
541
569
  Sint32 which; /**< The instance ID of the sensor */
542
570
  float data[6]; /**< Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData() */
571
+ Uint64 timestamp_us; /**< The timestamp of the sensor reading in microseconds, if the hardware provides this information. */
543
572
  } SDL_SensorEvent;
544
573
 
545
574
  /**
@@ -601,6 +630,7 @@ typedef union SDL_Event
601
630
  SDL_WindowEvent window; /**< Window event data */
602
631
  SDL_KeyboardEvent key; /**< Keyboard event data */
603
632
  SDL_TextEditingEvent edit; /**< Text editing event data */
633
+ SDL_TextEditingExtEvent editExt; /**< Extended text editing event data */
604
634
  SDL_TextInputEvent text; /**< Text input event data */
605
635
  SDL_MouseMotionEvent motion; /**< Mouse motion event data */
606
636
  SDL_MouseButtonEvent button; /**< Mouse button event data */
@@ -610,6 +640,7 @@ typedef union SDL_Event
610
640
  SDL_JoyHatEvent jhat; /**< Joystick hat event data */
611
641
  SDL_JoyButtonEvent jbutton; /**< Joystick button event data */
612
642
  SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */
643
+ SDL_JoyBatteryEvent jbattery; /**< Joystick battery event data */
613
644
  SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */
614
645
  SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */
615
646
  SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */
@@ -60,6 +60,10 @@ extern "C" {
60
60
  * - `parent`: the containing directory of the bundle. For example:
61
61
  * `/Applications/SDLApp/`
62
62
  *
63
+ * **Nintendo 3DS Specific Functionality**: This function returns "romfs"
64
+ * directory of the application as it is uncommon to store resources outside
65
+ * the executable. As such it is not a writable directory.
66
+ *
63
67
  * The returned path is guaranteed to end with a path separator ('\' on
64
68
  * Windows, '/' on most other platforms).
65
69
  *
@@ -92,7 +96,7 @@ extern DECLSPEC char *SDLCALL SDL_GetBasePath(void);
92
96
  *
93
97
  * `C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\`
94
98
  *
95
- * On Linux, the string might look like"
99
+ * On Linux, the string might look like:
96
100
  *
97
101
  * `/home/bob/.local/share/My Program Name/`
98
102
  *
@@ -69,7 +69,11 @@ typedef enum
69
69
  SDL_CONTROLLER_TYPE_VIRTUAL,
70
70
  SDL_CONTROLLER_TYPE_PS5,
71
71
  SDL_CONTROLLER_TYPE_AMAZON_LUNA,
72
- SDL_CONTROLLER_TYPE_GOOGLE_STADIA
72
+ SDL_CONTROLLER_TYPE_GOOGLE_STADIA,
73
+ SDL_CONTROLLER_TYPE_NVIDIA_SHIELD,
74
+ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
75
+ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
76
+ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR
73
77
  } SDL_GameControllerType;
74
78
 
75
79
  typedef enum
@@ -289,6 +293,25 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
289
293
  */
290
294
  extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
291
295
 
296
+ /**
297
+ * Get the implementation dependent path for the game controller.
298
+ *
299
+ * This function can be called before any controllers are opened.
300
+ *
301
+ * `joystick_index` is the same as the `device_index` passed to
302
+ * SDL_JoystickOpen().
303
+ *
304
+ * \param joystick_index the device_index of a device, from zero to
305
+ * SDL_NumJoysticks()-1
306
+ * \returns the implementation-dependent path for the game controller, or NULL
307
+ * if there is no path or the index is invalid.
308
+ *
309
+ * \since This function is available since SDL 2.24.0.
310
+ *
311
+ * \sa SDL_GameControllerPath
312
+ */
313
+ extern DECLSPEC const char *SDLCALL SDL_GameControllerPathForIndex(int joystick_index);
314
+
292
315
  /**
293
316
  * Get the type of a game controller.
294
317
  *
@@ -386,6 +409,23 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(in
386
409
  */
387
410
  extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
388
411
 
412
+ /**
413
+ * Get the implementation-dependent path for an opened game controller.
414
+ *
415
+ * This is the same path as returned by SDL_GameControllerNameForIndex(), but
416
+ * it takes a controller identifier instead of the (unstable) device index.
417
+ *
418
+ * \param gamecontroller a game controller identifier previously returned by
419
+ * SDL_GameControllerOpen()
420
+ * \returns the implementation dependent path for the game controller, or NULL
421
+ * if there is no path or the identifier passed is invalid.
422
+ *
423
+ * \since This function is available since SDL 2.24.0.
424
+ *
425
+ * \sa SDL_GameControllerPathForIndex
426
+ */
427
+ extern DECLSPEC const char *SDLCALL SDL_GameControllerPath(SDL_GameController *gamecontroller);
428
+
389
429
  /**
390
430
  * Get the type of this currently opened controller
391
431
  *
@@ -415,7 +455,8 @@ extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController
415
455
  * Set the player index of an opened game controller.
416
456
  *
417
457
  * \param gamecontroller the game controller object to adjust.
418
- * \param player_index Player index to assign to this controller.
458
+ * \param player_index Player index to assign to this controller, or -1 to
459
+ * clear the player index and turn off player LEDs.
419
460
  *
420
461
  * \since This function is available since SDL 2.0.12.
421
462
  */
@@ -457,6 +498,18 @@ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *
457
498
  */
458
499
  extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
459
500
 
501
+ /**
502
+ * Get the firmware version of an opened controller, if available.
503
+ *
504
+ * If the firmware version isn't available this function returns 0.
505
+ *
506
+ * \param gamecontroller the game controller object to query.
507
+ * \return the controller firmware version, or zero if unavailable.
508
+ *
509
+ * \since This function is available since SDL 2.24.0.
510
+ */
511
+ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetFirmwareVersion(SDL_GameController *gamecontroller);
512
+
460
513
  /**
461
514
  * Get the serial number of an opened controller, if available.
462
515
  *
@@ -701,7 +754,7 @@ extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFrom
701
754
  * The caller should not SDL_free() the returned string.
702
755
  *
703
756
  * \param button an enum value for a given SDL_GameControllerButton
704
- * \returns a string for the given button, or NULL if an invalid axis is
757
+ * \returns a string for the given button, or NULL if an invalid button is
705
758
  * specified. The string returned is of the format used by
706
759
  * SDL_GameController mapping strings.
707
760
  *
@@ -842,6 +895,25 @@ extern DECLSPEC float SDLCALL SDL_GameControllerGetSensorDataRate(SDL_GameContro
842
895
  */
843
896
  extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
844
897
 
898
+ /**
899
+ * Get the current state of a game controller sensor with the timestamp of the
900
+ * last update.
901
+ *
902
+ * The number of values and interpretation of the data is sensor dependent.
903
+ * See SDL_sensor.h for the details for each type of sensor.
904
+ *
905
+ * \param gamecontroller The controller to query
906
+ * \param type The type of sensor to query
907
+ * \param timestamp A pointer filled with the timestamp in microseconds of the
908
+ * current sensor reading if available, or 0 if not
909
+ * \param data A pointer filled with the current sensor state
910
+ * \param num_values The number of values to write to data
911
+ * \return 0 or -1 if an error occurred.
912
+ *
913
+ * \since This function is available since SDL 2.26.0.
914
+ */
915
+ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorDataWithTimestamp(SDL_GameController *gamecontroller, SDL_SensorType type, Uint64 *timestamp, float *data, int num_values);
916
+
845
917
  /**
846
918
  * Start a rumble effect on a game controller.
847
919
  *
@@ -869,8 +941,9 @@ extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecon
869
941
  * calling it with 0 intensity stops any rumbling.
870
942
  *
871
943
  * Note that this is rumbling of the _triggers_ and not the game controller as
872
- * a whole. The first controller to offer this feature was the PlayStation 5's
873
- * DualShock 5.
944
+ * a whole. This is currently only supported on Xbox One controllers. If you
945
+ * want the (more common) whole-controller rumble, use
946
+ * SDL_GameControllerRumble() instead.
874
947
  *
875
948
  * \param gamecontroller The controller to vibrate
876
949
  * \param left_rumble The intensity of the left trigger rumble motor, from 0
@@ -0,0 +1,100 @@
1
+ /*
2
+ Simple DirectMedia Layer
3
+ Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
4
+
5
+ This software is provided 'as-is', without any express or implied
6
+ warranty. In no event will the authors be held liable for any damages
7
+ arising from the use of this software.
8
+
9
+ Permission is granted to anyone to use this software for any purpose,
10
+ including commercial applications, and to alter it and redistribute it
11
+ freely, subject to the following restrictions:
12
+
13
+ 1. The origin of this software must not be misrepresented; you must not
14
+ claim that you wrote the original software. If you use this software
15
+ in a product, an acknowledgment in the product documentation would be
16
+ appreciated but is not required.
17
+ 2. Altered source versions must be plainly marked as such, and must not be
18
+ misrepresented as being the original software.
19
+ 3. This notice may not be removed or altered from any source distribution.
20
+ */
21
+
22
+ /**
23
+ * \file SDL_guid.h
24
+ *
25
+ * Include file for handling ::SDL_GUID values.
26
+ */
27
+
28
+ #ifndef SDL_guid_h_
29
+ #define SDL_guid_h_
30
+
31
+ #include "SDL_stdinc.h"
32
+ #include "SDL_error.h"
33
+
34
+ #include "begin_code.h"
35
+ /* Set up for C function definitions, even when using C++ */
36
+ #ifdef __cplusplus
37
+ extern "C" {
38
+ #endif
39
+
40
+ /**
41
+ * An SDL_GUID is a 128-bit identifier for an input device that
42
+ * identifies that device across runs of SDL programs on the same
43
+ * platform. If the device is detached and then re-attached to a
44
+ * different port, or if the base system is rebooted, the device
45
+ * should still report the same GUID.
46
+ *
47
+ * GUIDs are as precise as possible but are not guaranteed to
48
+ * distinguish physically distinct but equivalent devices. For
49
+ * example, two game controllers from the same vendor with the same
50
+ * product ID and revision may have the same GUID.
51
+ *
52
+ * GUIDs may be platform-dependent (i.e., the same device may report
53
+ * different GUIDs on different operating systems).
54
+ */
55
+ typedef struct {
56
+ Uint8 data[16];
57
+ } SDL_GUID;
58
+
59
+ /* Function prototypes */
60
+
61
+ /**
62
+ * Get an ASCII string representation for a given ::SDL_GUID.
63
+ *
64
+ * You should supply at least 33 bytes for pszGUID.
65
+ *
66
+ * \param guid the ::SDL_GUID you wish to convert to string
67
+ * \param pszGUID buffer in which to write the ASCII string
68
+ * \param cbGUID the size of pszGUID
69
+ *
70
+ * \since This function is available since SDL 2.24.0.
71
+ *
72
+ * \sa SDL_GUIDFromString
73
+ */
74
+ extern DECLSPEC void SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID);
75
+
76
+ /**
77
+ * Convert a GUID string into a ::SDL_GUID structure.
78
+ *
79
+ * Performs no error checking. If this function is given a string containing
80
+ * an invalid GUID, the function will silently succeed, but the GUID generated
81
+ * will not be useful.
82
+ *
83
+ * \param pchGUID string containing an ASCII representation of a GUID
84
+ * \returns a ::SDL_GUID structure.
85
+ *
86
+ * \since This function is available since SDL 2.24.0.
87
+ *
88
+ * \sa SDL_GUIDToString
89
+ */
90
+ extern DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID);
91
+
92
+ /* Ends C function definitions when using C++ */
93
+ #ifdef __cplusplus
94
+ }
95
+ #endif
96
+ #include "close_code.h"
97
+
98
+ #endif /* SDL_guid_h_ */
99
+
100
+ /* vi: set ts=4 sw=4 expandtab: */