ruby2d 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. checksums.yaml +4 -4
  2. data/assets/README.md +7 -8
  3. data/assets/Rakefile +85 -0
  4. data/assets/include/SDL2/SDL.h +4 -1
  5. data/assets/include/SDL2/SDL_assert.h +3 -1
  6. data/assets/include/SDL2/SDL_atomic.h +20 -2
  7. data/assets/include/SDL2/SDL_audio.h +47 -14
  8. data/assets/include/SDL2/SDL_bits.h +10 -1
  9. data/assets/include/SDL2/SDL_blendmode.h +10 -7
  10. data/assets/include/SDL2/SDL_clipboard.h +1 -1
  11. data/assets/include/SDL2/SDL_config.h +24 -390
  12. data/assets/include/SDL2/SDL_config_android.h +182 -0
  13. data/assets/include/SDL2/SDL_config_iphoneos.h +207 -0
  14. data/assets/include/SDL2/SDL_config_macosx.h +266 -0
  15. data/assets/include/SDL2/SDL_config_minimal.h +85 -0
  16. data/assets/include/SDL2/SDL_config_os2.h +188 -0
  17. data/assets/include/SDL2/SDL_config_pandora.h +135 -0
  18. data/assets/include/SDL2/SDL_config_psp.h +165 -0
  19. data/assets/include/SDL2/SDL_config_windows.h +288 -0
  20. data/assets/include/SDL2/SDL_config_winrt.h +243 -0
  21. data/assets/include/SDL2/SDL_config_wiz.h +149 -0
  22. data/assets/include/SDL2/SDL_copying.h +20 -0
  23. data/assets/include/SDL2/SDL_cpuinfo.h +119 -8
  24. data/assets/include/SDL2/SDL_egl.h +4 -1
  25. data/assets/include/SDL2/SDL_endian.h +6 -3
  26. data/assets/include/SDL2/SDL_error.h +38 -2
  27. data/assets/include/SDL2/SDL_events.h +67 -28
  28. data/assets/include/SDL2/SDL_filesystem.h +1 -1
  29. data/assets/include/SDL2/SDL_gamecontroller.h +160 -9
  30. data/assets/include/SDL2/SDL_gesture.h +1 -1
  31. data/assets/include/SDL2/SDL_haptic.h +10 -1
  32. data/assets/include/SDL2/SDL_hints.h +460 -17
  33. data/assets/include/SDL2/SDL_image.h +2 -2
  34. data/assets/include/SDL2/SDL_joystick.h +115 -24
  35. data/assets/include/SDL2/SDL_keyboard.h +1 -1
  36. data/assets/include/SDL2/SDL_keycode.h +11 -9
  37. data/assets/include/SDL2/SDL_loadso.h +1 -1
  38. data/assets/include/SDL2/SDL_locale.h +101 -0
  39. data/assets/include/SDL2/SDL_log.h +3 -3
  40. data/assets/include/SDL2/SDL_main.h +28 -16
  41. data/assets/include/SDL2/SDL_messagebox.h +6 -4
  42. data/assets/include/SDL2/SDL_metal.h +117 -0
  43. data/assets/include/SDL2/SDL_misc.h +75 -0
  44. data/assets/include/SDL2/SDL_mouse.h +1 -1
  45. data/assets/include/SDL2/SDL_mutex.h +1 -1
  46. data/assets/include/SDL2/SDL_name.h +1 -1
  47. data/assets/include/SDL2/SDL_opengl.h +1 -1
  48. data/assets/include/SDL2/SDL_opengl_glext.h +3 -0
  49. data/assets/include/SDL2/SDL_opengles.h +1 -1
  50. data/assets/include/SDL2/SDL_opengles2.h +1 -1
  51. data/assets/include/SDL2/SDL_pixels.h +27 -18
  52. data/assets/include/SDL2/SDL_platform.h +1 -1
  53. data/assets/include/SDL2/SDL_power.h +1 -1
  54. data/assets/include/SDL2/SDL_quit.h +1 -1
  55. data/assets/include/SDL2/SDL_rect.h +29 -3
  56. data/assets/include/SDL2/SDL_render.h +230 -3
  57. data/assets/include/SDL2/SDL_revision.h +2 -2
  58. data/assets/include/SDL2/SDL_rwops.h +51 -22
  59. data/assets/include/SDL2/SDL_scancode.h +2 -2
  60. data/assets/include/SDL2/SDL_sensor.h +28 -12
  61. data/assets/include/SDL2/SDL_shape.h +1 -1
  62. data/assets/include/SDL2/SDL_stdinc.h +44 -4
  63. data/assets/include/SDL2/SDL_surface.h +12 -2
  64. data/assets/include/SDL2/SDL_system.h +50 -4
  65. data/assets/include/SDL2/SDL_syswm.h +39 -9
  66. data/assets/include/SDL2/SDL_test.h +1 -1
  67. data/assets/include/SDL2/SDL_test_assert.h +1 -1
  68. data/assets/include/SDL2/SDL_test_common.h +32 -2
  69. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  70. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  71. data/assets/include/SDL2/SDL_test_font.h +1 -1
  72. data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
  73. data/assets/include/SDL2/SDL_test_harness.h +1 -1
  74. data/assets/include/SDL2/SDL_test_images.h +1 -1
  75. data/assets/include/SDL2/SDL_test_log.h +1 -1
  76. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  77. data/assets/include/SDL2/SDL_test_memory.h +3 -3
  78. data/assets/include/SDL2/SDL_test_random.h +1 -1
  79. data/assets/include/SDL2/SDL_thread.h +34 -11
  80. data/assets/include/SDL2/SDL_timer.h +1 -1
  81. data/assets/include/SDL2/SDL_touch.h +17 -1
  82. data/assets/include/SDL2/SDL_types.h +1 -1
  83. data/assets/include/SDL2/SDL_version.h +2 -2
  84. data/assets/include/SDL2/SDL_video.h +11 -5
  85. data/assets/include/SDL2/SDL_vulkan.h +9 -11
  86. data/assets/include/SDL2/begin_code.h +8 -9
  87. data/assets/include/SDL2/close_code.h +4 -1
  88. data/assets/macos/lib/libFLAC.a +0 -0
  89. data/assets/macos/lib/libSDL2.a +0 -0
  90. data/assets/macos/lib/libSDL2_image.a +0 -0
  91. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  92. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  93. data/assets/macos/lib/libfreetype.a +0 -0
  94. data/assets/macos/lib/libjpeg.a +0 -0
  95. data/assets/macos/lib/libmpg123.a +0 -0
  96. data/assets/macos/lib/libogg.a +0 -0
  97. data/assets/macos/lib/libpng16.a +0 -0
  98. data/assets/macos/lib/libtiff.a +0 -0
  99. data/assets/macos/lib/libvorbis.a +0 -0
  100. data/assets/macos/lib/libvorbisfile.a +0 -0
  101. data/assets/macos/lib/libwebp.a +0 -0
  102. data/assets/mingw/bin/SDL2.dll +0 -0
  103. data/assets/mingw/bin/SDL2_image.dll +0 -0
  104. data/assets/mingw/bin/libpng16-16.dll +0 -0
  105. data/assets/mingw/bin/libtiff-5.dll +0 -0
  106. data/assets/mingw/bin/libwebp-7.dll +0 -0
  107. data/assets/mingw/lib/libSDL2.a +0 -0
  108. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  109. data/assets/mingw/lib/libSDL2_image.a +0 -0
  110. data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
  111. data/assets/mingw/lib/libSDL2_test.a +0 -0
  112. data/assets/mingw/lib/libSDL2main.a +0 -0
  113. data/bin/ruby2d +2 -1
  114. data/{assets/linux/simple2d/src/simple2d.c → ext/ruby2d/common.c} +32 -32
  115. data/{assets/linux/simple2d/src → ext/ruby2d}/controllers.c +17 -17
  116. data/ext/ruby2d/extconf.rb +6 -36
  117. data/{assets/linux/simple2d/src → ext/ruby2d}/gl.c +106 -85
  118. data/{assets/linux/simple2d/src → ext/ruby2d}/gl2.c +35 -20
  119. data/{assets/linux/simple2d/src → ext/ruby2d}/gl3.c +146 -58
  120. data/{assets/linux/simple2d/src → ext/ruby2d}/gles.c +41 -26
  121. data/{assets/linux/simple2d/src → ext/ruby2d}/image.c +16 -16
  122. data/{assets/linux/simple2d/src → ext/ruby2d}/input.c +8 -8
  123. data/{assets/linux/simple2d/src → ext/ruby2d}/music.c +30 -17
  124. data/ext/ruby2d/ruby2d.c +427 -290
  125. data/ext/ruby2d/ruby2d.h +789 -0
  126. data/{assets/linux/simple2d/src → ext/ruby2d}/shapes.c +18 -18
  127. data/ext/ruby2d/sound.c +118 -0
  128. data/{assets/linux/simple2d/src → ext/ruby2d}/sprite.c +16 -16
  129. data/{assets/linux/simple2d/src → ext/ruby2d}/text.c +22 -22
  130. data/ext/ruby2d/tileset.c +30 -0
  131. data/{assets/linux/simple2d/src → ext/ruby2d}/window.c +71 -60
  132. data/lib/ruby2d.rb +5 -2
  133. data/lib/ruby2d/circle.rb +18 -2
  134. data/lib/ruby2d/cli/build.rb +3 -8
  135. data/lib/ruby2d/cli/colorize.rb +10 -0
  136. data/lib/ruby2d/dsl.rb +16 -9
  137. data/lib/ruby2d/entity.rb +17 -0
  138. data/lib/ruby2d/font.rb +4 -3
  139. data/lib/ruby2d/image.rb +24 -1
  140. data/lib/ruby2d/line.rb +20 -0
  141. data/lib/ruby2d/music.rb +5 -0
  142. data/lib/ruby2d/pixel.rb +17 -0
  143. data/lib/ruby2d/quad.rb +18 -0
  144. data/lib/ruby2d/rectangle.rb +11 -2
  145. data/lib/ruby2d/renderable.rb +4 -8
  146. data/lib/ruby2d/sound.rb +5 -0
  147. data/lib/ruby2d/sprite.rb +35 -3
  148. data/lib/ruby2d/square.rb +9 -0
  149. data/lib/ruby2d/text.rb +22 -1
  150. data/lib/ruby2d/tileset.rb +69 -0
  151. data/lib/ruby2d/triangle.rb +16 -0
  152. data/lib/ruby2d/version.rb +1 -1
  153. data/lib/ruby2d/window.rb +249 -22
  154. metadata +41 -27
  155. data/assets/include/simple2d.h +0 -735
  156. data/assets/linux/simple2d/Makefile +0 -250
  157. data/assets/linux/simple2d/bin/simple2d.sh +0 -1249
  158. data/assets/linux/simple2d/include/simple2d.h +0 -735
  159. data/assets/linux/simple2d/src/sound.c +0 -56
  160. data/assets/macos/lib/libsimple2d.a +0 -0
  161. data/assets/mingw/lib/libsimple2d.a +0 -0
  162. data/lib/ruby2d/colorize.rb +0 -10
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2020 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-2018 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2020 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
@@ -31,6 +31,7 @@
31
31
  #include "SDL_stdinc.h"
32
32
  #include "SDL_error.h"
33
33
  #include "SDL_rwops.h"
34
+ #include "SDL_sensor.h"
34
35
  #include "SDL_joystick.h"
35
36
 
36
37
  #include "begin_code.h"
@@ -57,6 +58,17 @@ extern "C" {
57
58
  struct _SDL_GameController;
58
59
  typedef struct _SDL_GameController SDL_GameController;
59
60
 
61
+ typedef enum
62
+ {
63
+ SDL_CONTROLLER_TYPE_UNKNOWN = 0,
64
+ SDL_CONTROLLER_TYPE_XBOX360,
65
+ SDL_CONTROLLER_TYPE_XBOXONE,
66
+ SDL_CONTROLLER_TYPE_PS3,
67
+ SDL_CONTROLLER_TYPE_PS4,
68
+ SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO,
69
+ SDL_CONTROLLER_TYPE_VIRTUAL,
70
+ SDL_CONTROLLER_TYPE_PS5
71
+ } SDL_GameControllerType;
60
72
 
61
73
  typedef enum
62
74
  {
@@ -161,7 +173,7 @@ extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID(SDL_JoystickGUID
161
173
  *
162
174
  * \return the mapping string. Must be freed with SDL_free(). Returns NULL if no mapping is available
163
175
  */
164
- extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController * gamecontroller);
176
+ extern DECLSPEC char * SDLCALL SDL_GameControllerMapping(SDL_GameController *gamecontroller);
165
177
 
166
178
  /**
167
179
  * Is the joystick on this index supported by the game controller interface?
@@ -175,6 +187,12 @@ extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index);
175
187
  */
176
188
  extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index);
177
189
 
190
+ /**
191
+ * Get the type of a game controller.
192
+ * This can be called before any controllers are opened.
193
+ */
194
+ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerTypeForIndex(int joystick_index);
195
+
178
196
  /**
179
197
  * Get the mapping of a game controller.
180
198
  * This can be called before any controllers are opened.
@@ -199,11 +217,21 @@ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_
199
217
  */
200
218
  extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromInstanceID(SDL_JoystickID joyid);
201
219
 
220
+ /**
221
+ * Return the SDL_GameController associated with a player index.
222
+ */
223
+ extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerFromPlayerIndex(int player_index);
224
+
202
225
  /**
203
226
  * Return the name for this currently opened controller
204
227
  */
205
228
  extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller);
206
229
 
230
+ /**
231
+ * Return the type of this currently opened controller
232
+ */
233
+ extern DECLSPEC SDL_GameControllerType SDLCALL SDL_GameControllerGetType(SDL_GameController *gamecontroller);
234
+
207
235
  /**
208
236
  * Get the player index of an opened game controller, or -1 if it's not available
209
237
  *
@@ -211,23 +239,35 @@ extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *g
211
239
  */
212
240
  extern DECLSPEC int SDLCALL SDL_GameControllerGetPlayerIndex(SDL_GameController *gamecontroller);
213
241
 
242
+ /**
243
+ * Set the player index of an opened game controller
244
+ */
245
+ extern DECLSPEC void SDLCALL SDL_GameControllerSetPlayerIndex(SDL_GameController *gamecontroller, int player_index);
246
+
214
247
  /**
215
248
  * Get the USB vendor ID of an opened controller, if available.
216
249
  * If the vendor ID isn't available this function returns 0.
217
250
  */
218
- extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController * gamecontroller);
251
+ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetVendor(SDL_GameController *gamecontroller);
219
252
 
220
253
  /**
221
254
  * Get the USB product ID of an opened controller, if available.
222
255
  * If the product ID isn't available this function returns 0.
223
256
  */
224
- extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController * gamecontroller);
257
+ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProduct(SDL_GameController *gamecontroller);
225
258
 
226
259
  /**
227
260
  * Get the product version of an opened controller, if available.
228
261
  * If the product version isn't available this function returns 0.
229
262
  */
230
- extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController * gamecontroller);
263
+ extern DECLSPEC Uint16 SDLCALL SDL_GameControllerGetProductVersion(SDL_GameController *gamecontroller);
264
+
265
+ /**
266
+ * Get the serial number of an opened controller, if available.
267
+ *
268
+ * Returns the serial number of the controller, or NULL if it is not available.
269
+ */
270
+ extern DECLSPEC const char * SDLCALL SDL_GameControllerGetSerial(SDL_GameController *gamecontroller);
231
271
 
232
272
  /**
233
273
  * Returns SDL_TRUE if the controller has been opened and currently connected,
@@ -298,6 +338,12 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
298
338
  SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
299
339
  SDL_GameControllerAxis axis);
300
340
 
341
+ /**
342
+ * Return whether a game controller has a given axis
343
+ */
344
+ extern DECLSPEC SDL_bool SDLCALL
345
+ SDL_GameControllerHasAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
346
+
301
347
  /**
302
348
  * Get the current state of an axis control on a game controller.
303
349
  *
@@ -307,8 +353,7 @@ SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller,
307
353
  * The axis indices start at index 0.
308
354
  */
309
355
  extern DECLSPEC Sint16 SDLCALL
310
- SDL_GameControllerGetAxis(SDL_GameController *gamecontroller,
311
- SDL_GameControllerAxis axis);
356
+ SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis);
312
357
 
313
358
  /**
314
359
  * The list of buttons available from a controller
@@ -331,6 +376,12 @@ typedef enum
331
376
  SDL_CONTROLLER_BUTTON_DPAD_DOWN,
332
377
  SDL_CONTROLLER_BUTTON_DPAD_LEFT,
333
378
  SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
379
+ SDL_CONTROLLER_BUTTON_MISC1, /* Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button */
380
+ SDL_CONTROLLER_BUTTON_PADDLE1, /* Xbox Elite paddle P1 */
381
+ SDL_CONTROLLER_BUTTON_PADDLE2, /* Xbox Elite paddle P3 */
382
+ SDL_CONTROLLER_BUTTON_PADDLE3, /* Xbox Elite paddle P2 */
383
+ SDL_CONTROLLER_BUTTON_PADDLE4, /* Xbox Elite paddle P4 */
384
+ SDL_CONTROLLER_BUTTON_TOUCHPAD, /* PS4/PS5 touchpad button */
334
385
  SDL_CONTROLLER_BUTTON_MAX
335
386
  } SDL_GameControllerButton;
336
387
 
@@ -351,6 +402,11 @@ extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
351
402
  SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller,
352
403
  SDL_GameControllerButton button);
353
404
 
405
+ /**
406
+ * Return whether a game controller has a given button
407
+ */
408
+ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasButton(SDL_GameController *gamecontroller,
409
+ SDL_GameControllerButton button);
354
410
 
355
411
  /**
356
412
  * Get the current state of a button on a game controller.
@@ -361,7 +417,68 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga
361
417
  SDL_GameControllerButton button);
362
418
 
363
419
  /**
364
- * Trigger a rumble effect
420
+ * Get the number of touchpads on a game controller.
421
+ */
422
+ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpads(SDL_GameController *gamecontroller);
423
+
424
+ /**
425
+ * Get the number of supported simultaneous fingers on a touchpad on a game controller.
426
+ */
427
+ extern DECLSPEC int SDLCALL SDL_GameControllerGetNumTouchpadFingers(SDL_GameController *gamecontroller, int touchpad);
428
+
429
+ /**
430
+ * Get the current state of a finger on a touchpad on a game controller.
431
+ */
432
+ extern DECLSPEC int SDLCALL SDL_GameControllerGetTouchpadFinger(SDL_GameController *gamecontroller, int touchpad, int finger, Uint8 *state, float *x, float *y, float *pressure);
433
+
434
+ /**
435
+ * Return whether a game controller has a particular sensor.
436
+ *
437
+ * \param gamecontroller The controller to query
438
+ * \param type The type of sensor to query
439
+ *
440
+ * \return SDL_TRUE if the sensor exists, SDL_FALSE otherwise.
441
+ */
442
+ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasSensor(SDL_GameController *gamecontroller, SDL_SensorType type);
443
+
444
+ /**
445
+ * Set whether data reporting for a game controller sensor is enabled
446
+ *
447
+ * \param gamecontroller The controller to update
448
+ * \param type The type of sensor to enable/disable
449
+ * \param enabled Whether data reporting should be enabled
450
+ *
451
+ * \return 0 or -1 if an error occurred.
452
+ */
453
+ extern DECLSPEC int SDLCALL SDL_GameControllerSetSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type, SDL_bool enabled);
454
+
455
+ /**
456
+ * Query whether sensor data reporting is enabled for a game controller
457
+ *
458
+ * \param gamecontroller The controller to query
459
+ * \param type The type of sensor to query
460
+ *
461
+ * \return SDL_TRUE if the sensor is enabled, SDL_FALSE otherwise.
462
+ */
463
+ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerIsSensorEnabled(SDL_GameController *gamecontroller, SDL_SensorType type);
464
+
465
+ /**
466
+ * Get the current state of a game controller sensor.
467
+ *
468
+ * The number of values and interpretation of the data is sensor dependent.
469
+ * See SDL_sensor.h for the details for each type of sensor.
470
+ *
471
+ * \param gamecontroller The controller to query
472
+ * \param type The type of sensor to query
473
+ * \param data A pointer filled with the current sensor state
474
+ * \param num_values The number of values to write to data
475
+ *
476
+ * \return 0 or -1 if an error occurred.
477
+ */
478
+ extern DECLSPEC int SDLCALL SDL_GameControllerGetSensorData(SDL_GameController *gamecontroller, SDL_SensorType type, float *data, int num_values);
479
+
480
+ /**
481
+ * Start a rumble effect
365
482
  * Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
366
483
  *
367
484
  * \param gamecontroller The controller to vibrate
@@ -369,10 +486,44 @@ extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *ga
369
486
  * \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
370
487
  * \param duration_ms The duration of the rumble effect, in milliseconds
371
488
  *
372
- * \return 0, or -1 if rumble isn't supported on this joystick
489
+ * \return 0, or -1 if rumble isn't supported on this controller
373
490
  */
374
491
  extern DECLSPEC int SDLCALL SDL_GameControllerRumble(SDL_GameController *gamecontroller, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms);
375
492
 
493
+ /**
494
+ * Start a rumble effect in the game controller's triggers
495
+ * Each call to this function cancels any previous trigger rumble effect, and calling it with 0 intensity stops any rumbling.
496
+ *
497
+ * \param gamecontroller The controller to vibrate
498
+ * \param left_rumble The intensity of the left trigger rumble motor, from 0 to 0xFFFF
499
+ * \param right_rumble The intensity of the right trigger rumble motor, from 0 to 0xFFFF
500
+ * \param duration_ms The duration of the rumble effect, in milliseconds
501
+ *
502
+ * \return 0, or -1 if rumble isn't supported on this controller
503
+ */
504
+ extern DECLSPEC int SDLCALL SDL_GameControllerRumbleTriggers(SDL_GameController *gamecontroller, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms);
505
+
506
+ /**
507
+ * Return whether a controller has an LED
508
+ *
509
+ * \param gamecontroller The controller to query
510
+ *
511
+ * \return SDL_TRUE, or SDL_FALSE if this controller does not have a modifiable LED
512
+ */
513
+ extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerHasLED(SDL_GameController *gamecontroller);
514
+
515
+ /**
516
+ * Update a controller's LED color.
517
+ *
518
+ * \param gamecontroller The controller to update
519
+ * \param red The intensity of the red LED
520
+ * \param green The intensity of the green LED
521
+ * \param blue The intensity of the blue LED
522
+ *
523
+ * \return 0, or -1 if this controller does not have a modifiable LED
524
+ */
525
+ extern DECLSPEC int SDLCALL SDL_GameControllerSetLED(SDL_GameController *gamecontroller, Uint8 red, Uint8 green, Uint8 blue);
526
+
376
527
  /**
377
528
  * Close a controller previously opened with SDL_GameControllerOpen().
378
529
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2020 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-2018 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2020 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
@@ -336,6 +336,14 @@ typedef struct _SDL_Haptic SDL_Haptic;
336
336
  */
337
337
  #define SDL_HAPTIC_SPHERICAL 2
338
338
 
339
+ /**
340
+ * \brief Use this value to play an effect on the steering wheel axis. This
341
+ * provides better compatibility across platforms and devices as SDL will guess
342
+ * the correct axis.
343
+ * \sa SDL_HapticDirection
344
+ */
345
+ #define SDL_HAPTIC_STEERING_AXIS 3
346
+
339
347
  /* @} *//* Direction encodings */
340
348
 
341
349
  /* @} *//* Haptic features */
@@ -444,6 +452,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
444
452
  * \sa SDL_HAPTIC_POLAR
445
453
  * \sa SDL_HAPTIC_CARTESIAN
446
454
  * \sa SDL_HAPTIC_SPHERICAL
455
+ * \sa SDL_HAPTIC_STEERING_AXIS
447
456
  * \sa SDL_HapticEffect
448
457
  * \sa SDL_HapticNumAxes
449
458
  */
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
3
+ Copyright (C) 1997-2020 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
@@ -164,6 +164,21 @@ extern "C" {
164
164
  */
165
165
  #define SDL_HINT_VIDEO_ALLOW_SCREENSAVER "SDL_VIDEO_ALLOW_SCREENSAVER"
166
166
 
167
+ /**
168
+ * \brief A variable controlling whether the graphics context is externally managed.
169
+ *
170
+ * This variable can be set to the following values:
171
+ * "0" - SDL will manage graphics contexts that are attached to windows.
172
+ * "1" - Disable graphics context management on windows.
173
+ *
174
+ * By default SDL will manage OpenGL contexts in certain situations. For example, on Android the
175
+ * context will be automatically saved and restored when pausing the application. Additionally, some
176
+ * platforms will assume usage of OpenGL if Vulkan isn't used. Setting this to "1" will prevent this
177
+ * behavior, which is desireable when the application manages the graphics context, such as
178
+ * an externally managed OpenGL context or attaching a Vulkan surface to the window.
179
+ */
180
+ #define SDL_HINT_VIDEO_EXTERNAL_CONTEXT "SDL_VIDEO_EXTERNAL_CONTEXT"
181
+
167
182
  /**
168
183
  * \brief A variable controlling whether the X11 VidMode extension should be used.
169
184
  *
@@ -197,6 +212,12 @@ extern "C" {
197
212
  */
198
213
  #define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR"
199
214
 
215
+ /**
216
+ * \brief A variable forcing the visual ID chosen for new X11 windows
217
+ *
218
+ */
219
+ #define SDL_HINT_VIDEO_X11_WINDOW_VISUALID "SDL_VIDEO_X11_WINDOW_VISUALID"
220
+
200
221
  /**
201
222
  * \brief A variable controlling whether the X11 _NET_WM_PING protocol should be supported.
202
223
  *
@@ -223,6 +244,17 @@ extern "C" {
223
244
  */
224
245
  #define SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
225
246
 
247
+ /**
248
+ * \brief A variable controlling whether X11 should use GLX or EGL by default
249
+ *
250
+ * This variable can be set to the following values:
251
+ * "0" - Use GLX
252
+ * "1" - Use EGL
253
+ *
254
+ * By default SDL will use GLX when both are present.
255
+ */
256
+ #define SDL_HINT_VIDEO_X11_FORCE_EGL "SDL_VIDEO_X11_FORCE_EGL"
257
+
226
258
  /**
227
259
  * \brief A variable controlling whether the window frame and title bar are interactive when the cursor is hidden
228
260
  *
@@ -282,6 +314,17 @@ extern "C" {
282
314
  */
283
315
  #define SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE "SDL_MOUSE_RELATIVE_SPEED_SCALE"
284
316
 
317
+ /**
318
+ * \brief A variable controlling whether relative mouse motion is affected by renderer scaling
319
+ *
320
+ * This variable can be set to the following values:
321
+ * "0" - Relative motion is unaffected by DPI or renderer's logical size
322
+ * "1" - Relative motion is scaled according to DPI scaling and logical size
323
+ *
324
+ * By default relative mouse deltas are affected by DPI and renderer scaling
325
+ */
326
+ #define SDL_HINT_MOUSE_RELATIVE_SCALING "SDL_MOUSE_RELATIVE_SCALING"
327
+
285
328
  /**
286
329
  * \brief A variable controlling whether relative mouse mode is implemented using mouse warping
287
330
  *
@@ -316,7 +359,19 @@ extern "C" {
316
359
  #define SDL_HINT_TOUCH_MOUSE_EVENTS "SDL_TOUCH_MOUSE_EVENTS"
317
360
 
318
361
  /**
319
- * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
362
+ * \brief A variable controlling whether mouse events should generate synthetic touch events
363
+ *
364
+ * This variable can be set to the following values:
365
+ * "0" - Mouse events will not generate touch events (default for desktop platforms)
366
+ * "1" - Mouse events will generate touch events (default for mobile platforms, such as Android and iOS)
367
+ */
368
+
369
+ #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
370
+
371
+ /**
372
+ * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to false.
373
+ * \warning Before SDL 2.0.14, this defaulted to true! In 2.0.14, we're
374
+ * seeing if "true" causes more problems than it solves in modern times.
320
375
  *
321
376
  */
322
377
  #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
@@ -426,6 +481,25 @@ extern "C" {
426
481
  */
427
482
  #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
428
483
 
484
+ /**
485
+ * \brief A variable that overrides the automatic controller type detection
486
+ *
487
+ * The variable should be comma separated entries, in the form: VID/PID=type
488
+ *
489
+ * The VID and PID should be hexadecimal with exactly 4 digits, e.g. 0x00fd
490
+ *
491
+ * The type should be one of:
492
+ * Xbox360
493
+ * XboxOne
494
+ * PS3
495
+ * PS4
496
+ * PS5
497
+ * SwitchPro
498
+ *
499
+ * This hint affects what driver is used, and must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
500
+ */
501
+ #define SDL_HINT_GAMECONTROLLERTYPE "SDL_GAMECONTROLLERTYPE"
502
+
429
503
  /**
430
504
  * \brief A variable that lets you manually hint extra gamecontroller db entries.
431
505
  *
@@ -436,6 +510,16 @@ extern "C" {
436
510
  */
437
511
  #define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG"
438
512
 
513
+ /**
514
+ * \brief A variable that lets you provide a file with extra gamecontroller db entries.
515
+ *
516
+ * The file should contain lines of gamecontroller config data, see SDL_gamecontroller.h
517
+ *
518
+ * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
519
+ * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
520
+ */
521
+ #define SDL_HINT_GAMECONTROLLERCONFIG_FILE "SDL_GAMECONTROLLERCONFIG_FILE"
522
+
439
523
  /**
440
524
  * \brief A variable containing a list of devices to skip when scanning for game controllers.
441
525
  *
@@ -462,6 +546,29 @@ extern "C" {
462
546
  */
463
547
  #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
464
548
 
549
+ /**
550
+ * \brief If set, game controller face buttons report their values according to their labels instead of their positional layout.
551
+ *
552
+ * For example, on Nintendo Switch controllers, normally you'd get:
553
+ *
554
+ * (Y)
555
+ * (X) (B)
556
+ * (A)
557
+ *
558
+ * but if this hint is set, you'll get:
559
+ *
560
+ * (X)
561
+ * (Y) (A)
562
+ * (B)
563
+ *
564
+ * The variable can be set to the following values:
565
+ * "0" - Report the face buttons by position, as though they were on an Xbox controller.
566
+ * "1" - Report the face buttons by label instead of position
567
+ *
568
+ * The default value is "1". This hint may be set at any time.
569
+ */
570
+ #define SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
571
+
465
572
  /**
466
573
  * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
467
574
  *
@@ -497,6 +604,17 @@ extern "C" {
497
604
  */
498
605
  #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
499
606
 
607
+ /**
608
+ * \brief A variable controlling whether the HIDAPI driver for PS5 controllers should be used.
609
+ *
610
+ * This variable can be set to the following values:
611
+ * "0" - HIDAPI driver is not used
612
+ * "1" - HIDAPI driver is used
613
+ *
614
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
615
+ */
616
+ #define SDL_HINT_JOYSTICK_HIDAPI_PS5 "SDL_JOYSTICK_HIDAPI_PS5"
617
+
500
618
  /**
501
619
  * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
502
620
  *
@@ -541,10 +659,34 @@ extern "C" {
541
659
  * "0" - HIDAPI driver is not used
542
660
  * "1" - HIDAPI driver is used
543
661
  *
544
- * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
662
+ * The default is "0" on Windows, otherwise the value of SDL_HINT_JOYSTICK_HIDAPI
545
663
  */
546
664
  #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
547
665
 
666
+ /**
667
+ * \brief A variable controlling whether the HIDAPI driver for XBox controllers on Windows should pull correlated
668
+ * data from XInput.
669
+ *
670
+ * This variable can be set to the following values:
671
+ * "0" - HIDAPI Xbox driver will only use HIDAPI data
672
+ * "1" - HIDAPI Xbox driver will also pull data from XInput, providing better trigger axes, guide button
673
+ * presses, and rumble support
674
+ *
675
+ * The default is "1". This hint applies to any joysticks opened after setting the hint.
676
+ */
677
+ #define SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT"
678
+
679
+ /**
680
+ * \brief A variable controlling whether the HIDAPI driver for Nintendo GameCube controllers should be used.
681
+ *
682
+ * This variable can be set to the following values:
683
+ * "0" - HIDAPI driver is not used
684
+ * "1" - HIDAPI driver is used
685
+ *
686
+ * The default is the value of SDL_HINT_JOYSTICK_HIDAPI
687
+ */
688
+ #define SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE "SDL_JOYSTICK_HIDAPI_GAMECUBE"
689
+
548
690
  /**
549
691
  * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
550
692
  *
@@ -556,6 +698,35 @@ extern "C" {
556
698
  */
557
699
  #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
558
700
 
701
+ /**
702
+ * \brief A variable controlling whether the RAWINPUT joystick drivers should be used for better handling XInput-capable devices.
703
+ *
704
+ * This variable can be set to the following values:
705
+ * "0" - RAWINPUT drivers are not used
706
+ * "1" - RAWINPUT drivers are used (the default)
707
+ *
708
+ */
709
+ #define SDL_HINT_JOYSTICK_RAWINPUT "SDL_JOYSTICK_RAWINPUT"
710
+
711
+ /**
712
+ * \brief A variable controlling whether a separate thread should be used
713
+ * for handling joystick detection and raw input messages on Windows
714
+ *
715
+ * This variable can be set to the following values:
716
+ * "0" - A separate thread is not used (the default)
717
+ * "1" - A separate thread is used for handling raw input messages
718
+ *
719
+ */
720
+ #define SDL_HINT_JOYSTICK_THREAD "SDL_JOYSTICK_THREAD"
721
+
722
+ /**
723
+ * \brief A variable controlling whether joysticks on Linux adhere to their HID-defined deadzones or return unfiltered values.
724
+ *
725
+ * This variable can be set to the following values:
726
+ * "0" - Return unfiltered joystick axis values (the default)
727
+ * "1" - Return axis values with deadzones taken into account
728
+ */
729
+ #define SDL_HINT_LINUX_JOYSTICK_DEADZONES "SDL_LINUX_JOYSTICK_DEADZONES"
559
730
 
560
731
  /**
561
732
  * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
@@ -626,6 +797,42 @@ extern "C" {
626
797
  */
627
798
  #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
628
799
 
800
+ /**
801
+ * \brief A string specifying additional information to use with SDL_SetThreadPriority.
802
+ *
803
+ * By default SDL_SetThreadPriority will make appropriate system changes in order to
804
+ * apply a thread priority. For example on systems using pthreads the scheduler policy
805
+ * is changed automatically to a policy that works well with a given priority.
806
+ * Code which has specific requirements can override SDL's default behavior with this hint.
807
+ *
808
+ * pthread hint values are "current", "other", "fifo" and "rr".
809
+ * Currently no other platform hint values are defined but may be in the future.
810
+ *
811
+ * \note On Linux, the kernel may send SIGKILL to realtime tasks which exceed the distro
812
+ * configured execution budget for rtkit. This budget can be queried through RLIMIT_RTTIME
813
+ * after calling SDL_SetThreadPriority().
814
+ */
815
+ #define SDL_HINT_THREAD_PRIORITY_POLICY "SDL_THREAD_PRIORITY_POLICY"
816
+
817
+ /**
818
+ * \brief Specifies whether SDL_THREAD_PRIORITY_TIME_CRITICAL should be treated as realtime.
819
+ *
820
+ * On some platforms, like Linux, a realtime priority thread may be subject to restrictions
821
+ * that require special handling by the application. This hint exists to let SDL know that
822
+ * the app is prepared to handle said restrictions.
823
+ *
824
+ * On Linux, SDL will apply the following configuration to any thread that becomes realtime:
825
+ * * The SCHED_RESET_ON_FORK bit will be set on the scheduling policy,
826
+ * * An RLIMIT_RTTIME budget will be configured to the rtkit specified limit.
827
+ * * Exceeding this limit will result in the kernel sending SIGKILL to the app,
828
+ * * Refer to the man pages for more information.
829
+ *
830
+ * This variable can be set to the following values:
831
+ * "0" - default platform specific behaviour
832
+ * "1" - Force SDL_THREAD_PRIORITY_TIME_CRITICAL to a realtime scheduling policy
833
+ */
834
+ #define SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
835
+
629
836
  /**
630
837
  * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS)
631
838
  */
@@ -836,19 +1043,7 @@ extern "C" {
836
1043
  */
837
1044
  #define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING"
838
1045
 
839
- /**
840
- * \brief A variable to control whether mouse and touch events are to be treated together or separately
841
- *
842
- * The variable can be set to the following values:
843
- * "0" - Mouse events will be handled as touch events, and touch will raise fake mouse
844
- * events. This is the behaviour of SDL <= 2.0.3. (default)
845
- * "1" - Mouse events will be handled separately from pure touch events.
846
- *
847
- * The value of this hint is used at runtime, so it can be changed at any time.
848
- */
849
- #define SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH "SDL_ANDROID_SEPARATE_MOUSE_AND_TOUCH"
850
-
851
- /**
1046
+ /**
852
1047
  * \brief A variable to control whether we trap the Android back button to handle it manually.
853
1048
  * This is necessary for the right mouse button to work on some Android devices, or
854
1049
  * to be able to trap the back button for use in your code reliably. If set to true,
@@ -865,6 +1060,29 @@ extern "C" {
865
1060
  */
866
1061
  #define SDL_HINT_ANDROID_TRAP_BACK_BUTTON "SDL_ANDROID_TRAP_BACK_BUTTON"
867
1062
 
1063
+ /**
1064
+ * \brief A variable to control whether the event loop will block itself when the app is paused.
1065
+ *
1066
+ * The variable can be set to the following values:
1067
+ * "0" - Non blocking.
1068
+ * "1" - Blocking. (default)
1069
+ *
1070
+ * The value should be set before SDL is initialized.
1071
+ */
1072
+ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
1073
+
1074
+ /**
1075
+ * \brief A variable to control whether SDL will pause audio in background
1076
+ * (Requires SDL_ANDROID_BLOCK_ON_PAUSE as "Non blocking")
1077
+ *
1078
+ * The variable can be set to the following values:
1079
+ * "0" - Non paused.
1080
+ * "1" - Paused. (default)
1081
+ *
1082
+ * The value should be set before SDL is initialized.
1083
+ */
1084
+ #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
1085
+
868
1086
  /**
869
1087
  * \brief A variable to control whether the return key on the soft keyboard
870
1088
  * should hide the soft keyboard on Android and iOS.
@@ -891,10 +1109,26 @@ extern "C" {
891
1109
  */
892
1110
  #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
893
1111
 
1112
+ /**
1113
+ * \brief Disable giving back control to the browser automatically
1114
+ * when running with asyncify
1115
+ *
1116
+ * With -s ASYNCIFY, SDL2 calls emscripten_sleep during operations
1117
+ * such as refreshing the screen or polling events.
1118
+ *
1119
+ * This hint only applies to the emscripten platform
1120
+ *
1121
+ * The variable can be set to the following values:
1122
+ * "0" - Disable emscripten_sleep calls (if you give back browser control manually or use asyncify for other purposes)
1123
+ * "1" - Enable emscripten_sleep calls (the default)
1124
+ */
1125
+ #define SDL_HINT_EMSCRIPTEN_ASYNCIFY "SDL_EMSCRIPTEN_ASYNCIFY"
1126
+
894
1127
  /**
895
1128
  * \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
896
1129
  *
897
- * This hint only applies to Unix-like platforms.
1130
+ * This hint only applies to Unix-like platforms, and should set before
1131
+ * any calls to SDL_Init()
898
1132
  *
899
1133
  * The variable can be set to the following values:
900
1134
  * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
@@ -1043,6 +1277,215 @@ extern "C" {
1043
1277
  */
1044
1278
  #define SDL_HINT_AUDIO_CATEGORY "SDL_AUDIO_CATEGORY"
1045
1279
 
1280
+ /**
1281
+ * \brief A variable controlling whether the 2D render API is compatible or efficient.
1282
+ *
1283
+ * This variable can be set to the following values:
1284
+ *
1285
+ * "0" - Don't use batching to make rendering more efficient.
1286
+ * "1" - Use batching, but might cause problems if app makes its own direct OpenGL calls.
1287
+ *
1288
+ * Up to SDL 2.0.9, the render API would draw immediately when requested. Now
1289
+ * it batches up draw requests and sends them all to the GPU only when forced
1290
+ * to (during SDL_RenderPresent, when changing render targets, by updating a
1291
+ * texture that the batch needs, etc). This is significantly more efficient,
1292
+ * but it can cause problems for apps that expect to render on top of the
1293
+ * render API's output. As such, SDL will disable batching if a specific
1294
+ * render backend is requested (since this might indicate that the app is
1295
+ * planning to use the underlying graphics API directly). This hint can
1296
+ * be used to explicitly request batching in this instance. It is a contract
1297
+ * that you will either never use the underlying graphics API directly, or
1298
+ * if you do, you will call SDL_RenderFlush() before you do so any current
1299
+ * batch goes to the GPU before your work begins. Not following this contract
1300
+ * will result in undefined behavior.
1301
+ */
1302
+ #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING"
1303
+
1304
+
1305
+ /**
1306
+ * \brief A variable controlling whether SDL updates joystick state when getting input events
1307
+ *
1308
+ * This variable can be set to the following values:
1309
+ *
1310
+ * "0" - You'll call SDL_JoystickUpdate() manually
1311
+ * "1" - SDL will automatically call SDL_JoystickUpdate() (default)
1312
+ *
1313
+ * This hint can be toggled on and off at runtime.
1314
+ */
1315
+ #define SDL_HINT_AUTO_UPDATE_JOYSTICKS "SDL_AUTO_UPDATE_JOYSTICKS"
1316
+
1317
+
1318
+ /**
1319
+ * \brief A variable controlling whether SDL updates sensor state when getting input events
1320
+ *
1321
+ * This variable can be set to the following values:
1322
+ *
1323
+ * "0" - You'll call SDL_SensorUpdate() manually
1324
+ * "1" - SDL will automatically call SDL_SensorUpdate() (default)
1325
+ *
1326
+ * This hint can be toggled on and off at runtime.
1327
+ */
1328
+ #define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS"
1329
+
1330
+
1331
+ /**
1332
+ * \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
1333
+ *
1334
+ * This variable can be set to the following values:
1335
+ *
1336
+ * "0" - Don't log any events (default)
1337
+ * "1" - Log all events except mouse and finger motion, which are pretty spammy.
1338
+ * "2" - Log all events.
1339
+ *
1340
+ * This is generally meant to be used to debug SDL itself, but can be useful
1341
+ * for application developers that need better visibility into what is going
1342
+ * on in the event queue. Logged events are sent through SDL_Log(), which
1343
+ * means by default they appear on stdout on most platforms or maybe
1344
+ * OutputDebugString() on Windows, and can be funneled by the app with
1345
+ * SDL_LogSetOutputFunction(), etc.
1346
+ *
1347
+ * This hint can be toggled on and off at runtime, if you only need to log
1348
+ * events for a small subset of program execution.
1349
+ */
1350
+ #define SDL_HINT_EVENT_LOGGING "SDL_EVENT_LOGGING"
1351
+
1352
+
1353
+
1354
+ /**
1355
+ * \brief Controls how the size of the RIFF chunk affects the loading of a WAVE file.
1356
+ *
1357
+ * The size of the RIFF chunk (which includes all the sub-chunks of the WAVE
1358
+ * file) is not always reliable. In case the size is wrong, it's possible to
1359
+ * just ignore it and step through the chunks until a fixed limit is reached.
1360
+ *
1361
+ * Note that files that have trailing data unrelated to the WAVE file or
1362
+ * corrupt files may slow down the loading process without a reliable boundary.
1363
+ * By default, SDL stops after 10000 chunks to prevent wasting time. Use the
1364
+ * environment variable SDL_WAVE_CHUNK_LIMIT to adjust this value.
1365
+ *
1366
+ * This variable can be set to the following values:
1367
+ *
1368
+ * "force" - Always use the RIFF chunk size as a boundary for the chunk search
1369
+ * "ignorezero" - Like "force", but a zero size searches up to 4 GiB (default)
1370
+ * "ignore" - Ignore the RIFF chunk size and always search up to 4 GiB
1371
+ * "maximum" - Search for chunks until the end of file (not recommended)
1372
+ */
1373
+ #define SDL_HINT_WAVE_RIFF_CHUNK_SIZE "SDL_WAVE_RIFF_CHUNK_SIZE"
1374
+
1375
+ /**
1376
+ * \brief Controls how a truncated WAVE file is handled.
1377
+ *
1378
+ * A WAVE file is considered truncated if any of the chunks are incomplete or
1379
+ * the data chunk size is not a multiple of the block size. By default, SDL
1380
+ * decodes until the first incomplete block, as most applications seem to do.
1381
+ *
1382
+ * This variable can be set to the following values:
1383
+ *
1384
+ * "verystrict" - Raise an error if the file is truncated
1385
+ * "strict" - Like "verystrict", but the size of the RIFF chunk is ignored
1386
+ * "dropframe" - Decode until the first incomplete sample frame
1387
+ * "dropblock" - Decode until the first incomplete block (default)
1388
+ */
1389
+ #define SDL_HINT_WAVE_TRUNCATION "SDL_WAVE_TRUNCATION"
1390
+
1391
+ /**
1392
+ * \brief Controls how the fact chunk affects the loading of a WAVE file.
1393
+ *
1394
+ * The fact chunk stores information about the number of samples of a WAVE
1395
+ * file. The Standards Update from Microsoft notes that this value can be used
1396
+ * to 'determine the length of the data in seconds'. This is especially useful
1397
+ * for compressed formats (for which this is a mandatory chunk) if they produce
1398
+ * multiple sample frames per block and truncating the block is not allowed.
1399
+ * The fact chunk can exactly specify how many sample frames there should be
1400
+ * in this case.
1401
+ *
1402
+ * Unfortunately, most application seem to ignore the fact chunk and so SDL
1403
+ * ignores it by default as well.
1404
+ *
1405
+ * This variable can be set to the following values:
1406
+ *
1407
+ * "truncate" - Use the number of samples to truncate the wave data if
1408
+ * the fact chunk is present and valid
1409
+ * "strict" - Like "truncate", but raise an error if the fact chunk
1410
+ * is invalid, not present for non-PCM formats, or if the
1411
+ * data chunk doesn't have that many samples
1412
+ * "ignorezero" - Like "truncate", but ignore fact chunk if the number of
1413
+ * samples is zero
1414
+ * "ignore" - Ignore fact chunk entirely (default)
1415
+ */
1416
+ #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK"
1417
+
1418
+ /**
1419
+ * \brief Override for SDL_GetDisplayUsableBounds()
1420
+ *
1421
+ * If set, this hint will override the expected results for
1422
+ * SDL_GetDisplayUsableBounds() for display index 0. Generally you don't want
1423
+ * to do this, but this allows an embedded system to request that some of the
1424
+ * screen be reserved for other uses when paired with a well-behaved
1425
+ * application.
1426
+ *
1427
+ * The contents of this hint must be 4 comma-separated integers, the first
1428
+ * is the bounds x, then y, width and height, in that order.
1429
+ */
1430
+ #define SDL_HINT_DISPLAY_USABLE_BOUNDS "SDL_DISPLAY_USABLE_BOUNDS"
1431
+
1432
+ /**
1433
+ * \brief Specify an application name for an audio device.
1434
+ *
1435
+ * Some audio backends (such as PulseAudio) allow you to describe your audio
1436
+ * stream. Among other things, this description might show up in a system
1437
+ * control panel that lets the user adjust the volume on specific audio
1438
+ * streams instead of using one giant master volume slider.
1439
+ *
1440
+ * This hints lets you transmit that information to the OS. The contents of
1441
+ * this hint are used while opening an audio device. You should use a string
1442
+ * that describes your program ("My Game 2: The Revenge")
1443
+ *
1444
+ * Setting this to "" or leaving it unset will have SDL use a reasonable
1445
+ * default: probably the application's name or "SDL Application" if SDL
1446
+ * doesn't have any better information.
1447
+ *
1448
+ * On targets where this is not supported, this hint does nothing.
1449
+ */
1450
+ #define SDL_HINT_AUDIO_DEVICE_APP_NAME "SDL_AUDIO_DEVICE_APP_NAME"
1451
+
1452
+ /**
1453
+ * \brief Specify an application name for an audio device.
1454
+ *
1455
+ * Some audio backends (such as PulseAudio) allow you to describe your audio
1456
+ * stream. Among other things, this description might show up in a system
1457
+ * control panel that lets the user adjust the volume on specific audio
1458
+ * streams instead of using one giant master volume slider.
1459
+ *
1460
+ * This hints lets you transmit that information to the OS. The contents of
1461
+ * this hint are used while opening an audio device. You should use a string
1462
+ * that describes your what your program is playing ("audio stream" is
1463
+ * probably sufficient in many cases, but this could be useful for something
1464
+ * like "team chat" if you have a headset playing VoIP audio separately).
1465
+ *
1466
+ * Setting this to "" or leaving it unset will have SDL use a reasonable
1467
+ * default: "audio stream" or something similar.
1468
+ *
1469
+ * On targets where this is not supported, this hint does nothing.
1470
+ */
1471
+ #define SDL_HINT_AUDIO_DEVICE_STREAM_NAME "SDL_AUDIO_DEVICE_STREAM_NAME"
1472
+
1473
+
1474
+ /**
1475
+ * \brief Override for SDL_GetPreferredLocales()
1476
+ *
1477
+ * If set, this will be favored over anything the OS might report for the
1478
+ * user's preferred locales. Changing this hint at runtime will not generate
1479
+ * a SDL_LOCALECHANGED event (but if you can change the hint, you can push
1480
+ * your own event, if you want).
1481
+ *
1482
+ * The format of this hint is a comma-separated list of language and locale,
1483
+ * combined with an underscore, as is a common format: "en_GB". Locale is
1484
+ * optional: "en". So you might have a list like this: "en_GB,jp,es_PT"
1485
+ */
1486
+ #define SDL_HINT_PREFERRED_LOCALES "SDL_PREFERRED_LOCALES"
1487
+
1488
+
1046
1489
  /**
1047
1490
  * \brief An enumeration of hint priorities
1048
1491
  */