sdl2-bindings 0.1.1 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +140 -124
  3. data/LICENSE.txt +0 -0
  4. data/README.md +93 -77
  5. data/lib/sdl2.rb +131 -131
  6. data/lib/sdl2_audio.rb +265 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +137 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +575 -564
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +345 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_guid.rb +58 -0
  18. data/lib/sdl2_haptic.rb +301 -301
  19. data/lib/sdl2_hidapi.rb +139 -139
  20. data/lib/sdl2_hints.rb +240 -221
  21. data/lib/sdl2_image.rb +296 -232
  22. data/lib/sdl2_imageFilter.rb +164 -164
  23. data/lib/sdl2_joystick.rb +332 -294
  24. data/lib/sdl2_keyboard.rb +129 -125
  25. data/lib/sdl2_keycode.rb +311 -307
  26. data/lib/sdl2_log.rb +131 -131
  27. data/lib/sdl2_main.rb +74 -74
  28. data/lib/sdl2_messagebox.rb +102 -102
  29. data/lib/sdl2_misc.rb +48 -48
  30. data/lib/sdl2_mixer.rb +464 -392
  31. data/lib/sdl2_mouse.rb +136 -136
  32. data/lib/sdl2_pixels.rb +240 -240
  33. data/lib/sdl2_platform.rb +48 -48
  34. data/lib/sdl2_power.rb +54 -54
  35. data/lib/sdl2_rect.rb +145 -145
  36. data/lib/sdl2_render.rb +408 -408
  37. data/lib/sdl2_rotozoom.rb +76 -76
  38. data/lib/sdl2_rwops.rb +242 -238
  39. data/lib/sdl2_scancode.rb +293 -289
  40. data/lib/sdl2_sensor.rb +115 -115
  41. data/lib/sdl2_shape.rb +83 -83
  42. data/lib/sdl2_sound.rb +154 -154
  43. data/lib/sdl2_stdinc.rb +564 -556
  44. data/lib/sdl2_surface.rb +229 -229
  45. data/lib/sdl2_syswm.rb +160 -160
  46. data/lib/sdl2_timer.rb +74 -74
  47. data/lib/sdl2_touch.rb +86 -86
  48. data/lib/sdl2_ttf.rb +414 -358
  49. data/lib/sdl2_version.rb +67 -67
  50. data/lib/sdl2_video.rb +549 -540
  51. data/lib/sdl2_vulkan.rb +72 -72
  52. metadata +4 -3
@@ -1,283 +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 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
-
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
+
data/lib/sdl2_guid.rb ADDED
@@ -0,0 +1,58 @@
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
+
20
+ # Struct
21
+
22
+ class GUID < FFI::Struct
23
+ layout(
24
+ :data, [:uchar, 16],
25
+ )
26
+ end
27
+
28
+
29
+ # Function
30
+
31
+ def self.setup_guid_symbols(output_error = false)
32
+ symbols = [
33
+ :SDL_GUIDToString,
34
+ :SDL_GUIDFromString,
35
+ ]
36
+ apis = {
37
+ :SDL_GUIDToString => :GUIDToString,
38
+ :SDL_GUIDFromString => :GUIDFromString,
39
+ }
40
+ args = {
41
+ :SDL_GUIDToString => [GUID.by_value, :pointer, :int],
42
+ :SDL_GUIDFromString => [:pointer],
43
+ }
44
+ retvals = {
45
+ :SDL_GUIDToString => :void,
46
+ :SDL_GUIDFromString => GUID.by_value,
47
+ }
48
+ symbols.each do |sym|
49
+ begin
50
+ attach_function apis[sym], sym, args[sym], retvals[sym]
51
+ rescue FFI::NotFoundError => error
52
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
53
+ end
54
+ end
55
+ end
56
+
57
+ end
58
+