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
@@ -43,6 +43,7 @@
43
43
 
44
44
  #include "SDL_stdinc.h"
45
45
  #include "SDL_error.h"
46
+ #include "SDL_guid.h"
46
47
 
47
48
  #include "begin_code.h"
48
49
  /* Set up for C function definitions, even when using C++ */
@@ -69,9 +70,7 @@ struct _SDL_Joystick;
69
70
  typedef struct _SDL_Joystick SDL_Joystick;
70
71
 
71
72
  /* A structure that encodes the stable unique id for a joystick device */
72
- typedef struct {
73
- Uint8 data[16];
74
- } SDL_JoystickGUID;
73
+ typedef SDL_GUID SDL_JoystickGUID;
75
74
 
76
75
  /**
77
76
  * This is a unique ID for a joystick for the time it is connected to the system,
@@ -125,6 +124,11 @@ typedef enum
125
124
  * the API functions that take a joystick index will be valid, and joystick
126
125
  * and game controller events will not be delivered.
127
126
  *
127
+ * As of SDL 2.26.0, you can take the joystick lock around reinitializing the
128
+ * joystick subsystem, to prevent other threads from seeing joysticks in an
129
+ * uninitialized state. However, all open joysticks will be closed and SDL
130
+ * functions called with them will fail.
131
+ *
128
132
  * \since This function is available since SDL 2.0.7.
129
133
  */
130
134
  extern DECLSPEC void SDLCALL SDL_LockJoysticks(void);
@@ -153,6 +157,7 @@ extern DECLSPEC void SDLCALL SDL_UnlockJoysticks(void);
153
157
  * \since This function is available since SDL 2.0.0.
154
158
  *
155
159
  * \sa SDL_JoystickName
160
+ * \sa SDL_JoystickPath
156
161
  * \sa SDL_JoystickOpen
157
162
  */
158
163
  extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
@@ -174,6 +179,23 @@ extern DECLSPEC int SDLCALL SDL_NumJoysticks(void);
174
179
  */
175
180
  extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index);
176
181
 
182
+ /**
183
+ * Get the implementation dependent path of a joystick.
184
+ *
185
+ * This can be called before any joysticks are opened.
186
+ *
187
+ * \param device_index the index of the joystick to query (the N'th joystick
188
+ * on the system)
189
+ * \returns the path of the selected joystick. If no path can be found, this
190
+ * function returns NULL; call SDL_GetError() for more information.
191
+ *
192
+ * \since This function is available since SDL 2.24.0.
193
+ *
194
+ * \sa SDL_JoystickPath
195
+ * \sa SDL_JoystickOpen
196
+ */
197
+ extern DECLSPEC const char *SDLCALL SDL_JoystickPathForIndex(int device_index);
198
+
177
199
  /**
178
200
  * Get the player index of a joystick, or -1 if it's not available This can be
179
201
  * called before any joysticks are opened.
@@ -330,6 +352,54 @@ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtual(SDL_JoystickType type,
330
352
  int nbuttons,
331
353
  int nhats);
332
354
 
355
+ /**
356
+ * The structure that defines an extended virtual joystick description
357
+ *
358
+ * The caller must zero the structure and then initialize the version with `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` before passing it to SDL_JoystickAttachVirtualEx()
359
+ * All other elements of this structure are optional and can be left 0.
360
+ *
361
+ * \sa SDL_JoystickAttachVirtualEx
362
+ */
363
+ typedef struct SDL_VirtualJoystickDesc
364
+ {
365
+ Uint16 version; /**< `SDL_VIRTUAL_JOYSTICK_DESC_VERSION` */
366
+ Uint16 type; /**< `SDL_JoystickType` */
367
+ Uint16 naxes; /**< the number of axes on this joystick */
368
+ Uint16 nbuttons; /**< the number of buttons on this joystick */
369
+ Uint16 nhats; /**< the number of hats on this joystick */
370
+ Uint16 vendor_id; /**< the USB vendor ID of this joystick */
371
+ Uint16 product_id; /**< the USB product ID of this joystick */
372
+ Uint16 padding; /**< unused */
373
+ Uint32 button_mask; /**< A mask of which buttons are valid for this controller
374
+ e.g. (1 << SDL_CONTROLLER_BUTTON_A) */
375
+ Uint32 axis_mask; /**< A mask of which axes are valid for this controller
376
+ e.g. (1 << SDL_CONTROLLER_AXIS_LEFTX) */
377
+ const char *name; /**< the name of the joystick */
378
+
379
+ void *userdata; /**< User data pointer passed to callbacks */
380
+ void (SDLCALL *Update)(void *userdata); /**< Called when the joystick state should be updated */
381
+ void (SDLCALL *SetPlayerIndex)(void *userdata, int player_index); /**< Called when the player index is set */
382
+ int (SDLCALL *Rumble)(void *userdata, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble); /**< Implements SDL_JoystickRumble() */
383
+ int (SDLCALL *RumbleTriggers)(void *userdata, Uint16 left_rumble, Uint16 right_rumble); /**< Implements SDL_JoystickRumbleTriggers() */
384
+ int (SDLCALL *SetLED)(void *userdata, Uint8 red, Uint8 green, Uint8 blue); /**< Implements SDL_JoystickSetLED() */
385
+ int (SDLCALL *SendEffect)(void *userdata, const void *data, int size); /**< Implements SDL_JoystickSendEffect() */
386
+
387
+ } SDL_VirtualJoystickDesc;
388
+
389
+ /**
390
+ * \brief The current version of the SDL_VirtualJoystickDesc structure
391
+ */
392
+ #define SDL_VIRTUAL_JOYSTICK_DESC_VERSION 1
393
+
394
+ /**
395
+ * Attach a new virtual joystick with extended properties.
396
+ *
397
+ * \returns the joystick's device index, or -1 if an error occurred.
398
+ *
399
+ * \since This function is available since SDL 2.24.0.
400
+ */
401
+ extern DECLSPEC int SDLCALL SDL_JoystickAttachVirtualEx(const SDL_VirtualJoystickDesc *desc);
402
+
333
403
  /**
334
404
  * Detach a virtual joystick.
335
405
  *
@@ -360,6 +430,10 @@ extern DECLSPEC SDL_bool SDLCALL SDL_JoystickIsVirtual(int device_index);
360
430
  * the following: SDL_PollEvent, SDL_PumpEvents, SDL_WaitEventTimeout,
361
431
  * SDL_WaitEvent.
362
432
  *
433
+ * Note that when sending trigger axes, you should scale the value to the full
434
+ * range of Sint16. For example, a trigger at rest would have the value of
435
+ * `SDL_JOYSTICK_AXIS_MIN`.
436
+ *
363
437
  * \param joystick the virtual joystick on which to set state.
364
438
  * \param axis the specific axis on the virtual joystick to set.
365
439
  * \param value the new value for the specified axis.
@@ -419,6 +493,19 @@ extern DECLSPEC int SDLCALL SDL_JoystickSetVirtualHat(SDL_Joystick *joystick, in
419
493
  */
420
494
  extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick *joystick);
421
495
 
496
+ /**
497
+ * Get the implementation dependent path of a joystick.
498
+ *
499
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
500
+ * \returns the path of the selected joystick. If no path can be found, this
501
+ * function returns NULL; call SDL_GetError() for more information.
502
+ *
503
+ * \since This function is available since SDL 2.24.0.
504
+ *
505
+ * \sa SDL_JoystickPathForIndex
506
+ */
507
+ extern DECLSPEC const char *SDLCALL SDL_JoystickPath(SDL_Joystick *joystick);
508
+
422
509
  /**
423
510
  * Get the player index of an opened joystick.
424
511
  *
@@ -436,7 +523,8 @@ extern DECLSPEC int SDLCALL SDL_JoystickGetPlayerIndex(SDL_Joystick *joystick);
436
523
  * Set the player index of an opened joystick.
437
524
  *
438
525
  * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
439
- * \param player_index the player index to set.
526
+ * \param player_index Player index to assign to this joystick, or -1 to clear
527
+ * the player index and turn off player LEDs.
440
528
  *
441
529
  * \since This function is available since SDL 2.0.12.
442
530
  */
@@ -495,6 +583,19 @@ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProduct(SDL_Joystick *joystick);
495
583
  */
496
584
  extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetProductVersion(SDL_Joystick *joystick);
497
585
 
586
+ /**
587
+ * Get the firmware version of an opened joystick, if available.
588
+ *
589
+ * If the firmware version isn't available this function returns 0.
590
+ *
591
+ * \param joystick the SDL_Joystick obtained from SDL_JoystickOpen()
592
+ * \returns the firmware version of the selected joystick, or 0 if
593
+ * unavailable.
594
+ *
595
+ * \since This function is available since SDL 2.24.0.
596
+ */
597
+ extern DECLSPEC Uint16 SDLCALL SDL_JoystickGetFirmwareVersion(SDL_Joystick *joystick);
598
+
498
599
  /**
499
600
  * Get the serial number of an opened joystick, if available.
500
601
  *
@@ -551,6 +652,25 @@ extern DECLSPEC void SDLCALL SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, ch
551
652
  */
552
653
  extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID);
553
654
 
655
+ /**
656
+ * Get the device information encoded in a SDL_JoystickGUID structure
657
+ *
658
+ * \param guid the SDL_JoystickGUID you wish to get info about
659
+ * \param vendor A pointer filled in with the device VID, or 0 if not
660
+ * available
661
+ * \param product A pointer filled in with the device PID, or 0 if not
662
+ * available
663
+ * \param version A pointer filled in with the device version, or 0 if not
664
+ * available
665
+ * \param crc16 A pointer filled in with a CRC used to distinguish different
666
+ * products with the same VID/PID, or 0 if not available
667
+ *
668
+ * \since This function is available since SDL 2.26.0.
669
+ *
670
+ * \sa SDL_JoystickGetDeviceGUID
671
+ */
672
+ extern DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
673
+
554
674
  /**
555
675
  * Get the status of a specified joystick.
556
676
  *
@@ -829,9 +949,9 @@ extern DECLSPEC int SDLCALL SDL_JoystickRumble(SDL_Joystick *joystick, Uint16 lo
829
949
  * Each call to this function cancels any previous trigger rumble effect, and
830
950
  * calling it with 0 intensity stops any rumbling.
831
951
  *
832
- * Note that this function is for _trigger_ rumble; the first joystick to
833
- * support this was the PlayStation 5's DualShock 5 controller. If you want
834
- * the (more common) whole-controller rumble, use SDL_JoystickRumble()
952
+ * Note that this is rumbling of the _triggers_ and not the game controller as
953
+ * a whole. This is currently only supported on Xbox One controllers. If you
954
+ * want the (more common) whole-controller rumble, use SDL_JoystickRumble()
835
955
  * instead.
836
956
  *
837
957
  * \param joystick The joystick to vibrate
@@ -90,9 +90,21 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
90
90
  * \since This function is available since SDL 2.0.0.
91
91
  *
92
92
  * \sa SDL_PumpEvents
93
+ * \sa SDL_ResetKeyboard
93
94
  */
94
95
  extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
95
96
 
97
+ /**
98
+ * Clear the state of the keyboard
99
+ *
100
+ * This function will generate key up events for all pressed keys.
101
+ *
102
+ * \since This function is available since SDL 2.24.0.
103
+ *
104
+ * \sa SDL_GetKeyboardState
105
+ */
106
+ extern DECLSPEC void SDLCALL SDL_ResetKeyboard(void);
107
+
96
108
  /**
97
109
  * Get the current key modifier state for the keyboard.
98
110
  *
@@ -268,9 +280,34 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void);
268
280
  */
269
281
  extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
270
282
 
283
+ /**
284
+ * Dismiss the composition window/IME without disabling the subsystem.
285
+ *
286
+ * \since This function is available since SDL 2.0.22.
287
+ *
288
+ * \sa SDL_StartTextInput
289
+ * \sa SDL_StopTextInput
290
+ */
291
+ extern DECLSPEC void SDLCALL SDL_ClearComposition(void);
292
+
293
+ /**
294
+ * Returns if an IME Composite or Candidate window is currently shown.
295
+ *
296
+ * \since This function is available since SDL 2.0.22.
297
+ */
298
+ extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputShown(void);
299
+
271
300
  /**
272
301
  * Set the rectangle used to type Unicode text inputs.
273
302
  *
303
+ * To start text input in a given location, this function is intended to be
304
+ * called before SDL_StartTextInput, although some platforms support moving
305
+ * the rectangle even while text input (and a composition) is active.
306
+ *
307
+ * Note: If you want to use the system native IME window, try setting hint
308
+ * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you
309
+ * any feedback.
310
+ *
274
311
  * \param rect the SDL_Rect structure representing the rectangle to receive
275
312
  * text (ignored if NULL)
276
313
  *
@@ -278,7 +315,7 @@ extern DECLSPEC void SDLCALL SDL_StopTextInput(void);
278
315
  *
279
316
  * \sa SDL_StartTextInput
280
317
  */
281
- extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect);
318
+ extern DECLSPEC void SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect);
282
319
 
283
320
  /**
284
321
  * Check whether the platform has screen keyboard support.
@@ -318,7 +318,12 @@ typedef enum
318
318
  SDLK_APP2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2),
319
319
 
320
320
  SDLK_AUDIOREWIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND),
321
- SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD)
321
+ SDLK_AUDIOFASTFORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD),
322
+
323
+ SDLK_SOFTLEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT),
324
+ SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
325
+ SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
326
+ SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
322
327
  } SDL_KeyCode;
323
328
 
324
329
  /**
@@ -47,9 +47,9 @@ extern "C" {
47
47
 
48
48
 
49
49
  /**
50
- * \brief The maximum size of a log message
50
+ * \brief The maximum size of a log message prior to SDL 2.0.24
51
51
  *
52
- * Messages longer than the maximum size will be truncated
52
+ * As of 2.0.24 there is no limit to the length of SDL log messages.
53
53
  */
54
54
  #define SDL_MAX_LOG_MESSAGE 4096
55
55
 
@@ -51,6 +51,15 @@
51
51
  */
52
52
  #define SDL_MAIN_NEEDED
53
53
 
54
+ #elif defined(__GDK__)
55
+ /* On GDK, SDL provides a main function that initializes the game runtime.
56
+
57
+ Please note that #include'ing SDL_main.h is not enough to get a main()
58
+ function working. You must either link against SDL2main or, if not possible,
59
+ call the SDL_GDKRunApp function from your entry point.
60
+ */
61
+ #define SDL_MAIN_NEEDED
62
+
54
63
  #elif defined(__IPHONEOS__)
55
64
  /* On iOS SDL provides a main function that creates an application delegate
56
65
  and starts the iOS application run loop.
@@ -92,6 +101,22 @@
92
101
  */
93
102
  #define SDL_MAIN_AVAILABLE
94
103
 
104
+ #elif defined(__PS2__)
105
+ #define SDL_MAIN_AVAILABLE
106
+
107
+ #define SDL_PS2_SKIP_IOP_RESET() \
108
+ void reset_IOP(); \
109
+ void reset_IOP() {}
110
+
111
+ #elif defined(__3DS__)
112
+ /*
113
+ On N3DS, SDL provides a main function that sets up the screens
114
+ and storage.
115
+
116
+ If you provide this yourself, you may define SDL_MAIN_HANDLED
117
+ */
118
+ #define SDL_MAIN_AVAILABLE
119
+
95
120
  #endif
96
121
  #endif /* SDL_MAIN_HANDLED */
97
122
 
@@ -145,7 +170,7 @@ extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
145
170
  */
146
171
  extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
147
172
 
148
- #ifdef __WIN32__
173
+ #if defined(__WIN32__) || defined(__GDK__)
149
174
 
150
175
  /**
151
176
  * Register a win32 window class for SDL's use.
@@ -189,7 +214,7 @@ extern DECLSPEC int SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void
189
214
  */
190
215
  extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
191
216
 
192
- #endif /* __WIN32__ */
217
+ #endif /* defined(__WIN32__) || defined(__GDK__) */
193
218
 
194
219
 
195
220
  #ifdef __WINRT__
@@ -224,6 +249,21 @@ extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_fun
224
249
 
225
250
  #endif /* __IPHONEOS__ */
226
251
 
252
+ #ifdef __GDK__
253
+
254
+ /**
255
+ * Initialize and launch an SDL GDK application.
256
+ *
257
+ * \param mainFunction the SDL app's C-style main(), an SDL_main_func
258
+ * \param reserved reserved for future use; should be NULL
259
+ * \returns 0 on success or -1 on failure; call SDL_GetError() to retrieve
260
+ * more information on the failure.
261
+ *
262
+ * \since This function is available since SDL 2.24.0.
263
+ */
264
+ extern DECLSPEC int SDLCALL SDL_GDKRunApp(SDL_main_func mainFunction, void *reserved);
265
+
266
+ #endif /* __GDK__ */
227
267
 
228
268
  #ifdef __cplusplus
229
269
  }
@@ -82,7 +82,7 @@ extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view);
82
82
  *
83
83
  * \since This function is available since SDL 2.0.14.
84
84
  *
85
- * \sa SDL_MetalCreateView
85
+ * \sa SDL_Metal_CreateView
86
86
  */
87
87
  extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
88
88
 
@@ -92,6 +92,7 @@ extern DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view);
92
92
  *
93
93
  * \param window SDL_Window from which the drawable size should be queried
94
94
  * \param w Pointer to variable for storing the width in pixels, may be NULL
95
+ * \param h Pointer to variable for storing the height in pixels, may be NULL
95
96
  *
96
97
  * \since This function is available since SDL 2.0.14.
97
98
  *
@@ -154,7 +154,9 @@ extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y);
154
154
  /**
155
155
  * Move the mouse cursor to the given position within the window.
156
156
  *
157
- * This function generates a mouse motion event.
157
+ * This function generates a mouse motion event if relative mode is not
158
+ * enabled. If relative mode is enabled, you can force mouse events for the
159
+ * warp by setting the SDL_HINT_MOUSE_RELATIVE_WARP_MOTION hint.
158
160
  *
159
161
  * Note that this function will appear to succeed, but not actually move the
160
162
  * mouse when used over Microsoft Remote Desktop.
@@ -245,6 +247,15 @@ extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled);
245
247
  * While capturing is enabled, the current window will have the
246
248
  * `SDL_WINDOW_MOUSE_CAPTURE` flag set.
247
249
  *
250
+ * Please note that as of SDL 2.0.22, SDL will attempt to "auto capture" the
251
+ * mouse while the user is pressing a button; this is to try and make mouse
252
+ * behavior more consistent between platforms, and deal with the common case
253
+ * of a user dragging the mouse outside of the window. This means that if you
254
+ * are calling SDL_CaptureMouse() only to deal with this situation, you no
255
+ * longer have to (although it is safe to do so). If this causes problems for
256
+ * your app, you can disable auto capture by setting the
257
+ * `SDL_HINT_MOUSE_AUTO_CAPTURE` hint to zero.
258
+ *
248
259
  * \param enabled SDL_TRUE to enable capturing, SDL_FALSE to disable.
249
260
  * \returns 0 on success or -1 if not supported; call SDL_GetError() for more
250
261
  * information.
@@ -2107,57 +2107,6 @@ typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLsh
2107
2107
 
2108
2108
 
2109
2109
 
2110
- /*
2111
- * ???. GL_MESA_packed_depth_stencil
2112
- * XXX obsolete
2113
- */
2114
- #ifndef GL_MESA_packed_depth_stencil
2115
- #define GL_MESA_packed_depth_stencil 1
2116
-
2117
- #define GL_DEPTH_STENCIL_MESA 0x8750
2118
- #define GL_UNSIGNED_INT_24_8_MESA 0x8751
2119
- #define GL_UNSIGNED_INT_8_24_REV_MESA 0x8752
2120
- #define GL_UNSIGNED_SHORT_15_1_MESA 0x8753
2121
- #define GL_UNSIGNED_SHORT_1_15_REV_MESA 0x8754
2122
-
2123
- #endif /* GL_MESA_packed_depth_stencil */
2124
-
2125
-
2126
- #ifndef GL_ATI_blend_equation_separate
2127
- #define GL_ATI_blend_equation_separate 1
2128
-
2129
- #define GL_ALPHA_BLEND_EQUATION_ATI 0x883D
2130
-
2131
- GLAPI void GLAPIENTRY glBlendEquationSeparateATI( GLenum modeRGB, GLenum modeA );
2132
- typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEATIPROC) (GLenum modeRGB, GLenum modeA);
2133
-
2134
- #endif /* GL_ATI_blend_equation_separate */
2135
-
2136
-
2137
- /* GL_OES_EGL_image */
2138
- #ifndef GL_OES_EGL_image
2139
- typedef void* GLeglImageOES;
2140
- #endif
2141
-
2142
- #ifndef GL_OES_EGL_image
2143
- #define GL_OES_EGL_image 1
2144
- #ifdef GL_GLEXT_PROTOTYPES
2145
- GLAPI void APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
2146
- GLAPI void APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
2147
- #endif
2148
- typedef void (APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
2149
- typedef void (APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
2150
- #endif
2151
-
2152
-
2153
- /**
2154
- ** NOTE!!!!! If you add new functions to this file, or update
2155
- ** glext.h be sure to regenerate the gl_mangle.h file. See comments
2156
- ** in that file for details.
2157
- **/
2158
-
2159
-
2160
-
2161
2110
  /**********************************************************************
2162
2111
  * Begin system-specific stuff
2163
2112
  */