ruby2d 0.9.4 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/assets/include/SDL2/SDL.h +4 -1
  3. data/assets/include/SDL2/SDL_assert.h +3 -1
  4. data/assets/include/SDL2/SDL_atomic.h +1 -1
  5. data/assets/include/SDL2/SDL_audio.h +1 -1
  6. data/assets/include/SDL2/SDL_bits.h +1 -1
  7. data/assets/include/SDL2/SDL_blendmode.h +4 -1
  8. data/assets/include/SDL2/SDL_clipboard.h +1 -1
  9. data/assets/include/SDL2/SDL_config.h +1 -1
  10. data/assets/include/SDL2/SDL_config_android.h +7 -3
  11. data/assets/include/SDL2/SDL_config_iphoneos.h +16 -10
  12. data/assets/include/SDL2/SDL_config_macosx.h +40 -14
  13. data/assets/include/SDL2/SDL_config_minimal.h +1 -1
  14. data/assets/include/SDL2/SDL_config_os2.h +26 -8
  15. data/assets/include/SDL2/SDL_config_pandora.h +4 -2
  16. data/assets/include/SDL2/SDL_config_psp.h +2 -1
  17. data/assets/include/SDL2/SDL_config_windows.h +40 -9
  18. data/assets/include/SDL2/SDL_config_winrt.h +5 -2
  19. data/assets/include/SDL2/SDL_config_wiz.h +5 -2
  20. data/assets/include/SDL2/SDL_copying.h +1 -1
  21. data/assets/include/SDL2/SDL_cpuinfo.h +32 -3
  22. data/assets/include/SDL2/SDL_egl.h +4 -1
  23. data/assets/include/SDL2/SDL_endian.h +6 -3
  24. data/assets/include/SDL2/SDL_error.h +38 -2
  25. data/assets/include/SDL2/SDL_events.h +64 -28
  26. data/assets/include/SDL2/SDL_filesystem.h +1 -1
  27. data/assets/include/SDL2/SDL_gamecontroller.h +160 -9
  28. data/assets/include/SDL2/SDL_gesture.h +1 -1
  29. data/assets/include/SDL2/SDL_haptic.h +10 -1
  30. data/assets/include/SDL2/SDL_hints.h +316 -4
  31. data/assets/include/SDL2/SDL_joystick.h +115 -24
  32. data/assets/include/SDL2/SDL_keyboard.h +1 -1
  33. data/assets/include/SDL2/SDL_keycode.h +11 -9
  34. data/assets/include/SDL2/SDL_loadso.h +1 -1
  35. data/assets/include/SDL2/SDL_locale.h +101 -0
  36. data/assets/include/SDL2/SDL_log.h +3 -3
  37. data/assets/include/SDL2/SDL_main.h +1 -1
  38. data/assets/include/SDL2/SDL_messagebox.h +6 -4
  39. data/assets/include/SDL2/SDL_metal.h +117 -0
  40. data/assets/include/SDL2/SDL_misc.h +75 -0
  41. data/assets/include/SDL2/SDL_mouse.h +1 -1
  42. data/assets/include/SDL2/SDL_mutex.h +1 -1
  43. data/assets/include/SDL2/SDL_name.h +1 -1
  44. data/assets/include/SDL2/SDL_opengl.h +1 -1
  45. data/assets/include/SDL2/SDL_opengl_glext.h +3 -0
  46. data/assets/include/SDL2/SDL_opengles.h +1 -1
  47. data/assets/include/SDL2/SDL_opengles2.h +1 -1
  48. data/assets/include/SDL2/SDL_pixels.h +25 -16
  49. data/assets/include/SDL2/SDL_platform.h +1 -1
  50. data/assets/include/SDL2/SDL_power.h +1 -1
  51. data/assets/include/SDL2/SDL_quit.h +1 -1
  52. data/assets/include/SDL2/SDL_rect.h +1 -1
  53. data/assets/include/SDL2/SDL_render.h +63 -3
  54. data/assets/include/SDL2/SDL_revision.h +2 -2
  55. data/assets/include/SDL2/SDL_rwops.h +2 -10
  56. data/assets/include/SDL2/SDL_scancode.h +1 -1
  57. data/assets/include/SDL2/SDL_sensor.h +25 -9
  58. data/assets/include/SDL2/SDL_shape.h +1 -1
  59. data/assets/include/SDL2/SDL_stdinc.h +44 -4
  60. data/assets/include/SDL2/SDL_surface.h +11 -2
  61. data/assets/include/SDL2/SDL_system.h +50 -4
  62. data/assets/include/SDL2/SDL_syswm.h +29 -2
  63. data/assets/include/SDL2/SDL_test.h +1 -1
  64. data/assets/include/SDL2/SDL_test_assert.h +1 -1
  65. data/assets/include/SDL2/SDL_test_common.h +14 -1
  66. data/assets/include/SDL2/SDL_test_compare.h +1 -1
  67. data/assets/include/SDL2/SDL_test_crc32.h +1 -1
  68. data/assets/include/SDL2/SDL_test_font.h +1 -1
  69. data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
  70. data/assets/include/SDL2/SDL_test_harness.h +1 -1
  71. data/assets/include/SDL2/SDL_test_images.h +1 -1
  72. data/assets/include/SDL2/SDL_test_log.h +1 -1
  73. data/assets/include/SDL2/SDL_test_md5.h +1 -1
  74. data/assets/include/SDL2/SDL_test_memory.h +1 -1
  75. data/assets/include/SDL2/SDL_test_random.h +1 -1
  76. data/assets/include/SDL2/SDL_thread.h +34 -11
  77. data/assets/include/SDL2/SDL_timer.h +1 -1
  78. data/assets/include/SDL2/SDL_touch.h +1 -1
  79. data/assets/include/SDL2/SDL_types.h +1 -1
  80. data/assets/include/SDL2/SDL_version.h +2 -2
  81. data/assets/include/SDL2/SDL_video.h +11 -5
  82. data/assets/include/SDL2/SDL_vulkan.h +6 -8
  83. data/assets/include/SDL2/begin_code.h +5 -9
  84. data/assets/include/SDL2/close_code.h +1 -1
  85. data/assets/macos/lib/libFLAC.a +0 -0
  86. data/assets/macos/lib/libSDL2.a +0 -0
  87. data/assets/macos/lib/libSDL2_image.a +0 -0
  88. data/assets/macos/lib/libSDL2_mixer.a +0 -0
  89. data/assets/macos/lib/libSDL2_ttf.a +0 -0
  90. data/assets/macos/lib/libfreetype.a +0 -0
  91. data/assets/macos/lib/libjpeg.a +0 -0
  92. data/assets/macos/lib/libmodplug.a +0 -0
  93. data/assets/macos/lib/libmpg123.a +0 -0
  94. data/assets/macos/lib/libogg.a +0 -0
  95. data/assets/macos/lib/libpng16.a +0 -0
  96. data/assets/macos/lib/libtiff.a +0 -0
  97. data/assets/macos/lib/libvorbis.a +0 -0
  98. data/assets/macos/lib/libvorbisfile.a +0 -0
  99. data/assets/macos/lib/libwebp.a +0 -0
  100. data/assets/mingw/bin/SDL2.dll +0 -0
  101. data/assets/mingw/lib/libSDL2.a +0 -0
  102. data/assets/mingw/lib/libSDL2.dll.a +0 -0
  103. data/assets/mingw/lib/libSDL2_test.a +0 -0
  104. data/assets/mingw/lib/libSDL2main.a +0 -0
  105. data/bin/ruby2d +1 -0
  106. data/{assets/linux/simple2d/src/simple2d.c → ext/ruby2d/common.c} +32 -32
  107. data/{assets/linux/simple2d/src → ext/ruby2d}/controllers.c +17 -17
  108. data/ext/ruby2d/extconf.rb +37 -59
  109. data/ext/ruby2d/font.c +35 -0
  110. data/{assets/linux/simple2d/src → ext/ruby2d}/gl.c +66 -98
  111. data/ext/ruby2d/gl2.c +86 -0
  112. data/{assets/linux/simple2d/src → ext/ruby2d}/gl3.c +69 -112
  113. data/{assets/linux/simple2d/src → ext/ruby2d}/gles.c +22 -81
  114. data/ext/ruby2d/image.c +58 -0
  115. data/{assets/linux/simple2d/src → ext/ruby2d}/input.c +8 -8
  116. data/{assets/linux/simple2d/src → ext/ruby2d}/music.c +30 -17
  117. data/ext/ruby2d/ruby2d.c +449 -439
  118. data/ext/ruby2d/ruby2d.h +652 -0
  119. data/{assets/linux/simple2d/src → ext/ruby2d}/shapes.c +18 -18
  120. data/{assets/linux/simple2d/src → ext/ruby2d}/sound.c +39 -14
  121. data/ext/ruby2d/text.c +22 -0
  122. data/{assets/linux/simple2d/src → ext/ruby2d}/window.c +63 -63
  123. data/lib/ruby2d/circle.rb +21 -3
  124. data/lib/ruby2d/cli/build.rb +4 -7
  125. data/lib/ruby2d/dsl.rb +16 -9
  126. data/lib/ruby2d/entity.rb +17 -0
  127. data/lib/ruby2d/font.rb +23 -3
  128. data/lib/ruby2d/image.rb +35 -7
  129. data/lib/ruby2d/line.rb +23 -1
  130. data/lib/ruby2d/music.rb +5 -0
  131. data/lib/ruby2d/pixel.rb +17 -0
  132. data/lib/ruby2d/quad.rb +21 -1
  133. data/lib/ruby2d/rectangle.rb +12 -3
  134. data/lib/ruby2d/renderable.rb +4 -20
  135. data/lib/ruby2d/sound.rb +30 -0
  136. data/lib/ruby2d/sprite.rb +57 -75
  137. data/lib/ruby2d/square.rb +10 -1
  138. data/lib/ruby2d/text.rb +55 -12
  139. data/lib/ruby2d/texture.rb +28 -0
  140. data/lib/ruby2d/tileset.rb +87 -0
  141. data/lib/ruby2d/triangle.rb +19 -1
  142. data/lib/ruby2d/version.rb +1 -1
  143. data/lib/ruby2d/vertices.rb +84 -0
  144. data/lib/ruby2d/window.rb +259 -22
  145. data/lib/ruby2d.rb +6 -1
  146. metadata +30 -26
  147. data/assets/include/simple2d.h +0 -757
  148. data/assets/linux/simple2d/Makefile +0 -260
  149. data/assets/linux/simple2d/bin/simple2d.sh +0 -1318
  150. data/assets/linux/simple2d/include/simple2d.h +0 -757
  151. data/assets/linux/simple2d/src/gl2.c +0 -146
  152. data/assets/linux/simple2d/src/image.c +0 -138
  153. data/assets/linux/simple2d/src/sprite.c +0 -147
  154. data/assets/linux/simple2d/src/text.c +0 -129
  155. data/assets/macos/lib/libsimple2d.a +0 -0
  156. data/assets/mingw/lib/libsimple2d.a +0 -0
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Simple DirectMedia Layer
3
- Copyright (C) 1997-2019 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
  *
@@ -326,7 +369,9 @@ extern "C" {
326
369
  #define SDL_HINT_MOUSE_TOUCH_EVENTS "SDL_MOUSE_TOUCH_EVENTS"
327
370
 
328
371
  /**
329
- * \brief Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
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.
330
375
  *
331
376
  */
332
377
  #define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
@@ -436,6 +481,25 @@ extern "C" {
436
481
  */
437
482
  #define SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
438
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
+
439
503
  /**
440
504
  * \brief A variable that lets you manually hint extra gamecontroller db entries.
441
505
  *
@@ -482,6 +546,29 @@ extern "C" {
482
546
  */
483
547
  #define SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
484
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
+
485
572
  /**
486
573
  * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background.
487
574
  *
@@ -517,6 +604,17 @@ extern "C" {
517
604
  */
518
605
  #define SDL_HINT_JOYSTICK_HIDAPI_PS4 "SDL_JOYSTICK_HIDAPI_PS4"
519
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
+
520
618
  /**
521
619
  * \brief A variable controlling whether extended input reports should be used for PS4 controllers when using the HIDAPI driver.
522
620
  *
@@ -561,10 +659,34 @@ extern "C" {
561
659
  * "0" - HIDAPI driver is not used
562
660
  * "1" - HIDAPI driver is used
563
661
  *
564
- * 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
565
663
  */
566
664
  #define SDL_HINT_JOYSTICK_HIDAPI_XBOX "SDL_JOYSTICK_HIDAPI_XBOX"
567
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
+
568
690
  /**
569
691
  * \brief A variable that controls whether Steam Controllers should be exposed using the SDL joystick and game controller APIs
570
692
  *
@@ -576,6 +698,35 @@ extern "C" {
576
698
  */
577
699
  #define SDL_HINT_ENABLE_STEAM_CONTROLLERS "SDL_ENABLE_STEAM_CONTROLLERS"
578
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"
579
730
 
580
731
  /**
581
732
  * \brief If set to "0" then never set the top most bit on a SDL Window, even if the video mode expects it.
@@ -646,6 +797,42 @@ extern "C" {
646
797
  */
647
798
  #define SDL_HINT_THREAD_STACK_SIZE "SDL_THREAD_STACK_SIZE"
648
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
+
649
836
  /**
650
837
  * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac and iOS)
651
838
  */
@@ -884,6 +1071,18 @@ extern "C" {
884
1071
  */
885
1072
  #define SDL_HINT_ANDROID_BLOCK_ON_PAUSE "SDL_ANDROID_BLOCK_ON_PAUSE"
886
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
+
887
1086
  /**
888
1087
  * \brief A variable to control whether the return key on the soft keyboard
889
1088
  * should hide the soft keyboard on Android and iOS.
@@ -910,10 +1109,26 @@ extern "C" {
910
1109
  */
911
1110
  #define SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
912
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
+
913
1127
  /**
914
1128
  * \brief Tell SDL not to catch the SIGINT or SIGTERM signals.
915
1129
  *
916
- * 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()
917
1132
  *
918
1133
  * The variable can be set to the following values:
919
1134
  * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
@@ -1087,6 +1302,32 @@ extern "C" {
1087
1302
  #define SDL_HINT_RENDER_BATCHING "SDL_RENDER_BATCHING"
1088
1303
 
1089
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
+
1090
1331
  /**
1091
1332
  * \brief A variable controlling whether SDL logs all events pushed onto its internal queue.
1092
1333
  *
@@ -1174,6 +1415,77 @@ extern "C" {
1174
1415
  */
1175
1416
  #define SDL_HINT_WAVE_FACT_CHUNK "SDL_WAVE_FACT_CHUNK"
1176
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
+
1177
1489
  /**
1178
1490
  * \brief An enumeration of hint priorities
1179
1491
  */