sdl2-bindings 0.1.0 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +134 -108
  3. data/LICENSE.txt +0 -0
  4. data/README.md +86 -68
  5. data/lib/sdl2.rb +131 -127
  6. data/lib/sdl2_audio.rb +261 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +129 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +564 -552
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +329 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_haptic.rb +301 -301
  18. data/lib/sdl2_hidapi.rb +139 -139
  19. data/lib/sdl2_hints.rb +221 -207
  20. data/lib/sdl2_image.rb +296 -232
  21. data/lib/sdl2_imageFilter.rb +164 -164
  22. data/lib/sdl2_joystick.rb +294 -294
  23. data/lib/sdl2_keyboard.rb +125 -117
  24. data/lib/sdl2_keycode.rb +307 -307
  25. data/lib/sdl2_log.rb +131 -131
  26. data/lib/sdl2_main.rb +74 -74
  27. data/lib/sdl2_messagebox.rb +102 -102
  28. data/lib/sdl2_misc.rb +48 -48
  29. data/lib/sdl2_mixer.rb +464 -392
  30. data/lib/sdl2_mouse.rb +136 -136
  31. data/lib/sdl2_pixels.rb +240 -240
  32. data/lib/sdl2_platform.rb +48 -48
  33. data/lib/sdl2_power.rb +54 -54
  34. data/lib/sdl2_rect.rb +145 -109
  35. data/lib/sdl2_render.rb +408 -404
  36. data/lib/sdl2_rotozoom.rb +76 -76
  37. data/lib/sdl2_rwops.rb +242 -238
  38. data/lib/sdl2_scancode.rb +289 -289
  39. data/lib/sdl2_sensor.rb +115 -115
  40. data/lib/sdl2_shape.rb +83 -83
  41. data/lib/sdl2_sound.rb +154 -0
  42. data/lib/sdl2_stdinc.rb +548 -564
  43. data/lib/sdl2_surface.rb +229 -229
  44. data/lib/sdl2_syswm.rb +160 -160
  45. data/lib/sdl2_timer.rb +74 -74
  46. data/lib/sdl2_touch.rb +86 -82
  47. data/lib/sdl2_ttf.rb +414 -357
  48. data/lib/sdl2_version.rb +67 -67
  49. data/lib/sdl2_video.rb +540 -540
  50. data/lib/sdl2_vulkan.rb +72 -72
  51. metadata +3 -2
data/lib/sdl2_hints.rb CHANGED
@@ -1,207 +1,221 @@
1
- # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/sdl2-bindings
4
- #
5
- # [NOTICE] This is an automatically generated file.
6
-
7
- require 'ffi'
8
-
9
- module SDL
10
- extend FFI::Library
11
- # Define/Macro
12
-
13
- HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK"
14
- HINT_ALLOW_ALT_TAB_WHILE_GRABBED = "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
15
- HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"
16
- HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
17
- HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
18
- HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE"
19
- HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
20
- HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON"
21
- HINT_APP_NAME = "SDL_APP_NAME"
22
- HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
23
- HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
24
- HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY"
25
- HINT_AUDIO_DEVICE_APP_NAME = "SDL_AUDIO_DEVICE_APP_NAME"
26
- HINT_AUDIO_DEVICE_STREAM_NAME = "SDL_AUDIO_DEVICE_STREAM_NAME"
27
- HINT_AUDIO_DEVICE_STREAM_ROLE = "SDL_AUDIO_DEVICE_STREAM_ROLE"
28
- HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE"
29
- HINT_AUTO_UPDATE_JOYSTICKS = "SDL_AUTO_UPDATE_JOYSTICKS"
30
- HINT_AUTO_UPDATE_SENSORS = "SDL_AUTO_UPDATE_SENSORS"
31
- HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT"
32
- HINT_DISPLAY_USABLE_BOUNDS = "SDL_DISPLAY_USABLE_BOUNDS"
33
- HINT_EMSCRIPTEN_ASYNCIFY = "SDL_EMSCRIPTEN_ASYNCIFY"
34
- HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
35
- HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS"
36
- HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING"
37
- HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"
38
- HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG"
39
- HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE"
40
- HINT_GAMECONTROLLERTYPE = "SDL_GAMECONTROLLERTYPE"
41
- HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES"
42
- HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
43
- HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
44
- HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
45
- HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
46
- HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
47
- HINT_IME_SHOW_UI = "SDL_IME_SHOW_UI"
48
- HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
49
- HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
50
- HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI"
51
- HINT_JOYSTICK_HIDAPI_GAMECUBE = "SDL_JOYSTICK_HIDAPI_GAMECUBE"
52
- HINT_JOYSTICK_HIDAPI_JOY_CONS = "SDL_JOYSTICK_HIDAPI_JOY_CONS"
53
- HINT_JOYSTICK_HIDAPI_LUNA = "SDL_JOYSTICK_HIDAPI_LUNA"
54
- HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
55
- HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
56
- HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
57
- HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
58
- HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
59
- HINT_JOYSTICK_HIDAPI_STADIA = "SDL_JOYSTICK_HIDAPI_STADIA"
60
- HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
61
- HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
62
- HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
63
- HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
64
- HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
65
- HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
66
- HINT_JOYSTICK_THREAD = "SDL_JOYSTICK_THREAD"
67
- HINT_KMSDRM_REQUIRE_DRM_MASTER = "SDL_KMSDRM_REQUIRE_DRM_MASTER"
68
- HINT_JOYSTICK_DEVICE = "SDL_JOYSTICK_DEVICE"
69
- HINT_LINUX_JOYSTICK_CLASSIC = "SDL_LINUX_JOYSTICK_CLASSIC"
70
- HINT_LINUX_JOYSTICK_DEADZONES = "SDL_LINUX_JOYSTICK_DEADZONES"
71
- HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
72
- HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
73
- HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
74
- HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
75
- HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
76
- HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
77
- HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
78
- HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
79
- HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
80
- HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
81
- HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
82
- HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
83
- HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
84
- HINT_POLL_SENTINEL = "SDL_POLL_SENTINEL"
85
- HINT_PREFERRED_LOCALES = "SDL_PREFERRED_LOCALES"
86
- HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
87
- HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
88
- HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
89
- HINT_RENDER_LINE_METHOD = "SDL_RENDER_LINE_METHOD"
90
- HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
91
- HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
92
- HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
93
- HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
94
- HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
95
- HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
96
- HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
97
- HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
98
- HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
99
- HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
100
- HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
101
- HINT_THREAD_PRIORITY_POLICY = "SDL_THREAD_PRIORITY_POLICY"
102
- HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
103
- HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
104
- HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
105
- HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
106
- HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
107
- HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
108
- HINT_VIDEO_EGL_ALLOW_TRANSPARENCY = "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
109
- HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
110
- HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
111
- HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
112
- HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
113
- HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR = "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
114
- HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
115
- HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
116
- HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
117
- HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
118
- HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
119
- HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
120
- HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
121
- HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
122
- HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
123
- HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
124
- HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
125
- HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
126
- HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
127
- HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
128
- HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS = "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
129
- HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL = "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
130
- HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
131
- HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
132
- HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
133
- HINT_WINDOWS_USE_D3D9EX = "SDL_WINDOWS_USE_D3D9EX"
134
- HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
135
- HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN = "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
136
- HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
137
- HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
138
- HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
139
- HINT_X11_FORCE_OVERRIDE_REDIRECT = "SDL_X11_FORCE_OVERRIDE_REDIRECT"
140
- HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
141
- HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
142
- HINT_AUDIO_INCLUDE_MONITORS = "SDL_AUDIO_INCLUDE_MONITORS"
143
-
144
- # Enum
145
-
146
- HINT_DEFAULT = 0
147
- HINT_NORMAL = 1
148
- HINT_OVERRIDE = 2
149
-
150
- # Typedef
151
-
152
- typedef :int, :SDL_HintPriority
153
- callback :SDL_HintCallback, [:pointer, :pointer, :pointer, :pointer], :void
154
-
155
- # Struct
156
-
157
-
158
- # Function
159
-
160
- def self.setup_hints_symbols(output_error = false)
161
- symbols = [
162
- :SDL_SetHintWithPriority,
163
- :SDL_SetHint,
164
- :SDL_GetHint,
165
- :SDL_GetHintBoolean,
166
- :SDL_AddHintCallback,
167
- :SDL_DelHintCallback,
168
- :SDL_ClearHints,
169
- ]
170
- apis = {
171
- :SDL_SetHintWithPriority => :SetHintWithPriority,
172
- :SDL_SetHint => :SetHint,
173
- :SDL_GetHint => :GetHint,
174
- :SDL_GetHintBoolean => :GetHintBoolean,
175
- :SDL_AddHintCallback => :AddHintCallback,
176
- :SDL_DelHintCallback => :DelHintCallback,
177
- :SDL_ClearHints => :ClearHints,
178
- }
179
- args = {
180
- :SDL_SetHintWithPriority => [:pointer, :pointer, :int],
181
- :SDL_SetHint => [:pointer, :pointer],
182
- :SDL_GetHint => [:pointer],
183
- :SDL_GetHintBoolean => [:pointer, :int],
184
- :SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
185
- :SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
186
- :SDL_ClearHints => [],
187
- }
188
- retvals = {
189
- :SDL_SetHintWithPriority => :int,
190
- :SDL_SetHint => :int,
191
- :SDL_GetHint => :pointer,
192
- :SDL_GetHintBoolean => :int,
193
- :SDL_AddHintCallback => :void,
194
- :SDL_DelHintCallback => :void,
195
- :SDL_ClearHints => :void,
196
- }
197
- symbols.each do |sym|
198
- begin
199
- attach_function apis[sym], sym, args[sym], retvals[sym]
200
- rescue FFI::NotFoundError => error
201
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
202
- end
203
- end
204
- end
205
-
206
- end
207
-
1
+ # Ruby-SDL2 : Yet another SDL2 wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/sdl2-bindings
4
+ #
5
+ # [NOTICE] This is an automatically generated file.
6
+
7
+ require 'ffi'
8
+
9
+ module SDL
10
+ extend FFI::Library
11
+ # Define/Macro
12
+
13
+ HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK"
14
+ HINT_ALLOW_ALT_TAB_WHILE_GRABBED = "SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
15
+ HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"
16
+ HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
17
+ HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
18
+ HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE"
19
+ HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
20
+ HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON"
21
+ HINT_APP_NAME = "SDL_APP_NAME"
22
+ HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
23
+ HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
24
+ HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY"
25
+ HINT_AUDIO_DEVICE_APP_NAME = "SDL_AUDIO_DEVICE_APP_NAME"
26
+ HINT_AUDIO_DEVICE_STREAM_NAME = "SDL_AUDIO_DEVICE_STREAM_NAME"
27
+ HINT_AUDIO_DEVICE_STREAM_ROLE = "SDL_AUDIO_DEVICE_STREAM_ROLE"
28
+ HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE"
29
+ HINT_AUTO_UPDATE_JOYSTICKS = "SDL_AUTO_UPDATE_JOYSTICKS"
30
+ HINT_AUTO_UPDATE_SENSORS = "SDL_AUTO_UPDATE_SENSORS"
31
+ HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT"
32
+ HINT_DISPLAY_USABLE_BOUNDS = "SDL_DISPLAY_USABLE_BOUNDS"
33
+ HINT_EMSCRIPTEN_ASYNCIFY = "SDL_EMSCRIPTEN_ASYNCIFY"
34
+ HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
35
+ HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS"
36
+ HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING"
37
+ HINT_FORCE_RAISEWINDOW = "SDL_HINT_FORCE_RAISEWINDOW"
38
+ HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"
39
+ HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG"
40
+ HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE"
41
+ HINT_GAMECONTROLLERTYPE = "SDL_GAMECONTROLLERTYPE"
42
+ HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES"
43
+ HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
44
+ HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
45
+ HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
46
+ HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
47
+ HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
48
+ HINT_IME_SHOW_UI = "SDL_IME_SHOW_UI"
49
+ HINT_IME_SUPPORT_EXTENDED_TEXT = "SDL_IME_SUPPORT_EXTENDED_TEXT"
50
+ HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
51
+ HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
52
+ HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI"
53
+ HINT_JOYSTICK_HIDAPI_GAMECUBE = "SDL_JOYSTICK_HIDAPI_GAMECUBE"
54
+ HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE = "SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
55
+ HINT_JOYSTICK_HIDAPI_JOY_CONS = "SDL_JOYSTICK_HIDAPI_JOY_CONS"
56
+ HINT_JOYSTICK_HIDAPI_LUNA = "SDL_JOYSTICK_HIDAPI_LUNA"
57
+ HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
58
+ HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
59
+ HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
60
+ HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
61
+ HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
62
+ HINT_JOYSTICK_HIDAPI_STADIA = "SDL_JOYSTICK_HIDAPI_STADIA"
63
+ HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
64
+ HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
65
+ HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
66
+ HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
67
+ HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
68
+ HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
69
+ HINT_JOYSTICK_ROG_CHAKRAM = "SDL_JOYSTICK_ROG_CHAKRAM"
70
+ HINT_JOYSTICK_THREAD = "SDL_JOYSTICK_THREAD"
71
+ HINT_KMSDRM_REQUIRE_DRM_MASTER = "SDL_KMSDRM_REQUIRE_DRM_MASTER"
72
+ HINT_JOYSTICK_DEVICE = "SDL_JOYSTICK_DEVICE"
73
+ HINT_LINUX_JOYSTICK_CLASSIC = "SDL_LINUX_JOYSTICK_CLASSIC"
74
+ HINT_LINUX_JOYSTICK_DEADZONES = "SDL_LINUX_JOYSTICK_DEADZONES"
75
+ HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
76
+ HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
77
+ HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
78
+ HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
79
+ HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
80
+ HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
81
+ HINT_MOUSE_RELATIVE_MODE_CENTER = "SDL_MOUSE_RELATIVE_MODE_CENTER"
82
+ HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
83
+ HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
84
+ HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
85
+ HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
86
+ HINT_MOUSE_AUTO_CAPTURE = "SDL_MOUSE_AUTO_CAPTURE"
87
+ HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
88
+ HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
89
+ HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
90
+ HINT_POLL_SENTINEL = "SDL_POLL_SENTINEL"
91
+ HINT_PREFERRED_LOCALES = "SDL_PREFERRED_LOCALES"
92
+ HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
93
+ HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
94
+ HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
95
+ HINT_RENDER_LINE_METHOD = "SDL_RENDER_LINE_METHOD"
96
+ HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
97
+ HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
98
+ HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
99
+ HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
100
+ HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
101
+ HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
102
+ HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
103
+ HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
104
+ HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
105
+ HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
106
+ HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
107
+ HINT_THREAD_PRIORITY_POLICY = "SDL_THREAD_PRIORITY_POLICY"
108
+ HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
109
+ HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
110
+ HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
111
+ HINT_VITA_TOUCH_MOUSE_DEVICE = "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
112
+ HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
113
+ HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
114
+ HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
115
+ HINT_VIDEO_EGL_ALLOW_TRANSPARENCY = "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
116
+ HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
117
+ HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
118
+ HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
119
+ HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
120
+ HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR = "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
121
+ HINT_VIDEO_WAYLAND_PREFER_LIBDECOR = "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
122
+ HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
123
+ HINT_VIDEO_FOREIGN_WINDOW_OPENGL = "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
124
+ HINT_VIDEO_FOREIGN_WINDOW_VULKAN = "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
125
+ HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
126
+ HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
127
+ HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
128
+ HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
129
+ HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
130
+ HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
131
+ HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
132
+ HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
133
+ HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
134
+ HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
135
+ HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
136
+ HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
137
+ HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
138
+ HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS = "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
139
+ HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL = "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
140
+ HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
141
+ HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
142
+ HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
143
+ HINT_WINDOWS_USE_D3D9EX = "SDL_WINDOWS_USE_D3D9EX"
144
+ HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
145
+ HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN = "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
146
+ HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
147
+ HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
148
+ HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
149
+ HINT_X11_FORCE_OVERRIDE_REDIRECT = "SDL_X11_FORCE_OVERRIDE_REDIRECT"
150
+ HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
151
+ HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
152
+ HINT_AUDIO_INCLUDE_MONITORS = "SDL_AUDIO_INCLUDE_MONITORS"
153
+ HINT_X11_WINDOW_TYPE = "SDL_X11_WINDOW_TYPE"
154
+ HINT_QUIT_ON_LAST_WINDOW_CLOSE = "SDL_QUIT_ON_LAST_WINDOW_CLOSE"
155
+ HINT_VIDEODRIVER = "SDL_VIDEODRIVER"
156
+ HINT_AUDIODRIVER = "SDL_AUDIODRIVER"
157
+
158
+ # Enum
159
+
160
+ HINT_DEFAULT = 0
161
+ HINT_NORMAL = 1
162
+ HINT_OVERRIDE = 2
163
+
164
+ # Typedef
165
+
166
+ typedef :int, :SDL_HintPriority
167
+ callback :SDL_HintCallback, [:pointer, :pointer, :pointer, :pointer], :void
168
+
169
+ # Struct
170
+
171
+
172
+ # Function
173
+
174
+ def self.setup_hints_symbols(output_error = false)
175
+ symbols = [
176
+ :SDL_SetHintWithPriority,
177
+ :SDL_SetHint,
178
+ :SDL_GetHint,
179
+ :SDL_GetHintBoolean,
180
+ :SDL_AddHintCallback,
181
+ :SDL_DelHintCallback,
182
+ :SDL_ClearHints,
183
+ ]
184
+ apis = {
185
+ :SDL_SetHintWithPriority => :SetHintWithPriority,
186
+ :SDL_SetHint => :SetHint,
187
+ :SDL_GetHint => :GetHint,
188
+ :SDL_GetHintBoolean => :GetHintBoolean,
189
+ :SDL_AddHintCallback => :AddHintCallback,
190
+ :SDL_DelHintCallback => :DelHintCallback,
191
+ :SDL_ClearHints => :ClearHints,
192
+ }
193
+ args = {
194
+ :SDL_SetHintWithPriority => [:pointer, :pointer, :int],
195
+ :SDL_SetHint => [:pointer, :pointer],
196
+ :SDL_GetHint => [:pointer],
197
+ :SDL_GetHintBoolean => [:pointer, :int],
198
+ :SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
199
+ :SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
200
+ :SDL_ClearHints => [],
201
+ }
202
+ retvals = {
203
+ :SDL_SetHintWithPriority => :int,
204
+ :SDL_SetHint => :int,
205
+ :SDL_GetHint => :pointer,
206
+ :SDL_GetHintBoolean => :int,
207
+ :SDL_AddHintCallback => :void,
208
+ :SDL_DelHintCallback => :void,
209
+ :SDL_ClearHints => :void,
210
+ }
211
+ symbols.each do |sym|
212
+ begin
213
+ attach_function apis[sym], sym, args[sym], retvals[sym]
214
+ rescue FFI::NotFoundError => error
215
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
216
+ end
217
+ end
218
+ end
219
+
220
+ end
221
+