sdl2-bindings 0.0.9 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +129 -96
  3. data/LICENSE.txt +0 -0
  4. data/README.md +78 -55
  5. data/lib/sdl2.rb +131 -172
  6. data/lib/sdl2_audio.rb +261 -222
  7. data/lib/sdl2_blendmode.rb +72 -69
  8. data/lib/sdl2_clipboard.rb +56 -51
  9. data/lib/sdl2_cpuinfo.rb +129 -106
  10. data/lib/sdl2_error.rb +71 -64
  11. data/lib/sdl2_events.rb +564 -533
  12. data/lib/sdl2_filesystem.rb +52 -48
  13. data/lib/sdl2_framerate.rb +74 -67
  14. data/lib/sdl2_gamecontroller.rb +329 -274
  15. data/lib/sdl2_gesture.rb +61 -55
  16. data/lib/sdl2_gfxPrimitives.rb +283 -222
  17. data/lib/sdl2_haptic.rb +301 -269
  18. data/lib/sdl2_hidapi.rb +139 -118
  19. data/lib/sdl2_hints.rb +221 -198
  20. data/lib/sdl2_image.rb +232 -185
  21. data/lib/sdl2_imageFilter.rb +164 -132
  22. data/lib/sdl2_joystick.rb +294 -239
  23. data/lib/sdl2_keyboard.rb +125 -99
  24. data/lib/sdl2_keycode.rb +307 -305
  25. data/lib/sdl2_log.rb +131 -115
  26. data/lib/sdl2_main.rb +74 -67
  27. data/lib/sdl2_messagebox.rb +102 -98
  28. data/lib/sdl2_misc.rb +48 -45
  29. data/lib/sdl2_mixer.rb +392 -317
  30. data/lib/sdl2_mouse.rb +136 -117
  31. data/lib/sdl2_pixels.rb +240 -224
  32. data/lib/sdl2_platform.rb +48 -45
  33. data/lib/sdl2_power.rb +54 -51
  34. data/lib/sdl2_rect.rb +145 -102
  35. data/lib/sdl2_render.rb +408 -322
  36. data/lib/sdl2_rotozoom.rb +76 -66
  37. data/lib/sdl2_rwops.rb +242 -208
  38. data/lib/sdl2_scancode.rb +289 -287
  39. data/lib/sdl2_sensor.rb +115 -97
  40. data/lib/sdl2_shape.rb +83 -77
  41. data/lib/sdl2_sound.rb +154 -0
  42. data/lib/sdl2_stdinc.rb +556 -439
  43. data/lib/sdl2_surface.rb +229 -188
  44. data/lib/sdl2_syswm.rb +160 -157
  45. data/lib/sdl2_timer.rb +74 -65
  46. data/lib/sdl2_touch.rb +86 -75
  47. data/lib/sdl2_ttf.rb +358 -202
  48. data/lib/sdl2_version.rb +67 -62
  49. data/lib/sdl2_video.rb +540 -446
  50. data/lib/sdl2_vulkan.rb +72 -64
  51. metadata +18 -3
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 SDL2
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
- args = {
34
- :SDL_RecordGesture => [:long_long],
35
- :SDL_SaveAllDollarTemplates => [:pointer],
36
- :SDL_SaveDollarTemplate => [:long_long, :pointer],
37
- :SDL_LoadDollarTemplates => [:long_long, :pointer],
38
- }
39
- retvals = {
40
- :SDL_RecordGesture => :int,
41
- :SDL_SaveAllDollarTemplates => :int,
42
- :SDL_SaveDollarTemplate => :int,
43
- :SDL_LoadDollarTemplates => :int,
44
- }
45
- symbols.each do |sym|
46
- begin
47
- attach_function sym, args[sym], retvals[sym]
48
- rescue FFI::NotFoundError => error
49
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
50
- end
51
- end
52
- end
53
-
54
- end
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
+
@@ -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 SDL2
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
- args = {
91
- :pixelColor => [:pointer, :short, :short, :uint],
92
- :pixelRGBA => [:pointer, :short, :short, :uchar, :uchar, :uchar, :uchar],
93
- :hlineColor => [:pointer, :short, :short, :short, :uint],
94
- :hlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
95
- :vlineColor => [:pointer, :short, :short, :short, :uint],
96
- :vlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
97
- :rectangleColor => [:pointer, :short, :short, :short, :short, :uint],
98
- :rectangleRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
99
- :roundedRectangleColor => [:pointer, :short, :short, :short, :short, :short, :uint],
100
- :roundedRectangleRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
101
- :boxColor => [:pointer, :short, :short, :short, :short, :uint],
102
- :boxRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
103
- :roundedBoxColor => [:pointer, :short, :short, :short, :short, :short, :uint],
104
- :roundedBoxRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
105
- :lineColor => [:pointer, :short, :short, :short, :short, :uint],
106
- :lineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
107
- :aalineColor => [:pointer, :short, :short, :short, :short, :uint],
108
- :aalineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
109
- :thickLineColor => [:pointer, :short, :short, :short, :short, :uchar, :uint],
110
- :thickLineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar, :uchar],
111
- :circleColor => [:pointer, :short, :short, :short, :uint],
112
- :circleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
113
- :arcColor => [:pointer, :short, :short, :short, :short, :short, :uint],
114
- :arcRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
115
- :aacircleColor => [:pointer, :short, :short, :short, :uint],
116
- :aacircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
117
- :filledCircleColor => [:pointer, :short, :short, :short, :uint],
118
- :filledCircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
119
- :ellipseColor => [:pointer, :short, :short, :short, :short, :uint],
120
- :ellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
121
- :aaellipseColor => [:pointer, :short, :short, :short, :short, :uint],
122
- :aaellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
123
- :filledEllipseColor => [:pointer, :short, :short, :short, :short, :uint],
124
- :filledEllipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
125
- :pieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
126
- :pieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
127
- :filledPieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
128
- :filledPieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
129
- :trigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
130
- :trigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
131
- :aatrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
132
- :aatrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
133
- :filledTrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
134
- :filledTrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
135
- :polygonColor => [:pointer, :pointer, :pointer, :int, :uint],
136
- :polygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
137
- :aapolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
138
- :aapolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
139
- :filledPolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
140
- :filledPolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
141
- :texturedPolygon => [:pointer, :pointer, :pointer, :int, :pointer, :int, :int],
142
- :bezierColor => [:pointer, :pointer, :pointer, :int, :int, :uint],
143
- :bezierRGBA => [:pointer, :pointer, :pointer, :int, :int, :uchar, :uchar, :uchar, :uchar],
144
- :gfxPrimitivesSetFont => [:pointer, :uint, :uint],
145
- :gfxPrimitivesSetFontRotation => [:uint],
146
- :characterColor => [:pointer, :short, :short, :char, :uint],
147
- :characterRGBA => [:pointer, :short, :short, :char, :uchar, :uchar, :uchar, :uchar],
148
- :stringColor => [:pointer, :short, :short, :pointer, :uint],
149
- :stringRGBA => [:pointer, :short, :short, :pointer, :uchar, :uchar, :uchar, :uchar],
150
- }
151
- retvals = {
152
- :pixelColor => :int,
153
- :pixelRGBA => :int,
154
- :hlineColor => :int,
155
- :hlineRGBA => :int,
156
- :vlineColor => :int,
157
- :vlineRGBA => :int,
158
- :rectangleColor => :int,
159
- :rectangleRGBA => :int,
160
- :roundedRectangleColor => :int,
161
- :roundedRectangleRGBA => :int,
162
- :boxColor => :int,
163
- :boxRGBA => :int,
164
- :roundedBoxColor => :int,
165
- :roundedBoxRGBA => :int,
166
- :lineColor => :int,
167
- :lineRGBA => :int,
168
- :aalineColor => :int,
169
- :aalineRGBA => :int,
170
- :thickLineColor => :int,
171
- :thickLineRGBA => :int,
172
- :circleColor => :int,
173
- :circleRGBA => :int,
174
- :arcColor => :int,
175
- :arcRGBA => :int,
176
- :aacircleColor => :int,
177
- :aacircleRGBA => :int,
178
- :filledCircleColor => :int,
179
- :filledCircleRGBA => :int,
180
- :ellipseColor => :int,
181
- :ellipseRGBA => :int,
182
- :aaellipseColor => :int,
183
- :aaellipseRGBA => :int,
184
- :filledEllipseColor => :int,
185
- :filledEllipseRGBA => :int,
186
- :pieColor => :int,
187
- :pieRGBA => :int,
188
- :filledPieColor => :int,
189
- :filledPieRGBA => :int,
190
- :trigonColor => :int,
191
- :trigonRGBA => :int,
192
- :aatrigonColor => :int,
193
- :aatrigonRGBA => :int,
194
- :filledTrigonColor => :int,
195
- :filledTrigonRGBA => :int,
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 => :void,
206
- :gfxPrimitivesSetFontRotation => :void,
207
- :characterColor => :int,
208
- :characterRGBA => :int,
209
- :stringColor => :int,
210
- :stringRGBA => :int,
211
- }
212
- symbols.each do |sym|
213
- begin
214
- attach_function sym, args[sym], retvals[sym]
215
- rescue FFI::NotFoundError => error
216
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
217
- end
218
- end
219
- end
220
-
221
- end
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
+