sdl2-bindings 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +83 -79
- data/LICENSE.txt +1 -1
- data/README.md +49 -49
- data/lib/sdl2.rb +170 -170
- data/lib/sdl2_audio.rb +219 -201
- data/lib/sdl2_blendmode.rb +69 -69
- data/lib/sdl2_clipboard.rb +51 -51
- data/lib/sdl2_cpuinfo.rb +106 -106
- data/lib/sdl2_error.rb +64 -64
- data/lib/sdl2_events.rb +530 -530
- data/lib/sdl2_filesystem.rb +48 -48
- data/lib/sdl2_framerate.rb +67 -67
- data/lib/sdl2_gamecontroller.rb +254 -254
- data/lib/sdl2_gesture.rb +55 -55
- data/lib/sdl2_gfxPrimitives.rb +222 -222
- data/lib/sdl2_haptic.rb +269 -269
- data/lib/sdl2_hints.rb +174 -174
- data/lib/sdl2_image.rb +185 -185
- data/lib/sdl2_imageFilter.rb +132 -132
- data/lib/sdl2_joystick.rb +230 -230
- data/lib/sdl2_keyboard.rb +99 -99
- data/lib/sdl2_keycode.rb +304 -304
- data/lib/sdl2_log.rb +115 -115
- data/lib/sdl2_main.rb +67 -67
- data/lib/sdl2_messagebox.rb +98 -98
- data/lib/sdl2_mixer.rb +317 -307
- data/lib/sdl2_mouse.rb +117 -117
- data/lib/sdl2_pixels.rb +224 -224
- data/lib/sdl2_platform.rb +45 -45
- data/lib/sdl2_power.rb +51 -51
- data/lib/sdl2_rect.rb +102 -102
- data/lib/sdl2_render.rb +290 -290
- data/lib/sdl2_rotozoom.rb +66 -66
- data/lib/sdl2_rwops.rb +208 -208
- data/lib/sdl2_scancode.rb +287 -287
- data/lib/sdl2_shape.rb +77 -77
- data/lib/sdl2_stdinc.rb +393 -393
- data/lib/sdl2_surface.rb +182 -182
- data/lib/sdl2_syswm.rb +154 -154
- data/lib/sdl2_timer.rb +62 -62
- data/lib/sdl2_touch.rb +73 -73
- data/lib/sdl2_ttf.rb +202 -190
- data/lib/sdl2_version.rb +62 -62
- data/lib/sdl2_video.rb +411 -411
- data/lib/sdl2_vulkan.rb +64 -64
- metadata +6 -6
data/lib/sdl2_hints.rb
CHANGED
@@ -1,174 +1,174 @@
|
|
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 SDL2
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
SDL_HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"
|
14
|
-
SDL_HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
|
15
|
-
SDL_HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
|
16
|
-
SDL_HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
|
17
|
-
SDL_HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
|
18
|
-
SDL_HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
|
19
|
-
SDL_HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
|
20
|
-
SDL_HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
|
21
|
-
SDL_HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
|
22
|
-
SDL_HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
|
23
|
-
SDL_HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
|
24
|
-
SDL_HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
|
25
|
-
SDL_HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
|
26
|
-
SDL_HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
|
27
|
-
SDL_HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
|
28
|
-
SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
|
29
|
-
SDL_HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
|
30
|
-
SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
|
31
|
-
SDL_HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
|
32
|
-
SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
|
33
|
-
SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
|
34
|
-
SDL_HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
|
35
|
-
SDL_HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
|
36
|
-
SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
|
37
|
-
SDL_HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
|
38
|
-
SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
|
39
|
-
SDL_HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
|
40
|
-
SDL_HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
|
41
|
-
SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
|
42
|
-
SDL_HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
|
43
|
-
SDL_HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
|
44
|
-
SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
|
45
|
-
SDL_HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
|
46
|
-
SDL_HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
|
47
|
-
SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
|
48
|
-
SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
|
49
|
-
SDL_HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
|
50
|
-
SDL_HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK"
|
51
|
-
SDL_HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
|
52
|
-
SDL_HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
|
53
|
-
SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
|
54
|
-
SDL_HINT_GAMECONTROLLERTYPE = "SDL_GAMECONTROLLERTYPE"
|
55
|
-
SDL_HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG"
|
56
|
-
SDL_HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE"
|
57
|
-
SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES"
|
58
|
-
SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
|
59
|
-
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
|
60
|
-
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
|
61
|
-
SDL_HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI"
|
62
|
-
SDL_HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
|
63
|
-
SDL_HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
|
64
|
-
SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
|
65
|
-
SDL_HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
|
66
|
-
SDL_HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
|
67
|
-
SDL_HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
|
68
|
-
SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT = "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT"
|
69
|
-
SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE = "SDL_JOYSTICK_HIDAPI_GAMECUBE"
|
70
|
-
SDL_HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS"
|
71
|
-
SDL_HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
|
72
|
-
SDL_HINT_JOYSTICK_THREAD = "SDL_JOYSTICK_THREAD"
|
73
|
-
SDL_HINT_LINUX_JOYSTICK_DEADZONES = "SDL_LINUX_JOYSTICK_DEADZONES"
|
74
|
-
SDL_HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"
|
75
|
-
SDL_HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
|
76
|
-
SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
|
77
|
-
SDL_HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
|
78
|
-
SDL_HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
|
79
|
-
SDL_HINT_THREAD_PRIORITY_POLICY = "SDL_THREAD_PRIORITY_POLICY"
|
80
|
-
SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
|
81
|
-
SDL_HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
|
82
|
-
SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
|
83
|
-
SDL_HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
|
84
|
-
SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
|
85
|
-
SDL_HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
|
86
|
-
SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
|
87
|
-
SDL_HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
|
88
|
-
SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
|
89
|
-
SDL_HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
|
90
|
-
SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
|
91
|
-
SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
|
92
|
-
SDL_HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
|
93
|
-
SDL_HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON"
|
94
|
-
SDL_HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE"
|
95
|
-
SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
|
96
|
-
SDL_HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
|
97
|
-
SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
|
98
|
-
SDL_HINT_EMSCRIPTEN_ASYNCIFY = "SDL_EMSCRIPTEN_ASYNCIFY"
|
99
|
-
SDL_HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
|
100
|
-
SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
|
101
|
-
SDL_HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT"
|
102
|
-
SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
103
|
-
SDL_HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
|
104
|
-
SDL_HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
|
105
|
-
SDL_HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
|
106
|
-
SDL_HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE"
|
107
|
-
SDL_HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY"
|
108
|
-
SDL_HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
|
109
|
-
SDL_HINT_AUTO_UPDATE_JOYSTICKS = "SDL_AUTO_UPDATE_JOYSTICKS"
|
110
|
-
SDL_HINT_AUTO_UPDATE_SENSORS = "SDL_AUTO_UPDATE_SENSORS"
|
111
|
-
SDL_HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING"
|
112
|
-
SDL_HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
|
113
|
-
SDL_HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
|
114
|
-
SDL_HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
|
115
|
-
SDL_HINT_DISPLAY_USABLE_BOUNDS = "SDL_DISPLAY_USABLE_BOUNDS"
|
116
|
-
SDL_HINT_AUDIO_DEVICE_APP_NAME = "SDL_AUDIO_DEVICE_APP_NAME"
|
117
|
-
SDL_HINT_AUDIO_DEVICE_STREAM_NAME = "SDL_AUDIO_DEVICE_STREAM_NAME"
|
118
|
-
SDL_HINT_PREFERRED_LOCALES = "SDL_PREFERRED_LOCALES"
|
119
|
-
|
120
|
-
# Enum
|
121
|
-
|
122
|
-
SDL_HINT_DEFAULT = 0
|
123
|
-
SDL_HINT_NORMAL = 1
|
124
|
-
SDL_HINT_OVERRIDE = 2
|
125
|
-
|
126
|
-
# Typedef
|
127
|
-
|
128
|
-
typedef :int, :SDL_HintPriority
|
129
|
-
callback :SDL_HintCallback, [:pointer, :pointer, :pointer, :pointer], :void
|
130
|
-
|
131
|
-
# Struct
|
132
|
-
|
133
|
-
|
134
|
-
# Function
|
135
|
-
|
136
|
-
def self.setup_hints_symbols()
|
137
|
-
symbols = [
|
138
|
-
:SDL_SetHintWithPriority,
|
139
|
-
:SDL_SetHint,
|
140
|
-
:SDL_GetHint,
|
141
|
-
:SDL_GetHintBoolean,
|
142
|
-
:SDL_AddHintCallback,
|
143
|
-
:SDL_DelHintCallback,
|
144
|
-
:SDL_ClearHints,
|
145
|
-
]
|
146
|
-
args = {
|
147
|
-
:SDL_SetHintWithPriority => [:pointer, :pointer, :int],
|
148
|
-
:SDL_SetHint => [:pointer, :pointer],
|
149
|
-
:SDL_GetHint => [:pointer],
|
150
|
-
:SDL_GetHintBoolean => [:pointer, :int],
|
151
|
-
:SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
|
152
|
-
:SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
|
153
|
-
:SDL_ClearHints => [],
|
154
|
-
}
|
155
|
-
retvals = {
|
156
|
-
:SDL_SetHintWithPriority => :int,
|
157
|
-
:SDL_SetHint => :int,
|
158
|
-
:SDL_GetHint => :pointer,
|
159
|
-
:SDL_GetHintBoolean => :int,
|
160
|
-
:SDL_AddHintCallback => :void,
|
161
|
-
:SDL_DelHintCallback => :void,
|
162
|
-
:SDL_ClearHints => :void,
|
163
|
-
}
|
164
|
-
symbols.each do |sym|
|
165
|
-
begin
|
166
|
-
attach_function sym, args[sym], retvals[sym]
|
167
|
-
rescue FFI::NotFoundError => error
|
168
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
169
|
-
end
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
end
|
174
|
-
|
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 SDL2
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
SDL_HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"
|
14
|
+
SDL_HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
|
15
|
+
SDL_HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
|
16
|
+
SDL_HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
|
17
|
+
SDL_HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
|
18
|
+
SDL_HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
|
19
|
+
SDL_HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
|
20
|
+
SDL_HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
|
21
|
+
SDL_HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
|
22
|
+
SDL_HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
|
23
|
+
SDL_HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
|
24
|
+
SDL_HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
|
25
|
+
SDL_HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
|
26
|
+
SDL_HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
|
27
|
+
SDL_HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
|
28
|
+
SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
|
29
|
+
SDL_HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
|
30
|
+
SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
|
31
|
+
SDL_HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
|
32
|
+
SDL_HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
|
33
|
+
SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
|
34
|
+
SDL_HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
|
35
|
+
SDL_HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
|
36
|
+
SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
|
37
|
+
SDL_HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
|
38
|
+
SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
|
39
|
+
SDL_HINT_MOUSE_RELATIVE_SCALING = "SDL_MOUSE_RELATIVE_SCALING"
|
40
|
+
SDL_HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
|
41
|
+
SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
|
42
|
+
SDL_HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
|
43
|
+
SDL_HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
|
44
|
+
SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
|
45
|
+
SDL_HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
|
46
|
+
SDL_HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
|
47
|
+
SDL_HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
|
48
|
+
SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
|
49
|
+
SDL_HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
|
50
|
+
SDL_HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK"
|
51
|
+
SDL_HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
|
52
|
+
SDL_HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
|
53
|
+
SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
|
54
|
+
SDL_HINT_GAMECONTROLLERTYPE = "SDL_GAMECONTROLLERTYPE"
|
55
|
+
SDL_HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG"
|
56
|
+
SDL_HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE"
|
57
|
+
SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES"
|
58
|
+
SDL_HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
|
59
|
+
SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
|
60
|
+
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
|
61
|
+
SDL_HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI"
|
62
|
+
SDL_HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
|
63
|
+
SDL_HINT_JOYSTICK_HIDAPI_PS5 = "SDL_JOYSTICK_HIDAPI_PS5"
|
64
|
+
SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
|
65
|
+
SDL_HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
|
66
|
+
SDL_HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
|
67
|
+
SDL_HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
|
68
|
+
SDL_HINT_JOYSTICK_HIDAPI_CORRELATE_XINPUT = "SDL_JOYSTICK_HIDAPI_CORRELATE_XINPUT"
|
69
|
+
SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE = "SDL_JOYSTICK_HIDAPI_GAMECUBE"
|
70
|
+
SDL_HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS"
|
71
|
+
SDL_HINT_JOYSTICK_RAWINPUT = "SDL_JOYSTICK_RAWINPUT"
|
72
|
+
SDL_HINT_JOYSTICK_THREAD = "SDL_JOYSTICK_THREAD"
|
73
|
+
SDL_HINT_LINUX_JOYSTICK_DEADZONES = "SDL_LINUX_JOYSTICK_DEADZONES"
|
74
|
+
SDL_HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"
|
75
|
+
SDL_HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
|
76
|
+
SDL_HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
|
77
|
+
SDL_HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
|
78
|
+
SDL_HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
|
79
|
+
SDL_HINT_THREAD_PRIORITY_POLICY = "SDL_THREAD_PRIORITY_POLICY"
|
80
|
+
SDL_HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL = "SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
|
81
|
+
SDL_HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
|
82
|
+
SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
|
83
|
+
SDL_HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
|
84
|
+
SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
|
85
|
+
SDL_HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
|
86
|
+
SDL_HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
|
87
|
+
SDL_HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
|
88
|
+
SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
|
89
|
+
SDL_HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
|
90
|
+
SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
|
91
|
+
SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
|
92
|
+
SDL_HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
|
93
|
+
SDL_HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON"
|
94
|
+
SDL_HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE"
|
95
|
+
SDL_HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO = "SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
|
96
|
+
SDL_HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
|
97
|
+
SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
|
98
|
+
SDL_HINT_EMSCRIPTEN_ASYNCIFY = "SDL_EMSCRIPTEN_ASYNCIFY"
|
99
|
+
SDL_HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
|
100
|
+
SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
|
101
|
+
SDL_HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT"
|
102
|
+
SDL_HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
|
103
|
+
SDL_HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
|
104
|
+
SDL_HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
|
105
|
+
SDL_HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
|
106
|
+
SDL_HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE"
|
107
|
+
SDL_HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY"
|
108
|
+
SDL_HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
|
109
|
+
SDL_HINT_AUTO_UPDATE_JOYSTICKS = "SDL_AUTO_UPDATE_JOYSTICKS"
|
110
|
+
SDL_HINT_AUTO_UPDATE_SENSORS = "SDL_AUTO_UPDATE_SENSORS"
|
111
|
+
SDL_HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING"
|
112
|
+
SDL_HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
|
113
|
+
SDL_HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
|
114
|
+
SDL_HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
|
115
|
+
SDL_HINT_DISPLAY_USABLE_BOUNDS = "SDL_DISPLAY_USABLE_BOUNDS"
|
116
|
+
SDL_HINT_AUDIO_DEVICE_APP_NAME = "SDL_AUDIO_DEVICE_APP_NAME"
|
117
|
+
SDL_HINT_AUDIO_DEVICE_STREAM_NAME = "SDL_AUDIO_DEVICE_STREAM_NAME"
|
118
|
+
SDL_HINT_PREFERRED_LOCALES = "SDL_PREFERRED_LOCALES"
|
119
|
+
|
120
|
+
# Enum
|
121
|
+
|
122
|
+
SDL_HINT_DEFAULT = 0
|
123
|
+
SDL_HINT_NORMAL = 1
|
124
|
+
SDL_HINT_OVERRIDE = 2
|
125
|
+
|
126
|
+
# Typedef
|
127
|
+
|
128
|
+
typedef :int, :SDL_HintPriority
|
129
|
+
callback :SDL_HintCallback, [:pointer, :pointer, :pointer, :pointer], :void
|
130
|
+
|
131
|
+
# Struct
|
132
|
+
|
133
|
+
|
134
|
+
# Function
|
135
|
+
|
136
|
+
def self.setup_hints_symbols()
|
137
|
+
symbols = [
|
138
|
+
:SDL_SetHintWithPriority,
|
139
|
+
:SDL_SetHint,
|
140
|
+
:SDL_GetHint,
|
141
|
+
:SDL_GetHintBoolean,
|
142
|
+
:SDL_AddHintCallback,
|
143
|
+
:SDL_DelHintCallback,
|
144
|
+
:SDL_ClearHints,
|
145
|
+
]
|
146
|
+
args = {
|
147
|
+
:SDL_SetHintWithPriority => [:pointer, :pointer, :int],
|
148
|
+
:SDL_SetHint => [:pointer, :pointer],
|
149
|
+
:SDL_GetHint => [:pointer],
|
150
|
+
:SDL_GetHintBoolean => [:pointer, :int],
|
151
|
+
:SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
|
152
|
+
:SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
|
153
|
+
:SDL_ClearHints => [],
|
154
|
+
}
|
155
|
+
retvals = {
|
156
|
+
:SDL_SetHintWithPriority => :int,
|
157
|
+
:SDL_SetHint => :int,
|
158
|
+
:SDL_GetHint => :pointer,
|
159
|
+
:SDL_GetHintBoolean => :int,
|
160
|
+
:SDL_AddHintCallback => :void,
|
161
|
+
:SDL_DelHintCallback => :void,
|
162
|
+
:SDL_ClearHints => :void,
|
163
|
+
}
|
164
|
+
symbols.each do |sym|
|
165
|
+
begin
|
166
|
+
attach_function sym, args[sym], retvals[sym]
|
167
|
+
rescue FFI::NotFoundError => error
|
168
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
end
|
174
|
+
|
data/lib/sdl2_image.rb
CHANGED
@@ -1,185 +1,185 @@
|
|
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 SDL2
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
SDL_IMAGE_MAJOR_VERSION = 2
|
14
|
-
SDL_IMAGE_MINOR_VERSION = 0
|
15
|
-
SDL_IMAGE_PATCHLEVEL = 5
|
16
|
-
|
17
|
-
# Enum
|
18
|
-
|
19
|
-
IMG_INIT_JPG = 1
|
20
|
-
IMG_INIT_PNG = 2
|
21
|
-
IMG_INIT_TIF = 4
|
22
|
-
IMG_INIT_WEBP = 8
|
23
|
-
|
24
|
-
# Typedef
|
25
|
-
|
26
|
-
typedef :int, :IMG_InitFlags
|
27
|
-
|
28
|
-
# Struct
|
29
|
-
|
30
|
-
|
31
|
-
# Function
|
32
|
-
|
33
|
-
def self.setup_image_symbols()
|
34
|
-
symbols = [
|
35
|
-
:IMG_Linked_Version,
|
36
|
-
:IMG_Init,
|
37
|
-
:IMG_Quit,
|
38
|
-
:IMG_LoadTyped_RW,
|
39
|
-
:IMG_Load,
|
40
|
-
:IMG_Load_RW,
|
41
|
-
:IMG_LoadTexture,
|
42
|
-
:IMG_LoadTexture_RW,
|
43
|
-
:IMG_LoadTextureTyped_RW,
|
44
|
-
:IMG_isICO,
|
45
|
-
:IMG_isCUR,
|
46
|
-
:IMG_isBMP,
|
47
|
-
:IMG_isGIF,
|
48
|
-
:IMG_isJPG,
|
49
|
-
:IMG_isLBM,
|
50
|
-
:IMG_isPCX,
|
51
|
-
:IMG_isPNG,
|
52
|
-
:IMG_isPNM,
|
53
|
-
:IMG_isSVG,
|
54
|
-
:IMG_isTIF,
|
55
|
-
:IMG_isXCF,
|
56
|
-
:IMG_isXPM,
|
57
|
-
:IMG_isXV,
|
58
|
-
:IMG_isWEBP,
|
59
|
-
:IMG_LoadICO_RW,
|
60
|
-
:IMG_LoadCUR_RW,
|
61
|
-
:IMG_LoadBMP_RW,
|
62
|
-
:IMG_LoadGIF_RW,
|
63
|
-
:IMG_LoadJPG_RW,
|
64
|
-
:IMG_LoadLBM_RW,
|
65
|
-
:IMG_LoadPCX_RW,
|
66
|
-
:IMG_LoadPNG_RW,
|
67
|
-
:IMG_LoadPNM_RW,
|
68
|
-
:IMG_LoadSVG_RW,
|
69
|
-
:IMG_LoadTGA_RW,
|
70
|
-
:IMG_LoadTIF_RW,
|
71
|
-
:IMG_LoadXCF_RW,
|
72
|
-
:IMG_LoadXPM_RW,
|
73
|
-
:IMG_LoadXV_RW,
|
74
|
-
:IMG_LoadWEBP_RW,
|
75
|
-
:IMG_ReadXPMFromArray,
|
76
|
-
:IMG_SavePNG,
|
77
|
-
:IMG_SavePNG_RW,
|
78
|
-
:IMG_SaveJPG,
|
79
|
-
:IMG_SaveJPG_RW,
|
80
|
-
]
|
81
|
-
args = {
|
82
|
-
:IMG_Linked_Version => [],
|
83
|
-
:IMG_Init => [:int],
|
84
|
-
:IMG_Quit => [],
|
85
|
-
:IMG_LoadTyped_RW => [:pointer, :int, :pointer],
|
86
|
-
:IMG_Load => [:pointer],
|
87
|
-
:IMG_Load_RW => [:pointer, :int],
|
88
|
-
:IMG_LoadTexture => [:pointer, :pointer],
|
89
|
-
:IMG_LoadTexture_RW => [:pointer, :pointer, :int],
|
90
|
-
:IMG_LoadTextureTyped_RW => [:pointer, :pointer, :int, :pointer],
|
91
|
-
:IMG_isICO => [:pointer],
|
92
|
-
:IMG_isCUR => [:pointer],
|
93
|
-
:IMG_isBMP => [:pointer],
|
94
|
-
:IMG_isGIF => [:pointer],
|
95
|
-
:IMG_isJPG => [:pointer],
|
96
|
-
:IMG_isLBM => [:pointer],
|
97
|
-
:IMG_isPCX => [:pointer],
|
98
|
-
:IMG_isPNG => [:pointer],
|
99
|
-
:IMG_isPNM => [:pointer],
|
100
|
-
:IMG_isSVG => [:pointer],
|
101
|
-
:IMG_isTIF => [:pointer],
|
102
|
-
:IMG_isXCF => [:pointer],
|
103
|
-
:IMG_isXPM => [:pointer],
|
104
|
-
:IMG_isXV => [:pointer],
|
105
|
-
:IMG_isWEBP => [:pointer],
|
106
|
-
:IMG_LoadICO_RW => [:pointer],
|
107
|
-
:IMG_LoadCUR_RW => [:pointer],
|
108
|
-
:IMG_LoadBMP_RW => [:pointer],
|
109
|
-
:IMG_LoadGIF_RW => [:pointer],
|
110
|
-
:IMG_LoadJPG_RW => [:pointer],
|
111
|
-
:IMG_LoadLBM_RW => [:pointer],
|
112
|
-
:IMG_LoadPCX_RW => [:pointer],
|
113
|
-
:IMG_LoadPNG_RW => [:pointer],
|
114
|
-
:IMG_LoadPNM_RW => [:pointer],
|
115
|
-
:IMG_LoadSVG_RW => [:pointer],
|
116
|
-
:IMG_LoadTGA_RW => [:pointer],
|
117
|
-
:IMG_LoadTIF_RW => [:pointer],
|
118
|
-
:IMG_LoadXCF_RW => [:pointer],
|
119
|
-
:IMG_LoadXPM_RW => [:pointer],
|
120
|
-
:IMG_LoadXV_RW => [:pointer],
|
121
|
-
:IMG_LoadWEBP_RW => [:pointer],
|
122
|
-
:IMG_ReadXPMFromArray => [:pointer],
|
123
|
-
:IMG_SavePNG => [:pointer, :pointer],
|
124
|
-
:IMG_SavePNG_RW => [:pointer, :pointer, :int],
|
125
|
-
:IMG_SaveJPG => [:pointer, :pointer, :int],
|
126
|
-
:IMG_SaveJPG_RW => [:pointer, :pointer, :int, :int],
|
127
|
-
}
|
128
|
-
retvals = {
|
129
|
-
:IMG_Linked_Version => :pointer,
|
130
|
-
:IMG_Init => :int,
|
131
|
-
:IMG_Quit => :void,
|
132
|
-
:IMG_LoadTyped_RW => :pointer,
|
133
|
-
:IMG_Load => :pointer,
|
134
|
-
:IMG_Load_RW => :pointer,
|
135
|
-
:IMG_LoadTexture => :pointer,
|
136
|
-
:IMG_LoadTexture_RW => :pointer,
|
137
|
-
:IMG_LoadTextureTyped_RW => :pointer,
|
138
|
-
:IMG_isICO => :int,
|
139
|
-
:IMG_isCUR => :int,
|
140
|
-
:IMG_isBMP => :int,
|
141
|
-
:IMG_isGIF => :int,
|
142
|
-
:IMG_isJPG => :int,
|
143
|
-
:IMG_isLBM => :int,
|
144
|
-
:IMG_isPCX => :int,
|
145
|
-
:IMG_isPNG => :int,
|
146
|
-
:IMG_isPNM => :int,
|
147
|
-
:IMG_isSVG => :int,
|
148
|
-
:IMG_isTIF => :int,
|
149
|
-
:IMG_isXCF => :int,
|
150
|
-
:IMG_isXPM => :int,
|
151
|
-
:IMG_isXV => :int,
|
152
|
-
:IMG_isWEBP => :int,
|
153
|
-
:IMG_LoadICO_RW => :pointer,
|
154
|
-
:IMG_LoadCUR_RW => :pointer,
|
155
|
-
:IMG_LoadBMP_RW => :pointer,
|
156
|
-
:IMG_LoadGIF_RW => :pointer,
|
157
|
-
:IMG_LoadJPG_RW => :pointer,
|
158
|
-
:IMG_LoadLBM_RW => :pointer,
|
159
|
-
:IMG_LoadPCX_RW => :pointer,
|
160
|
-
:IMG_LoadPNG_RW => :pointer,
|
161
|
-
:IMG_LoadPNM_RW => :pointer,
|
162
|
-
:IMG_LoadSVG_RW => :pointer,
|
163
|
-
:IMG_LoadTGA_RW => :pointer,
|
164
|
-
:IMG_LoadTIF_RW => :pointer,
|
165
|
-
:IMG_LoadXCF_RW => :pointer,
|
166
|
-
:IMG_LoadXPM_RW => :pointer,
|
167
|
-
:IMG_LoadXV_RW => :pointer,
|
168
|
-
:IMG_LoadWEBP_RW => :pointer,
|
169
|
-
:IMG_ReadXPMFromArray => :pointer,
|
170
|
-
:IMG_SavePNG => :int,
|
171
|
-
:IMG_SavePNG_RW => :int,
|
172
|
-
:IMG_SaveJPG => :int,
|
173
|
-
:IMG_SaveJPG_RW => :int,
|
174
|
-
}
|
175
|
-
symbols.each do |sym|
|
176
|
-
begin
|
177
|
-
attach_function sym, args[sym], retvals[sym]
|
178
|
-
rescue FFI::NotFoundError => error
|
179
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
180
|
-
end
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
end
|
185
|
-
|
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 SDL2
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
SDL_IMAGE_MAJOR_VERSION = 2
|
14
|
+
SDL_IMAGE_MINOR_VERSION = 0
|
15
|
+
SDL_IMAGE_PATCHLEVEL = 5
|
16
|
+
|
17
|
+
# Enum
|
18
|
+
|
19
|
+
IMG_INIT_JPG = 1
|
20
|
+
IMG_INIT_PNG = 2
|
21
|
+
IMG_INIT_TIF = 4
|
22
|
+
IMG_INIT_WEBP = 8
|
23
|
+
|
24
|
+
# Typedef
|
25
|
+
|
26
|
+
typedef :int, :IMG_InitFlags
|
27
|
+
|
28
|
+
# Struct
|
29
|
+
|
30
|
+
|
31
|
+
# Function
|
32
|
+
|
33
|
+
def self.setup_image_symbols()
|
34
|
+
symbols = [
|
35
|
+
:IMG_Linked_Version,
|
36
|
+
:IMG_Init,
|
37
|
+
:IMG_Quit,
|
38
|
+
:IMG_LoadTyped_RW,
|
39
|
+
:IMG_Load,
|
40
|
+
:IMG_Load_RW,
|
41
|
+
:IMG_LoadTexture,
|
42
|
+
:IMG_LoadTexture_RW,
|
43
|
+
:IMG_LoadTextureTyped_RW,
|
44
|
+
:IMG_isICO,
|
45
|
+
:IMG_isCUR,
|
46
|
+
:IMG_isBMP,
|
47
|
+
:IMG_isGIF,
|
48
|
+
:IMG_isJPG,
|
49
|
+
:IMG_isLBM,
|
50
|
+
:IMG_isPCX,
|
51
|
+
:IMG_isPNG,
|
52
|
+
:IMG_isPNM,
|
53
|
+
:IMG_isSVG,
|
54
|
+
:IMG_isTIF,
|
55
|
+
:IMG_isXCF,
|
56
|
+
:IMG_isXPM,
|
57
|
+
:IMG_isXV,
|
58
|
+
:IMG_isWEBP,
|
59
|
+
:IMG_LoadICO_RW,
|
60
|
+
:IMG_LoadCUR_RW,
|
61
|
+
:IMG_LoadBMP_RW,
|
62
|
+
:IMG_LoadGIF_RW,
|
63
|
+
:IMG_LoadJPG_RW,
|
64
|
+
:IMG_LoadLBM_RW,
|
65
|
+
:IMG_LoadPCX_RW,
|
66
|
+
:IMG_LoadPNG_RW,
|
67
|
+
:IMG_LoadPNM_RW,
|
68
|
+
:IMG_LoadSVG_RW,
|
69
|
+
:IMG_LoadTGA_RW,
|
70
|
+
:IMG_LoadTIF_RW,
|
71
|
+
:IMG_LoadXCF_RW,
|
72
|
+
:IMG_LoadXPM_RW,
|
73
|
+
:IMG_LoadXV_RW,
|
74
|
+
:IMG_LoadWEBP_RW,
|
75
|
+
:IMG_ReadXPMFromArray,
|
76
|
+
:IMG_SavePNG,
|
77
|
+
:IMG_SavePNG_RW,
|
78
|
+
:IMG_SaveJPG,
|
79
|
+
:IMG_SaveJPG_RW,
|
80
|
+
]
|
81
|
+
args = {
|
82
|
+
:IMG_Linked_Version => [],
|
83
|
+
:IMG_Init => [:int],
|
84
|
+
:IMG_Quit => [],
|
85
|
+
:IMG_LoadTyped_RW => [:pointer, :int, :pointer],
|
86
|
+
:IMG_Load => [:pointer],
|
87
|
+
:IMG_Load_RW => [:pointer, :int],
|
88
|
+
:IMG_LoadTexture => [:pointer, :pointer],
|
89
|
+
:IMG_LoadTexture_RW => [:pointer, :pointer, :int],
|
90
|
+
:IMG_LoadTextureTyped_RW => [:pointer, :pointer, :int, :pointer],
|
91
|
+
:IMG_isICO => [:pointer],
|
92
|
+
:IMG_isCUR => [:pointer],
|
93
|
+
:IMG_isBMP => [:pointer],
|
94
|
+
:IMG_isGIF => [:pointer],
|
95
|
+
:IMG_isJPG => [:pointer],
|
96
|
+
:IMG_isLBM => [:pointer],
|
97
|
+
:IMG_isPCX => [:pointer],
|
98
|
+
:IMG_isPNG => [:pointer],
|
99
|
+
:IMG_isPNM => [:pointer],
|
100
|
+
:IMG_isSVG => [:pointer],
|
101
|
+
:IMG_isTIF => [:pointer],
|
102
|
+
:IMG_isXCF => [:pointer],
|
103
|
+
:IMG_isXPM => [:pointer],
|
104
|
+
:IMG_isXV => [:pointer],
|
105
|
+
:IMG_isWEBP => [:pointer],
|
106
|
+
:IMG_LoadICO_RW => [:pointer],
|
107
|
+
:IMG_LoadCUR_RW => [:pointer],
|
108
|
+
:IMG_LoadBMP_RW => [:pointer],
|
109
|
+
:IMG_LoadGIF_RW => [:pointer],
|
110
|
+
:IMG_LoadJPG_RW => [:pointer],
|
111
|
+
:IMG_LoadLBM_RW => [:pointer],
|
112
|
+
:IMG_LoadPCX_RW => [:pointer],
|
113
|
+
:IMG_LoadPNG_RW => [:pointer],
|
114
|
+
:IMG_LoadPNM_RW => [:pointer],
|
115
|
+
:IMG_LoadSVG_RW => [:pointer],
|
116
|
+
:IMG_LoadTGA_RW => [:pointer],
|
117
|
+
:IMG_LoadTIF_RW => [:pointer],
|
118
|
+
:IMG_LoadXCF_RW => [:pointer],
|
119
|
+
:IMG_LoadXPM_RW => [:pointer],
|
120
|
+
:IMG_LoadXV_RW => [:pointer],
|
121
|
+
:IMG_LoadWEBP_RW => [:pointer],
|
122
|
+
:IMG_ReadXPMFromArray => [:pointer],
|
123
|
+
:IMG_SavePNG => [:pointer, :pointer],
|
124
|
+
:IMG_SavePNG_RW => [:pointer, :pointer, :int],
|
125
|
+
:IMG_SaveJPG => [:pointer, :pointer, :int],
|
126
|
+
:IMG_SaveJPG_RW => [:pointer, :pointer, :int, :int],
|
127
|
+
}
|
128
|
+
retvals = {
|
129
|
+
:IMG_Linked_Version => :pointer,
|
130
|
+
:IMG_Init => :int,
|
131
|
+
:IMG_Quit => :void,
|
132
|
+
:IMG_LoadTyped_RW => :pointer,
|
133
|
+
:IMG_Load => :pointer,
|
134
|
+
:IMG_Load_RW => :pointer,
|
135
|
+
:IMG_LoadTexture => :pointer,
|
136
|
+
:IMG_LoadTexture_RW => :pointer,
|
137
|
+
:IMG_LoadTextureTyped_RW => :pointer,
|
138
|
+
:IMG_isICO => :int,
|
139
|
+
:IMG_isCUR => :int,
|
140
|
+
:IMG_isBMP => :int,
|
141
|
+
:IMG_isGIF => :int,
|
142
|
+
:IMG_isJPG => :int,
|
143
|
+
:IMG_isLBM => :int,
|
144
|
+
:IMG_isPCX => :int,
|
145
|
+
:IMG_isPNG => :int,
|
146
|
+
:IMG_isPNM => :int,
|
147
|
+
:IMG_isSVG => :int,
|
148
|
+
:IMG_isTIF => :int,
|
149
|
+
:IMG_isXCF => :int,
|
150
|
+
:IMG_isXPM => :int,
|
151
|
+
:IMG_isXV => :int,
|
152
|
+
:IMG_isWEBP => :int,
|
153
|
+
:IMG_LoadICO_RW => :pointer,
|
154
|
+
:IMG_LoadCUR_RW => :pointer,
|
155
|
+
:IMG_LoadBMP_RW => :pointer,
|
156
|
+
:IMG_LoadGIF_RW => :pointer,
|
157
|
+
:IMG_LoadJPG_RW => :pointer,
|
158
|
+
:IMG_LoadLBM_RW => :pointer,
|
159
|
+
:IMG_LoadPCX_RW => :pointer,
|
160
|
+
:IMG_LoadPNG_RW => :pointer,
|
161
|
+
:IMG_LoadPNM_RW => :pointer,
|
162
|
+
:IMG_LoadSVG_RW => :pointer,
|
163
|
+
:IMG_LoadTGA_RW => :pointer,
|
164
|
+
:IMG_LoadTIF_RW => :pointer,
|
165
|
+
:IMG_LoadXCF_RW => :pointer,
|
166
|
+
:IMG_LoadXPM_RW => :pointer,
|
167
|
+
:IMG_LoadXV_RW => :pointer,
|
168
|
+
:IMG_LoadWEBP_RW => :pointer,
|
169
|
+
:IMG_ReadXPMFromArray => :pointer,
|
170
|
+
:IMG_SavePNG => :int,
|
171
|
+
:IMG_SavePNG_RW => :int,
|
172
|
+
:IMG_SaveJPG => :int,
|
173
|
+
:IMG_SaveJPG_RW => :int,
|
174
|
+
}
|
175
|
+
symbols.each do |sym|
|
176
|
+
begin
|
177
|
+
attach_function sym, args[sym], retvals[sym]
|
178
|
+
rescue FFI::NotFoundError => error
|
179
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
end
|
185
|
+
|