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.
- checksums.yaml +4 -4
- data/ChangeLog +134 -108
- data/LICENSE.txt +0 -0
- data/README.md +86 -68
- data/lib/sdl2.rb +131 -127
- data/lib/sdl2_audio.rb +261 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +129 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +564 -552
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +329 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +221 -207
- data/lib/sdl2_image.rb +296 -232
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +294 -294
- data/lib/sdl2_keyboard.rb +125 -117
- data/lib/sdl2_keycode.rb +307 -307
- data/lib/sdl2_log.rb +131 -131
- data/lib/sdl2_main.rb +74 -74
- data/lib/sdl2_messagebox.rb +102 -102
- data/lib/sdl2_misc.rb +48 -48
- data/lib/sdl2_mixer.rb +464 -392
- data/lib/sdl2_mouse.rb +136 -136
- data/lib/sdl2_pixels.rb +240 -240
- data/lib/sdl2_platform.rb +48 -48
- data/lib/sdl2_power.rb +54 -54
- data/lib/sdl2_rect.rb +145 -109
- data/lib/sdl2_render.rb +408 -404
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -238
- data/lib/sdl2_scancode.rb +289 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -0
- data/lib/sdl2_stdinc.rb +548 -564
- data/lib/sdl2_surface.rb +229 -229
- data/lib/sdl2_syswm.rb +160 -160
- data/lib/sdl2_timer.rb +74 -74
- data/lib/sdl2_touch.rb +86 -82
- data/lib/sdl2_ttf.rb +414 -357
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +540 -540
- data/lib/sdl2_vulkan.rb +72 -72
- 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
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
#
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
:
|
177
|
-
:
|
178
|
-
|
179
|
-
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
183
|
-
|
184
|
-
|
185
|
-
:
|
186
|
-
:
|
187
|
-
|
188
|
-
|
189
|
-
:
|
190
|
-
:
|
191
|
-
:
|
192
|
-
|
193
|
-
|
194
|
-
:
|
195
|
-
:
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
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
|
+
|