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_gesture.rb
CHANGED
@@ -1,55 +1,61 @@
|
|
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
|
-
# Enum
|
15
|
-
|
16
|
-
|
17
|
-
# Typedef
|
18
|
-
|
19
|
-
typedef :long_long, :SDL_GestureID
|
20
|
-
|
21
|
-
# Struct
|
22
|
-
|
23
|
-
|
24
|
-
# Function
|
25
|
-
|
26
|
-
def self.setup_gesture_symbols()
|
27
|
-
symbols = [
|
28
|
-
:SDL_RecordGesture,
|
29
|
-
:SDL_SaveAllDollarTemplates,
|
30
|
-
:SDL_SaveDollarTemplate,
|
31
|
-
:SDL_LoadDollarTemplates,
|
32
|
-
]
|
33
|
-
|
34
|
-
:SDL_RecordGesture =>
|
35
|
-
:SDL_SaveAllDollarTemplates =>
|
36
|
-
:SDL_SaveDollarTemplate =>
|
37
|
-
:SDL_LoadDollarTemplates =>
|
38
|
-
}
|
39
|
-
|
40
|
-
:SDL_RecordGesture => :
|
41
|
-
:SDL_SaveAllDollarTemplates => :
|
42
|
-
:SDL_SaveDollarTemplate => :
|
43
|
-
:SDL_LoadDollarTemplates => :
|
44
|
-
}
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
+
|
14
|
+
# Enum
|
15
|
+
|
16
|
+
|
17
|
+
# Typedef
|
18
|
+
|
19
|
+
typedef :long_long, :SDL_GestureID
|
20
|
+
|
21
|
+
# Struct
|
22
|
+
|
23
|
+
|
24
|
+
# Function
|
25
|
+
|
26
|
+
def self.setup_gesture_symbols(output_error = false)
|
27
|
+
symbols = [
|
28
|
+
:SDL_RecordGesture,
|
29
|
+
:SDL_SaveAllDollarTemplates,
|
30
|
+
:SDL_SaveDollarTemplate,
|
31
|
+
:SDL_LoadDollarTemplates,
|
32
|
+
]
|
33
|
+
apis = {
|
34
|
+
:SDL_RecordGesture => :RecordGesture,
|
35
|
+
:SDL_SaveAllDollarTemplates => :SaveAllDollarTemplates,
|
36
|
+
:SDL_SaveDollarTemplate => :SaveDollarTemplate,
|
37
|
+
:SDL_LoadDollarTemplates => :LoadDollarTemplates,
|
38
|
+
}
|
39
|
+
args = {
|
40
|
+
:SDL_RecordGesture => [:long_long],
|
41
|
+
:SDL_SaveAllDollarTemplates => [:pointer],
|
42
|
+
:SDL_SaveDollarTemplate => [:long_long, :pointer],
|
43
|
+
:SDL_LoadDollarTemplates => [:long_long, :pointer],
|
44
|
+
}
|
45
|
+
retvals = {
|
46
|
+
:SDL_RecordGesture => :int,
|
47
|
+
:SDL_SaveAllDollarTemplates => :int,
|
48
|
+
:SDL_SaveDollarTemplate => :int,
|
49
|
+
:SDL_LoadDollarTemplates => :int,
|
50
|
+
}
|
51
|
+
symbols.each do |sym|
|
52
|
+
begin
|
53
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
54
|
+
rescue FFI::NotFoundError => error
|
55
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
|
data/lib/sdl2_gfxPrimitives.rb
CHANGED
@@ -1,222 +1,283 @@
|
|
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
|
-
SDL2_GFXPRIMITIVES_MAJOR = 1
|
14
|
-
SDL2_GFXPRIMITIVES_MINOR = 0
|
15
|
-
SDL2_GFXPRIMITIVES_MICRO = 4
|
16
|
-
|
17
|
-
# Enum
|
18
|
-
|
19
|
-
|
20
|
-
# Typedef
|
21
|
-
|
22
|
-
|
23
|
-
# Struct
|
24
|
-
|
25
|
-
|
26
|
-
# Function
|
27
|
-
|
28
|
-
def self.setup_gfx_primitives_symbols()
|
29
|
-
symbols = [
|
30
|
-
:pixelColor,
|
31
|
-
:pixelRGBA,
|
32
|
-
:hlineColor,
|
33
|
-
:hlineRGBA,
|
34
|
-
:vlineColor,
|
35
|
-
:vlineRGBA,
|
36
|
-
:rectangleColor,
|
37
|
-
:rectangleRGBA,
|
38
|
-
:roundedRectangleColor,
|
39
|
-
:roundedRectangleRGBA,
|
40
|
-
:boxColor,
|
41
|
-
:boxRGBA,
|
42
|
-
:roundedBoxColor,
|
43
|
-
:roundedBoxRGBA,
|
44
|
-
:lineColor,
|
45
|
-
:lineRGBA,
|
46
|
-
:aalineColor,
|
47
|
-
:aalineRGBA,
|
48
|
-
:thickLineColor,
|
49
|
-
:thickLineRGBA,
|
50
|
-
:circleColor,
|
51
|
-
:circleRGBA,
|
52
|
-
:arcColor,
|
53
|
-
:arcRGBA,
|
54
|
-
:aacircleColor,
|
55
|
-
:aacircleRGBA,
|
56
|
-
:filledCircleColor,
|
57
|
-
:filledCircleRGBA,
|
58
|
-
:ellipseColor,
|
59
|
-
:ellipseRGBA,
|
60
|
-
:aaellipseColor,
|
61
|
-
:aaellipseRGBA,
|
62
|
-
:filledEllipseColor,
|
63
|
-
:filledEllipseRGBA,
|
64
|
-
:pieColor,
|
65
|
-
:pieRGBA,
|
66
|
-
:filledPieColor,
|
67
|
-
:filledPieRGBA,
|
68
|
-
:trigonColor,
|
69
|
-
:trigonRGBA,
|
70
|
-
:aatrigonColor,
|
71
|
-
:aatrigonRGBA,
|
72
|
-
:filledTrigonColor,
|
73
|
-
:filledTrigonRGBA,
|
74
|
-
:polygonColor,
|
75
|
-
:polygonRGBA,
|
76
|
-
:aapolygonColor,
|
77
|
-
:aapolygonRGBA,
|
78
|
-
:filledPolygonColor,
|
79
|
-
:filledPolygonRGBA,
|
80
|
-
:texturedPolygon,
|
81
|
-
:bezierColor,
|
82
|
-
:bezierRGBA,
|
83
|
-
:gfxPrimitivesSetFont,
|
84
|
-
:gfxPrimitivesSetFontRotation,
|
85
|
-
:characterColor,
|
86
|
-
:characterRGBA,
|
87
|
-
:stringColor,
|
88
|
-
:stringRGBA,
|
89
|
-
]
|
90
|
-
|
91
|
-
:pixelColor =>
|
92
|
-
:pixelRGBA =>
|
93
|
-
:hlineColor =>
|
94
|
-
:hlineRGBA =>
|
95
|
-
:vlineColor =>
|
96
|
-
:vlineRGBA =>
|
97
|
-
:rectangleColor =>
|
98
|
-
:rectangleRGBA =>
|
99
|
-
:roundedRectangleColor =>
|
100
|
-
:roundedRectangleRGBA =>
|
101
|
-
:boxColor =>
|
102
|
-
:boxRGBA =>
|
103
|
-
:roundedBoxColor =>
|
104
|
-
:roundedBoxRGBA =>
|
105
|
-
:lineColor =>
|
106
|
-
:lineRGBA =>
|
107
|
-
:aalineColor =>
|
108
|
-
:aalineRGBA =>
|
109
|
-
:thickLineColor =>
|
110
|
-
:thickLineRGBA =>
|
111
|
-
:circleColor =>
|
112
|
-
:circleRGBA =>
|
113
|
-
:arcColor =>
|
114
|
-
:arcRGBA =>
|
115
|
-
:aacircleColor =>
|
116
|
-
:aacircleRGBA =>
|
117
|
-
:filledCircleColor =>
|
118
|
-
:filledCircleRGBA =>
|
119
|
-
:ellipseColor =>
|
120
|
-
:ellipseRGBA =>
|
121
|
-
:aaellipseColor =>
|
122
|
-
:aaellipseRGBA =>
|
123
|
-
:filledEllipseColor =>
|
124
|
-
:filledEllipseRGBA =>
|
125
|
-
:pieColor =>
|
126
|
-
:pieRGBA =>
|
127
|
-
:filledPieColor =>
|
128
|
-
:filledPieRGBA =>
|
129
|
-
:trigonColor =>
|
130
|
-
:trigonRGBA =>
|
131
|
-
:aatrigonColor =>
|
132
|
-
:aatrigonRGBA =>
|
133
|
-
:filledTrigonColor =>
|
134
|
-
:filledTrigonRGBA =>
|
135
|
-
:polygonColor =>
|
136
|
-
:polygonRGBA =>
|
137
|
-
:aapolygonColor =>
|
138
|
-
:aapolygonRGBA =>
|
139
|
-
:filledPolygonColor =>
|
140
|
-
:filledPolygonRGBA =>
|
141
|
-
:texturedPolygon =>
|
142
|
-
:bezierColor =>
|
143
|
-
:bezierRGBA =>
|
144
|
-
:gfxPrimitivesSetFont =>
|
145
|
-
:gfxPrimitivesSetFontRotation =>
|
146
|
-
:characterColor =>
|
147
|
-
:characterRGBA =>
|
148
|
-
:stringColor =>
|
149
|
-
:stringRGBA =>
|
150
|
-
}
|
151
|
-
|
152
|
-
:pixelColor => :
|
153
|
-
:pixelRGBA => :
|
154
|
-
:hlineColor => :
|
155
|
-
:hlineRGBA => :
|
156
|
-
:vlineColor => :
|
157
|
-
:vlineRGBA => :
|
158
|
-
:rectangleColor => :
|
159
|
-
:rectangleRGBA => :
|
160
|
-
:roundedRectangleColor => :
|
161
|
-
:roundedRectangleRGBA => :
|
162
|
-
:boxColor => :
|
163
|
-
:boxRGBA => :
|
164
|
-
:roundedBoxColor => :
|
165
|
-
:roundedBoxRGBA => :
|
166
|
-
:lineColor => :
|
167
|
-
:lineRGBA => :
|
168
|
-
:aalineColor => :
|
169
|
-
:aalineRGBA => :
|
170
|
-
:thickLineColor => :
|
171
|
-
:thickLineRGBA => :
|
172
|
-
:circleColor => :
|
173
|
-
:circleRGBA => :
|
174
|
-
:arcColor => :
|
175
|
-
:arcRGBA => :
|
176
|
-
:aacircleColor => :
|
177
|
-
:aacircleRGBA => :
|
178
|
-
:filledCircleColor => :
|
179
|
-
:filledCircleRGBA => :
|
180
|
-
:ellipseColor => :
|
181
|
-
:ellipseRGBA => :
|
182
|
-
:aaellipseColor => :
|
183
|
-
:aaellipseRGBA => :
|
184
|
-
:filledEllipseColor => :
|
185
|
-
:filledEllipseRGBA => :
|
186
|
-
:pieColor => :
|
187
|
-
:pieRGBA => :
|
188
|
-
:filledPieColor => :
|
189
|
-
:filledPieRGBA => :
|
190
|
-
:trigonColor => :
|
191
|
-
:trigonRGBA => :
|
192
|
-
:aatrigonColor => :
|
193
|
-
:aatrigonRGBA => :
|
194
|
-
:filledTrigonColor => :
|
195
|
-
:filledTrigonRGBA => :
|
196
|
-
:polygonColor => :int,
|
197
|
-
:polygonRGBA => :int,
|
198
|
-
:aapolygonColor => :int,
|
199
|
-
:aapolygonRGBA => :int,
|
200
|
-
:filledPolygonColor => :int,
|
201
|
-
:filledPolygonRGBA => :int,
|
202
|
-
:texturedPolygon => :int,
|
203
|
-
:bezierColor => :int,
|
204
|
-
:bezierRGBA => :int,
|
205
|
-
:gfxPrimitivesSetFont => :
|
206
|
-
:gfxPrimitivesSetFontRotation => :
|
207
|
-
:characterColor => :
|
208
|
-
:characterRGBA => :
|
209
|
-
:stringColor => :
|
210
|
-
:stringRGBA => :
|
211
|
-
}
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
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
|
+
SDL2_GFXPRIMITIVES_MAJOR = 1
|
14
|
+
SDL2_GFXPRIMITIVES_MINOR = 0
|
15
|
+
SDL2_GFXPRIMITIVES_MICRO = 4
|
16
|
+
|
17
|
+
# Enum
|
18
|
+
|
19
|
+
|
20
|
+
# Typedef
|
21
|
+
|
22
|
+
|
23
|
+
# Struct
|
24
|
+
|
25
|
+
|
26
|
+
# Function
|
27
|
+
|
28
|
+
def self.setup_gfx_primitives_symbols(output_error = false)
|
29
|
+
symbols = [
|
30
|
+
:pixelColor,
|
31
|
+
:pixelRGBA,
|
32
|
+
:hlineColor,
|
33
|
+
:hlineRGBA,
|
34
|
+
:vlineColor,
|
35
|
+
:vlineRGBA,
|
36
|
+
:rectangleColor,
|
37
|
+
:rectangleRGBA,
|
38
|
+
:roundedRectangleColor,
|
39
|
+
:roundedRectangleRGBA,
|
40
|
+
:boxColor,
|
41
|
+
:boxRGBA,
|
42
|
+
:roundedBoxColor,
|
43
|
+
:roundedBoxRGBA,
|
44
|
+
:lineColor,
|
45
|
+
:lineRGBA,
|
46
|
+
:aalineColor,
|
47
|
+
:aalineRGBA,
|
48
|
+
:thickLineColor,
|
49
|
+
:thickLineRGBA,
|
50
|
+
:circleColor,
|
51
|
+
:circleRGBA,
|
52
|
+
:arcColor,
|
53
|
+
:arcRGBA,
|
54
|
+
:aacircleColor,
|
55
|
+
:aacircleRGBA,
|
56
|
+
:filledCircleColor,
|
57
|
+
:filledCircleRGBA,
|
58
|
+
:ellipseColor,
|
59
|
+
:ellipseRGBA,
|
60
|
+
:aaellipseColor,
|
61
|
+
:aaellipseRGBA,
|
62
|
+
:filledEllipseColor,
|
63
|
+
:filledEllipseRGBA,
|
64
|
+
:pieColor,
|
65
|
+
:pieRGBA,
|
66
|
+
:filledPieColor,
|
67
|
+
:filledPieRGBA,
|
68
|
+
:trigonColor,
|
69
|
+
:trigonRGBA,
|
70
|
+
:aatrigonColor,
|
71
|
+
:aatrigonRGBA,
|
72
|
+
:filledTrigonColor,
|
73
|
+
:filledTrigonRGBA,
|
74
|
+
:polygonColor,
|
75
|
+
:polygonRGBA,
|
76
|
+
:aapolygonColor,
|
77
|
+
:aapolygonRGBA,
|
78
|
+
:filledPolygonColor,
|
79
|
+
:filledPolygonRGBA,
|
80
|
+
:texturedPolygon,
|
81
|
+
:bezierColor,
|
82
|
+
:bezierRGBA,
|
83
|
+
:gfxPrimitivesSetFont,
|
84
|
+
:gfxPrimitivesSetFontRotation,
|
85
|
+
:characterColor,
|
86
|
+
:characterRGBA,
|
87
|
+
:stringColor,
|
88
|
+
:stringRGBA,
|
89
|
+
]
|
90
|
+
apis = {
|
91
|
+
:pixelColor => :pixelColor,
|
92
|
+
:pixelRGBA => :pixelRGBA,
|
93
|
+
:hlineColor => :hlineColor,
|
94
|
+
:hlineRGBA => :hlineRGBA,
|
95
|
+
:vlineColor => :vlineColor,
|
96
|
+
:vlineRGBA => :vlineRGBA,
|
97
|
+
:rectangleColor => :rectangleColor,
|
98
|
+
:rectangleRGBA => :rectangleRGBA,
|
99
|
+
:roundedRectangleColor => :roundedRectangleColor,
|
100
|
+
:roundedRectangleRGBA => :roundedRectangleRGBA,
|
101
|
+
:boxColor => :boxColor,
|
102
|
+
:boxRGBA => :boxRGBA,
|
103
|
+
:roundedBoxColor => :roundedBoxColor,
|
104
|
+
:roundedBoxRGBA => :roundedBoxRGBA,
|
105
|
+
:lineColor => :lineColor,
|
106
|
+
:lineRGBA => :lineRGBA,
|
107
|
+
:aalineColor => :aalineColor,
|
108
|
+
:aalineRGBA => :aalineRGBA,
|
109
|
+
:thickLineColor => :thickLineColor,
|
110
|
+
:thickLineRGBA => :thickLineRGBA,
|
111
|
+
:circleColor => :circleColor,
|
112
|
+
:circleRGBA => :circleRGBA,
|
113
|
+
:arcColor => :arcColor,
|
114
|
+
:arcRGBA => :arcRGBA,
|
115
|
+
:aacircleColor => :aacircleColor,
|
116
|
+
:aacircleRGBA => :aacircleRGBA,
|
117
|
+
:filledCircleColor => :filledCircleColor,
|
118
|
+
:filledCircleRGBA => :filledCircleRGBA,
|
119
|
+
:ellipseColor => :ellipseColor,
|
120
|
+
:ellipseRGBA => :ellipseRGBA,
|
121
|
+
:aaellipseColor => :aaellipseColor,
|
122
|
+
:aaellipseRGBA => :aaellipseRGBA,
|
123
|
+
:filledEllipseColor => :filledEllipseColor,
|
124
|
+
:filledEllipseRGBA => :filledEllipseRGBA,
|
125
|
+
:pieColor => :pieColor,
|
126
|
+
:pieRGBA => :pieRGBA,
|
127
|
+
:filledPieColor => :filledPieColor,
|
128
|
+
:filledPieRGBA => :filledPieRGBA,
|
129
|
+
:trigonColor => :trigonColor,
|
130
|
+
:trigonRGBA => :trigonRGBA,
|
131
|
+
:aatrigonColor => :aatrigonColor,
|
132
|
+
:aatrigonRGBA => :aatrigonRGBA,
|
133
|
+
:filledTrigonColor => :filledTrigonColor,
|
134
|
+
:filledTrigonRGBA => :filledTrigonRGBA,
|
135
|
+
:polygonColor => :polygonColor,
|
136
|
+
:polygonRGBA => :polygonRGBA,
|
137
|
+
:aapolygonColor => :aapolygonColor,
|
138
|
+
:aapolygonRGBA => :aapolygonRGBA,
|
139
|
+
:filledPolygonColor => :filledPolygonColor,
|
140
|
+
:filledPolygonRGBA => :filledPolygonRGBA,
|
141
|
+
:texturedPolygon => :texturedPolygon,
|
142
|
+
:bezierColor => :bezierColor,
|
143
|
+
:bezierRGBA => :bezierRGBA,
|
144
|
+
:gfxPrimitivesSetFont => :gfxPrimitivesSetFont,
|
145
|
+
:gfxPrimitivesSetFontRotation => :gfxPrimitivesSetFontRotation,
|
146
|
+
:characterColor => :characterColor,
|
147
|
+
:characterRGBA => :characterRGBA,
|
148
|
+
:stringColor => :stringColor,
|
149
|
+
:stringRGBA => :stringRGBA,
|
150
|
+
}
|
151
|
+
args = {
|
152
|
+
:pixelColor => [:pointer, :short, :short, :uint],
|
153
|
+
:pixelRGBA => [:pointer, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
154
|
+
:hlineColor => [:pointer, :short, :short, :short, :uint],
|
155
|
+
:hlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
156
|
+
:vlineColor => [:pointer, :short, :short, :short, :uint],
|
157
|
+
:vlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
158
|
+
:rectangleColor => [:pointer, :short, :short, :short, :short, :uint],
|
159
|
+
:rectangleRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
160
|
+
:roundedRectangleColor => [:pointer, :short, :short, :short, :short, :short, :uint],
|
161
|
+
:roundedRectangleRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
162
|
+
:boxColor => [:pointer, :short, :short, :short, :short, :uint],
|
163
|
+
:boxRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
164
|
+
:roundedBoxColor => [:pointer, :short, :short, :short, :short, :short, :uint],
|
165
|
+
:roundedBoxRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
166
|
+
:lineColor => [:pointer, :short, :short, :short, :short, :uint],
|
167
|
+
:lineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
168
|
+
:aalineColor => [:pointer, :short, :short, :short, :short, :uint],
|
169
|
+
:aalineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
170
|
+
:thickLineColor => [:pointer, :short, :short, :short, :short, :uchar, :uint],
|
171
|
+
:thickLineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar, :uchar],
|
172
|
+
:circleColor => [:pointer, :short, :short, :short, :uint],
|
173
|
+
:circleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
174
|
+
:arcColor => [:pointer, :short, :short, :short, :short, :short, :uint],
|
175
|
+
:arcRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
176
|
+
:aacircleColor => [:pointer, :short, :short, :short, :uint],
|
177
|
+
:aacircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
178
|
+
:filledCircleColor => [:pointer, :short, :short, :short, :uint],
|
179
|
+
:filledCircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
180
|
+
:ellipseColor => [:pointer, :short, :short, :short, :short, :uint],
|
181
|
+
:ellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
182
|
+
:aaellipseColor => [:pointer, :short, :short, :short, :short, :uint],
|
183
|
+
:aaellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
184
|
+
:filledEllipseColor => [:pointer, :short, :short, :short, :short, :uint],
|
185
|
+
:filledEllipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
186
|
+
:pieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
|
187
|
+
:pieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
188
|
+
:filledPieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
|
189
|
+
:filledPieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
190
|
+
:trigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
|
191
|
+
:trigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
192
|
+
:aatrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
|
193
|
+
:aatrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
194
|
+
:filledTrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
|
195
|
+
:filledTrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
|
196
|
+
:polygonColor => [:pointer, :pointer, :pointer, :int, :uint],
|
197
|
+
:polygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
|
198
|
+
:aapolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
|
199
|
+
:aapolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
|
200
|
+
:filledPolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
|
201
|
+
:filledPolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
|
202
|
+
:texturedPolygon => [:pointer, :pointer, :pointer, :int, :pointer, :int, :int],
|
203
|
+
:bezierColor => [:pointer, :pointer, :pointer, :int, :int, :uint],
|
204
|
+
:bezierRGBA => [:pointer, :pointer, :pointer, :int, :int, :uchar, :uchar, :uchar, :uchar],
|
205
|
+
:gfxPrimitivesSetFont => [:pointer, :uint, :uint],
|
206
|
+
:gfxPrimitivesSetFontRotation => [:uint],
|
207
|
+
:characterColor => [:pointer, :short, :short, :char, :uint],
|
208
|
+
:characterRGBA => [:pointer, :short, :short, :char, :uchar, :uchar, :uchar, :uchar],
|
209
|
+
:stringColor => [:pointer, :short, :short, :pointer, :uint],
|
210
|
+
:stringRGBA => [:pointer, :short, :short, :pointer, :uchar, :uchar, :uchar, :uchar],
|
211
|
+
}
|
212
|
+
retvals = {
|
213
|
+
:pixelColor => :int,
|
214
|
+
:pixelRGBA => :int,
|
215
|
+
:hlineColor => :int,
|
216
|
+
:hlineRGBA => :int,
|
217
|
+
:vlineColor => :int,
|
218
|
+
:vlineRGBA => :int,
|
219
|
+
:rectangleColor => :int,
|
220
|
+
:rectangleRGBA => :int,
|
221
|
+
:roundedRectangleColor => :int,
|
222
|
+
:roundedRectangleRGBA => :int,
|
223
|
+
:boxColor => :int,
|
224
|
+
:boxRGBA => :int,
|
225
|
+
:roundedBoxColor => :int,
|
226
|
+
:roundedBoxRGBA => :int,
|
227
|
+
:lineColor => :int,
|
228
|
+
:lineRGBA => :int,
|
229
|
+
:aalineColor => :int,
|
230
|
+
:aalineRGBA => :int,
|
231
|
+
:thickLineColor => :int,
|
232
|
+
:thickLineRGBA => :int,
|
233
|
+
:circleColor => :int,
|
234
|
+
:circleRGBA => :int,
|
235
|
+
:arcColor => :int,
|
236
|
+
:arcRGBA => :int,
|
237
|
+
:aacircleColor => :int,
|
238
|
+
:aacircleRGBA => :int,
|
239
|
+
:filledCircleColor => :int,
|
240
|
+
:filledCircleRGBA => :int,
|
241
|
+
:ellipseColor => :int,
|
242
|
+
:ellipseRGBA => :int,
|
243
|
+
:aaellipseColor => :int,
|
244
|
+
:aaellipseRGBA => :int,
|
245
|
+
:filledEllipseColor => :int,
|
246
|
+
:filledEllipseRGBA => :int,
|
247
|
+
:pieColor => :int,
|
248
|
+
:pieRGBA => :int,
|
249
|
+
:filledPieColor => :int,
|
250
|
+
:filledPieRGBA => :int,
|
251
|
+
:trigonColor => :int,
|
252
|
+
:trigonRGBA => :int,
|
253
|
+
:aatrigonColor => :int,
|
254
|
+
:aatrigonRGBA => :int,
|
255
|
+
:filledTrigonColor => :int,
|
256
|
+
:filledTrigonRGBA => :int,
|
257
|
+
:polygonColor => :int,
|
258
|
+
:polygonRGBA => :int,
|
259
|
+
:aapolygonColor => :int,
|
260
|
+
:aapolygonRGBA => :int,
|
261
|
+
:filledPolygonColor => :int,
|
262
|
+
:filledPolygonRGBA => :int,
|
263
|
+
:texturedPolygon => :int,
|
264
|
+
:bezierColor => :int,
|
265
|
+
:bezierRGBA => :int,
|
266
|
+
:gfxPrimitivesSetFont => :void,
|
267
|
+
:gfxPrimitivesSetFontRotation => :void,
|
268
|
+
:characterColor => :int,
|
269
|
+
:characterRGBA => :int,
|
270
|
+
:stringColor => :int,
|
271
|
+
:stringRGBA => :int,
|
272
|
+
}
|
273
|
+
symbols.each do |sym|
|
274
|
+
begin
|
275
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
276
|
+
rescue FFI::NotFoundError => error
|
277
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
end
|
283
|
+
|