sdl2-bindings 0.0.8 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +124 -92
- data/LICENSE.txt +1 -1
- data/README.md +77 -53
- data/lib/sdl2.rb +131 -172
- data/lib/sdl2_audio.rb +261 -222
- data/lib/sdl2_blendmode.rb +72 -69
- data/lib/sdl2_clipboard.rb +56 -51
- data/lib/sdl2_cpuinfo.rb +129 -106
- data/lib/sdl2_error.rb +71 -64
- data/lib/sdl2_events.rb +564 -533
- data/lib/sdl2_filesystem.rb +52 -48
- data/lib/sdl2_framerate.rb +74 -67
- data/lib/sdl2_gamecontroller.rb +329 -274
- data/lib/sdl2_gesture.rb +61 -55
- data/lib/sdl2_gfxPrimitives.rb +283 -222
- data/lib/sdl2_haptic.rb +301 -269
- data/lib/sdl2_hidapi.rb +139 -118
- data/lib/sdl2_hints.rb +221 -197
- data/lib/sdl2_image.rb +232 -185
- data/lib/sdl2_imageFilter.rb +164 -132
- data/lib/sdl2_joystick.rb +294 -239
- data/lib/sdl2_keyboard.rb +125 -99
- data/lib/sdl2_keycode.rb +307 -305
- data/lib/sdl2_log.rb +131 -115
- data/lib/sdl2_main.rb +74 -67
- data/lib/sdl2_messagebox.rb +102 -98
- data/lib/sdl2_misc.rb +48 -45
- data/lib/sdl2_mixer.rb +392 -317
- data/lib/sdl2_mouse.rb +136 -117
- data/lib/sdl2_pixels.rb +240 -224
- data/lib/sdl2_platform.rb +48 -45
- data/lib/sdl2_power.rb +54 -51
- data/lib/sdl2_rect.rb +145 -102
- data/lib/sdl2_render.rb +408 -322
- data/lib/sdl2_rotozoom.rb +76 -66
- data/lib/sdl2_rwops.rb +238 -208
- data/lib/sdl2_scancode.rb +289 -287
- data/lib/sdl2_sensor.rb +115 -97
- data/lib/sdl2_shape.rb +83 -77
- data/lib/sdl2_sound.rb +154 -0
- data/lib/sdl2_stdinc.rb +556 -439
- data/lib/sdl2_surface.rb +229 -188
- data/lib/sdl2_syswm.rb +160 -156
- data/lib/sdl2_timer.rb +74 -65
- data/lib/sdl2_touch.rb +86 -75
- data/lib/sdl2_ttf.rb +358 -202
- data/lib/sdl2_version.rb +67 -62
- data/lib/sdl2_video.rb +540 -446
- data/lib/sdl2_vulkan.rb +72 -64
- metadata +19 -4
data/lib/sdl2_image.rb
CHANGED
@@ -1,185 +1,232 @@
|
|
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
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
82
|
-
:IMG_Linked_Version =>
|
83
|
-
:IMG_Init =>
|
84
|
-
:IMG_Quit =>
|
85
|
-
:IMG_LoadTyped_RW =>
|
86
|
-
:IMG_Load =>
|
87
|
-
:IMG_Load_RW =>
|
88
|
-
:IMG_LoadTexture =>
|
89
|
-
:IMG_LoadTexture_RW =>
|
90
|
-
:IMG_LoadTextureTyped_RW =>
|
91
|
-
:IMG_isICO =>
|
92
|
-
:IMG_isCUR =>
|
93
|
-
:IMG_isBMP =>
|
94
|
-
:IMG_isGIF =>
|
95
|
-
:IMG_isJPG =>
|
96
|
-
:IMG_isLBM =>
|
97
|
-
:IMG_isPCX =>
|
98
|
-
:IMG_isPNG =>
|
99
|
-
:IMG_isPNM =>
|
100
|
-
:IMG_isSVG =>
|
101
|
-
:IMG_isTIF =>
|
102
|
-
:IMG_isXCF =>
|
103
|
-
:IMG_isXPM =>
|
104
|
-
:IMG_isXV =>
|
105
|
-
:IMG_isWEBP =>
|
106
|
-
:IMG_LoadICO_RW =>
|
107
|
-
:IMG_LoadCUR_RW =>
|
108
|
-
:IMG_LoadBMP_RW =>
|
109
|
-
:IMG_LoadGIF_RW =>
|
110
|
-
:IMG_LoadJPG_RW =>
|
111
|
-
:IMG_LoadLBM_RW =>
|
112
|
-
:IMG_LoadPCX_RW =>
|
113
|
-
:IMG_LoadPNG_RW =>
|
114
|
-
:IMG_LoadPNM_RW =>
|
115
|
-
:IMG_LoadSVG_RW =>
|
116
|
-
:IMG_LoadTGA_RW =>
|
117
|
-
:IMG_LoadTIF_RW =>
|
118
|
-
:IMG_LoadXCF_RW =>
|
119
|
-
:IMG_LoadXPM_RW =>
|
120
|
-
:IMG_LoadXV_RW =>
|
121
|
-
:IMG_LoadWEBP_RW =>
|
122
|
-
:IMG_ReadXPMFromArray =>
|
123
|
-
:IMG_SavePNG =>
|
124
|
-
:IMG_SavePNG_RW =>
|
125
|
-
:IMG_SaveJPG =>
|
126
|
-
:IMG_SaveJPG_RW =>
|
127
|
-
}
|
128
|
-
|
129
|
-
:IMG_Linked_Version =>
|
130
|
-
:IMG_Init => :int,
|
131
|
-
:IMG_Quit =>
|
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 => :
|
139
|
-
:IMG_isCUR => :
|
140
|
-
:IMG_isBMP => :
|
141
|
-
:IMG_isGIF => :
|
142
|
-
:IMG_isJPG => :
|
143
|
-
:IMG_isLBM => :
|
144
|
-
:IMG_isPCX => :
|
145
|
-
:IMG_isPNG => :
|
146
|
-
:IMG_isPNM => :
|
147
|
-
:IMG_isSVG => :
|
148
|
-
:IMG_isTIF => :
|
149
|
-
:IMG_isXCF => :
|
150
|
-
:IMG_isXPM => :
|
151
|
-
:IMG_isXV => :
|
152
|
-
:IMG_isWEBP => :
|
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 => :
|
171
|
-
:IMG_SavePNG_RW => :int,
|
172
|
-
:IMG_SaveJPG => :int,
|
173
|
-
:IMG_SaveJPG_RW => :int,
|
174
|
-
}
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
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 SDL
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
IMAGE_MAJOR_VERSION = 2
|
14
|
+
IMAGE_MINOR_VERSION = 0
|
15
|
+
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(output_error = false)
|
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
|
+
apis = {
|
82
|
+
:IMG_Linked_Version => :IMG_Linked_Version,
|
83
|
+
:IMG_Init => :IMG_Init,
|
84
|
+
:IMG_Quit => :IMG_Quit,
|
85
|
+
:IMG_LoadTyped_RW => :IMG_LoadTyped_RW,
|
86
|
+
:IMG_Load => :IMG_Load,
|
87
|
+
:IMG_Load_RW => :IMG_Load_RW,
|
88
|
+
:IMG_LoadTexture => :IMG_LoadTexture,
|
89
|
+
:IMG_LoadTexture_RW => :IMG_LoadTexture_RW,
|
90
|
+
:IMG_LoadTextureTyped_RW => :IMG_LoadTextureTyped_RW,
|
91
|
+
:IMG_isICO => :IMG_isICO,
|
92
|
+
:IMG_isCUR => :IMG_isCUR,
|
93
|
+
:IMG_isBMP => :IMG_isBMP,
|
94
|
+
:IMG_isGIF => :IMG_isGIF,
|
95
|
+
:IMG_isJPG => :IMG_isJPG,
|
96
|
+
:IMG_isLBM => :IMG_isLBM,
|
97
|
+
:IMG_isPCX => :IMG_isPCX,
|
98
|
+
:IMG_isPNG => :IMG_isPNG,
|
99
|
+
:IMG_isPNM => :IMG_isPNM,
|
100
|
+
:IMG_isSVG => :IMG_isSVG,
|
101
|
+
:IMG_isTIF => :IMG_isTIF,
|
102
|
+
:IMG_isXCF => :IMG_isXCF,
|
103
|
+
:IMG_isXPM => :IMG_isXPM,
|
104
|
+
:IMG_isXV => :IMG_isXV,
|
105
|
+
:IMG_isWEBP => :IMG_isWEBP,
|
106
|
+
:IMG_LoadICO_RW => :IMG_LoadICO_RW,
|
107
|
+
:IMG_LoadCUR_RW => :IMG_LoadCUR_RW,
|
108
|
+
:IMG_LoadBMP_RW => :IMG_LoadBMP_RW,
|
109
|
+
:IMG_LoadGIF_RW => :IMG_LoadGIF_RW,
|
110
|
+
:IMG_LoadJPG_RW => :IMG_LoadJPG_RW,
|
111
|
+
:IMG_LoadLBM_RW => :IMG_LoadLBM_RW,
|
112
|
+
:IMG_LoadPCX_RW => :IMG_LoadPCX_RW,
|
113
|
+
:IMG_LoadPNG_RW => :IMG_LoadPNG_RW,
|
114
|
+
:IMG_LoadPNM_RW => :IMG_LoadPNM_RW,
|
115
|
+
:IMG_LoadSVG_RW => :IMG_LoadSVG_RW,
|
116
|
+
:IMG_LoadTGA_RW => :IMG_LoadTGA_RW,
|
117
|
+
:IMG_LoadTIF_RW => :IMG_LoadTIF_RW,
|
118
|
+
:IMG_LoadXCF_RW => :IMG_LoadXCF_RW,
|
119
|
+
:IMG_LoadXPM_RW => :IMG_LoadXPM_RW,
|
120
|
+
:IMG_LoadXV_RW => :IMG_LoadXV_RW,
|
121
|
+
:IMG_LoadWEBP_RW => :IMG_LoadWEBP_RW,
|
122
|
+
:IMG_ReadXPMFromArray => :IMG_ReadXPMFromArray,
|
123
|
+
:IMG_SavePNG => :IMG_SavePNG,
|
124
|
+
:IMG_SavePNG_RW => :IMG_SavePNG_RW,
|
125
|
+
:IMG_SaveJPG => :IMG_SaveJPG,
|
126
|
+
:IMG_SaveJPG_RW => :IMG_SaveJPG_RW,
|
127
|
+
}
|
128
|
+
args = {
|
129
|
+
:IMG_Linked_Version => [],
|
130
|
+
:IMG_Init => [:int],
|
131
|
+
:IMG_Quit => [],
|
132
|
+
:IMG_LoadTyped_RW => [:pointer, :int, :pointer],
|
133
|
+
:IMG_Load => [:pointer],
|
134
|
+
:IMG_Load_RW => [:pointer, :int],
|
135
|
+
:IMG_LoadTexture => [:pointer, :pointer],
|
136
|
+
:IMG_LoadTexture_RW => [:pointer, :pointer, :int],
|
137
|
+
:IMG_LoadTextureTyped_RW => [:pointer, :pointer, :int, :pointer],
|
138
|
+
:IMG_isICO => [:pointer],
|
139
|
+
:IMG_isCUR => [:pointer],
|
140
|
+
:IMG_isBMP => [:pointer],
|
141
|
+
:IMG_isGIF => [:pointer],
|
142
|
+
:IMG_isJPG => [:pointer],
|
143
|
+
:IMG_isLBM => [:pointer],
|
144
|
+
:IMG_isPCX => [:pointer],
|
145
|
+
:IMG_isPNG => [:pointer],
|
146
|
+
:IMG_isPNM => [:pointer],
|
147
|
+
:IMG_isSVG => [:pointer],
|
148
|
+
:IMG_isTIF => [:pointer],
|
149
|
+
:IMG_isXCF => [:pointer],
|
150
|
+
:IMG_isXPM => [:pointer],
|
151
|
+
:IMG_isXV => [:pointer],
|
152
|
+
:IMG_isWEBP => [:pointer],
|
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 => [:pointer, :pointer],
|
171
|
+
:IMG_SavePNG_RW => [:pointer, :pointer, :int],
|
172
|
+
:IMG_SaveJPG => [:pointer, :pointer, :int],
|
173
|
+
:IMG_SaveJPG_RW => [:pointer, :pointer, :int, :int],
|
174
|
+
}
|
175
|
+
retvals = {
|
176
|
+
:IMG_Linked_Version => :pointer,
|
177
|
+
:IMG_Init => :int,
|
178
|
+
:IMG_Quit => :void,
|
179
|
+
:IMG_LoadTyped_RW => :pointer,
|
180
|
+
:IMG_Load => :pointer,
|
181
|
+
:IMG_Load_RW => :pointer,
|
182
|
+
:IMG_LoadTexture => :pointer,
|
183
|
+
:IMG_LoadTexture_RW => :pointer,
|
184
|
+
:IMG_LoadTextureTyped_RW => :pointer,
|
185
|
+
:IMG_isICO => :int,
|
186
|
+
:IMG_isCUR => :int,
|
187
|
+
:IMG_isBMP => :int,
|
188
|
+
:IMG_isGIF => :int,
|
189
|
+
:IMG_isJPG => :int,
|
190
|
+
:IMG_isLBM => :int,
|
191
|
+
:IMG_isPCX => :int,
|
192
|
+
:IMG_isPNG => :int,
|
193
|
+
:IMG_isPNM => :int,
|
194
|
+
:IMG_isSVG => :int,
|
195
|
+
:IMG_isTIF => :int,
|
196
|
+
:IMG_isXCF => :int,
|
197
|
+
:IMG_isXPM => :int,
|
198
|
+
:IMG_isXV => :int,
|
199
|
+
:IMG_isWEBP => :int,
|
200
|
+
:IMG_LoadICO_RW => :pointer,
|
201
|
+
:IMG_LoadCUR_RW => :pointer,
|
202
|
+
:IMG_LoadBMP_RW => :pointer,
|
203
|
+
:IMG_LoadGIF_RW => :pointer,
|
204
|
+
:IMG_LoadJPG_RW => :pointer,
|
205
|
+
:IMG_LoadLBM_RW => :pointer,
|
206
|
+
:IMG_LoadPCX_RW => :pointer,
|
207
|
+
:IMG_LoadPNG_RW => :pointer,
|
208
|
+
:IMG_LoadPNM_RW => :pointer,
|
209
|
+
:IMG_LoadSVG_RW => :pointer,
|
210
|
+
:IMG_LoadTGA_RW => :pointer,
|
211
|
+
:IMG_LoadTIF_RW => :pointer,
|
212
|
+
:IMG_LoadXCF_RW => :pointer,
|
213
|
+
:IMG_LoadXPM_RW => :pointer,
|
214
|
+
:IMG_LoadXV_RW => :pointer,
|
215
|
+
:IMG_LoadWEBP_RW => :pointer,
|
216
|
+
:IMG_ReadXPMFromArray => :pointer,
|
217
|
+
:IMG_SavePNG => :int,
|
218
|
+
:IMG_SavePNG_RW => :int,
|
219
|
+
:IMG_SaveJPG => :int,
|
220
|
+
:IMG_SaveJPG_RW => :int,
|
221
|
+
}
|
222
|
+
symbols.each do |sym|
|
223
|
+
begin
|
224
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
225
|
+
rescue FFI::NotFoundError => error
|
226
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
227
|
+
end
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
|