sdl2-bindings 0.1.3 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +145 -134
  3. data/LICENSE.txt +0 -0
  4. data/README.md +108 -86
  5. data/lib/sdl2.rb +131 -131
  6. data/lib/sdl2_audio.rb +265 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +137 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +575 -564
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +345 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_guid.rb +58 -0
  18. data/lib/sdl2_haptic.rb +301 -301
  19. data/lib/sdl2_hidapi.rb +139 -139
  20. data/lib/sdl2_hints.rb +240 -221
  21. data/lib/sdl2_image.rb +296 -296
  22. data/lib/sdl2_imageFilter.rb +164 -164
  23. data/lib/sdl2_joystick.rb +332 -294
  24. data/lib/sdl2_keyboard.rb +129 -125
  25. data/lib/sdl2_keycode.rb +311 -307
  26. data/lib/sdl2_log.rb +131 -131
  27. data/lib/sdl2_main.rb +74 -74
  28. data/lib/sdl2_messagebox.rb +102 -102
  29. data/lib/sdl2_misc.rb +48 -48
  30. data/lib/sdl2_mixer.rb +464 -464
  31. data/lib/sdl2_mouse.rb +136 -136
  32. data/lib/sdl2_pixels.rb +240 -240
  33. data/lib/sdl2_platform.rb +48 -48
  34. data/lib/sdl2_power.rb +54 -54
  35. data/lib/sdl2_rect.rb +145 -145
  36. data/lib/sdl2_render.rb +408 -408
  37. data/lib/sdl2_rotozoom.rb +76 -76
  38. data/lib/sdl2_rwops.rb +242 -242
  39. data/lib/sdl2_scancode.rb +293 -289
  40. data/lib/sdl2_sensor.rb +115 -115
  41. data/lib/sdl2_shape.rb +83 -83
  42. data/lib/sdl2_sound.rb +154 -154
  43. data/lib/sdl2_stdinc.rb +572 -548
  44. data/lib/sdl2_surface.rb +229 -229
  45. data/lib/sdl2_syswm.rb +160 -160
  46. data/lib/sdl2_timer.rb +74 -74
  47. data/lib/sdl2_touch.rb +86 -86
  48. data/lib/sdl2_ttf.rb +414 -414
  49. data/lib/sdl2_version.rb +67 -67
  50. data/lib/sdl2_video.rb +549 -540
  51. data/lib/sdl2_vulkan.rb +72 -72
  52. metadata +4 -3
data/lib/sdl2_hints.rb CHANGED
@@ -1,221 +1,240 @@
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
-
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_COMBINE_JOY_CONS = "SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
57
+ HINT_JOYSTICK_HIDAPI_LUNA = "SDL_JOYSTICK_HIDAPI_LUNA"
58
+ HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC = "SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
59
+ HINT_JOYSTICK_HIDAPI_SHIELD = "SDL_JOYSTICK_HIDAPI_SHIELD"
60
+ HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
61
+ HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
62
+ HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
63
+ HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
64
+ HINT_JOYSTICK_HIDAPI_PS5_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
65
+ HINT_JOYSTICK_HIDAPI_STADIA = "SDL_JOYSTICK_HIDAPI_STADIA"
66
+ HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
67
+ HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
68
+ HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
69
+ HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED = "SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
70
+ HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED = "SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
71
+ HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
72
+ HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
73
+ HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT = "SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
74
+ HINT_JOYSTICK_ROG_CHAKRAM = "SDL_JOYSTICK_ROG_CHAKRAM"
75
+ HINT_JOYSTICK_THREAD = "SDL_JOYSTICK_THREAD"
76
+ HINT_KMSDRM_REQUIRE_DRM_MASTER = "SDL_KMSDRM_REQUIRE_DRM_MASTER"
77
+ HINT_JOYSTICK_DEVICE = "SDL_JOYSTICK_DEVICE"
78
+ HINT_LINUX_DIGITAL_HATS = "SDL_LINUX_DIGITAL_HATS"
79
+ HINT_LINUX_HAT_DEADZONES = "SDL_LINUX_HAT_DEADZONES"
80
+ HINT_LINUX_JOYSTICK_CLASSIC = "SDL_LINUX_JOYSTICK_CLASSIC"
81
+ HINT_LINUX_JOYSTICK_DEADZONES = "SDL_LINUX_JOYSTICK_DEADZONES"
82
+ HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
83
+ HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
84
+ HINT_MAC_OPENGL_ASYNC_DISPATCH = "SDL_MAC_OPENGL_ASYNC_DISPATCH"
85
+ HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
86
+ HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
87
+ HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
88
+ HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
89
+ HINT_MOUSE_RELATIVE_MODE_CENTER = "SDL_MOUSE_RELATIVE_MODE_CENTER"
90
+ HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
91
+ HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
92
+ HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
93
+ HINT_MOUSE_RELATIVE_WARP_MOTION = "SDL_MOUSE_RELATIVE_WARP_MOTION"
94
+ HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
95
+ HINT_MOUSE_AUTO_CAPTURE = "SDL_MOUSE_AUTO_CAPTURE"
96
+ HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
97
+ HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
98
+ HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
99
+ HINT_POLL_SENTINEL = "SDL_POLL_SENTINEL"
100
+ HINT_PREFERRED_LOCALES = "SDL_PREFERRED_LOCALES"
101
+ HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
102
+ HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
103
+ HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
104
+ HINT_RENDER_LINE_METHOD = "SDL_RENDER_LINE_METHOD"
105
+ HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
106
+ HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
107
+ HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
108
+ HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
109
+ HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
110
+ HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
111
+ HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
112
+ HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
113
+ HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
114
+ HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME = "SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
115
+ HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
116
+ HINT_THREAD_PRIORITY_POLICY = "SDL_THREAD_PRIORITY_POLICY"
117
+ HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
118
+ HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
119
+ HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
120
+ HINT_VITA_TOUCH_MOUSE_DEVICE = "SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
121
+ HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
122
+ HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
123
+ HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
124
+ HINT_VIDEO_EGL_ALLOW_TRANSPARENCY = "SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
125
+ HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
126
+ HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
127
+ HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
128
+ HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
129
+ HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR = "SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
130
+ HINT_VIDEO_WAYLAND_PREFER_LIBDECOR = "SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
131
+ HINT_VIDEO_WAYLAND_MODE_EMULATION = "SDL_VIDEO_WAYLAND_MODE_EMULATION"
132
+ HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
133
+ HINT_VIDEO_FOREIGN_WINDOW_OPENGL = "SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
134
+ HINT_VIDEO_FOREIGN_WINDOW_VULKAN = "SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
135
+ HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
136
+ HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
137
+ HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
138
+ HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
139
+ HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
140
+ HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
141
+ HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
142
+ HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
143
+ HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
144
+ HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
145
+ HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
146
+ HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
147
+ HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
148
+ HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS = "SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
149
+ HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL = "SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
150
+ HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
151
+ HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
152
+ HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
153
+ HINT_WINDOWS_USE_D3D9EX = "SDL_WINDOWS_USE_D3D9EX"
154
+ HINT_WINDOWS_DPI_AWARENESS = "SDL_WINDOWS_DPI_AWARENESS"
155
+ HINT_WINDOWS_DPI_SCALING = "SDL_WINDOWS_DPI_SCALING"
156
+ HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
157
+ HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN = "SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
158
+ HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
159
+ HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
160
+ HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
161
+ HINT_X11_FORCE_OVERRIDE_REDIRECT = "SDL_X11_FORCE_OVERRIDE_REDIRECT"
162
+ HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
163
+ HINT_DIRECTINPUT_ENABLED = "SDL_DIRECTINPUT_ENABLED"
164
+ HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
165
+ HINT_AUDIO_INCLUDE_MONITORS = "SDL_AUDIO_INCLUDE_MONITORS"
166
+ HINT_X11_WINDOW_TYPE = "SDL_X11_WINDOW_TYPE"
167
+ HINT_QUIT_ON_LAST_WINDOW_CLOSE = "SDL_QUIT_ON_LAST_WINDOW_CLOSE"
168
+ HINT_VIDEODRIVER = "SDL_VIDEODRIVER"
169
+ HINT_AUDIODRIVER = "SDL_AUDIODRIVER"
170
+ HINT_KMSDRM_DEVICE_INDEX = "SDL_KMSDRM_DEVICE_INDEX"
171
+ HINT_TRACKPAD_IS_TOUCH_ONLY = "SDL_TRACKPAD_IS_TOUCH_ONLY"
172
+
173
+ # Enum
174
+
175
+ HINT_DEFAULT = 0
176
+ HINT_NORMAL = 1
177
+ HINT_OVERRIDE = 2
178
+
179
+ # Typedef
180
+
181
+ typedef :int, :SDL_HintPriority
182
+ callback :SDL_HintCallback, [:pointer, :pointer, :pointer, :pointer], :void
183
+
184
+ # Struct
185
+
186
+
187
+ # Function
188
+
189
+ def self.setup_hints_symbols(output_error = false)
190
+ symbols = [
191
+ :SDL_SetHintWithPriority,
192
+ :SDL_SetHint,
193
+ :SDL_ResetHint,
194
+ :SDL_GetHint,
195
+ :SDL_GetHintBoolean,
196
+ :SDL_AddHintCallback,
197
+ :SDL_DelHintCallback,
198
+ :SDL_ClearHints,
199
+ ]
200
+ apis = {
201
+ :SDL_SetHintWithPriority => :SetHintWithPriority,
202
+ :SDL_SetHint => :SetHint,
203
+ :SDL_ResetHint => :ResetHint,
204
+ :SDL_GetHint => :GetHint,
205
+ :SDL_GetHintBoolean => :GetHintBoolean,
206
+ :SDL_AddHintCallback => :AddHintCallback,
207
+ :SDL_DelHintCallback => :DelHintCallback,
208
+ :SDL_ClearHints => :ClearHints,
209
+ }
210
+ args = {
211
+ :SDL_SetHintWithPriority => [:pointer, :pointer, :int],
212
+ :SDL_SetHint => [:pointer, :pointer],
213
+ :SDL_ResetHint => [:pointer],
214
+ :SDL_GetHint => [:pointer],
215
+ :SDL_GetHintBoolean => [:pointer, :int],
216
+ :SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
217
+ :SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
218
+ :SDL_ClearHints => [],
219
+ }
220
+ retvals = {
221
+ :SDL_SetHintWithPriority => :int,
222
+ :SDL_SetHint => :int,
223
+ :SDL_ResetHint => :int,
224
+ :SDL_GetHint => :pointer,
225
+ :SDL_GetHintBoolean => :int,
226
+ :SDL_AddHintCallback => :void,
227
+ :SDL_DelHintCallback => :void,
228
+ :SDL_ClearHints => :void,
229
+ }
230
+ symbols.each do |sym|
231
+ begin
232
+ attach_function apis[sym], sym, args[sym], retvals[sym]
233
+ rescue FFI::NotFoundError => error
234
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
235
+ end
236
+ end
237
+ end
238
+
239
+ end
240
+