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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +124 -92
  3. data/LICENSE.txt +1 -1
  4. data/README.md +77 -53
  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 -197
  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 +238 -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 -156
  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 +19 -4
@@ -1,132 +1,164 @@
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
-
20
- # Struct
21
-
22
-
23
- # Function
24
-
25
- def self.setup_gfx_imagefilter_symbols()
26
- symbols = [
27
- :SDL_imageFilterMMXdetect,
28
- :SDL_imageFilterMMXoff,
29
- :SDL_imageFilterMMXon,
30
- :SDL_imageFilterAdd,
31
- :SDL_imageFilterMean,
32
- :SDL_imageFilterSub,
33
- :SDL_imageFilterAbsDiff,
34
- :SDL_imageFilterMult,
35
- :SDL_imageFilterMultNor,
36
- :SDL_imageFilterMultDivby2,
37
- :SDL_imageFilterMultDivby4,
38
- :SDL_imageFilterBitAnd,
39
- :SDL_imageFilterBitOr,
40
- :SDL_imageFilterDiv,
41
- :SDL_imageFilterBitNegation,
42
- :SDL_imageFilterAddByte,
43
- :SDL_imageFilterAddUint,
44
- :SDL_imageFilterAddByteToHalf,
45
- :SDL_imageFilterSubByte,
46
- :SDL_imageFilterSubUint,
47
- :SDL_imageFilterShiftRight,
48
- :SDL_imageFilterShiftRightUint,
49
- :SDL_imageFilterMultByByte,
50
- :SDL_imageFilterShiftRightAndMultByByte,
51
- :SDL_imageFilterShiftLeftByte,
52
- :SDL_imageFilterShiftLeftUint,
53
- :SDL_imageFilterShiftLeft,
54
- :SDL_imageFilterBinarizeUsingThreshold,
55
- :SDL_imageFilterClipToRange,
56
- :SDL_imageFilterNormalizeLinear,
57
- ]
58
- args = {
59
- :SDL_imageFilterMMXdetect => [],
60
- :SDL_imageFilterMMXoff => [],
61
- :SDL_imageFilterMMXon => [],
62
- :SDL_imageFilterAdd => [:pointer, :pointer, :pointer, :uint],
63
- :SDL_imageFilterMean => [:pointer, :pointer, :pointer, :uint],
64
- :SDL_imageFilterSub => [:pointer, :pointer, :pointer, :uint],
65
- :SDL_imageFilterAbsDiff => [:pointer, :pointer, :pointer, :uint],
66
- :SDL_imageFilterMult => [:pointer, :pointer, :pointer, :uint],
67
- :SDL_imageFilterMultNor => [:pointer, :pointer, :pointer, :uint],
68
- :SDL_imageFilterMultDivby2 => [:pointer, :pointer, :pointer, :uint],
69
- :SDL_imageFilterMultDivby4 => [:pointer, :pointer, :pointer, :uint],
70
- :SDL_imageFilterBitAnd => [:pointer, :pointer, :pointer, :uint],
71
- :SDL_imageFilterBitOr => [:pointer, :pointer, :pointer, :uint],
72
- :SDL_imageFilterDiv => [:pointer, :pointer, :pointer, :uint],
73
- :SDL_imageFilterBitNegation => [:pointer, :pointer, :uint],
74
- :SDL_imageFilterAddByte => [:pointer, :pointer, :uint, :uchar],
75
- :SDL_imageFilterAddUint => [:pointer, :pointer, :uint, :uint],
76
- :SDL_imageFilterAddByteToHalf => [:pointer, :pointer, :uint, :uchar],
77
- :SDL_imageFilterSubByte => [:pointer, :pointer, :uint, :uchar],
78
- :SDL_imageFilterSubUint => [:pointer, :pointer, :uint, :uint],
79
- :SDL_imageFilterShiftRight => [:pointer, :pointer, :uint, :uchar],
80
- :SDL_imageFilterShiftRightUint => [:pointer, :pointer, :uint, :uchar],
81
- :SDL_imageFilterMultByByte => [:pointer, :pointer, :uint, :uchar],
82
- :SDL_imageFilterShiftRightAndMultByByte => [:pointer, :pointer, :uint, :uchar, :uchar],
83
- :SDL_imageFilterShiftLeftByte => [:pointer, :pointer, :uint, :uchar],
84
- :SDL_imageFilterShiftLeftUint => [:pointer, :pointer, :uint, :uchar],
85
- :SDL_imageFilterShiftLeft => [:pointer, :pointer, :uint, :uchar],
86
- :SDL_imageFilterBinarizeUsingThreshold => [:pointer, :pointer, :uint, :uchar],
87
- :SDL_imageFilterClipToRange => [:pointer, :pointer, :uint, :uchar, :uchar],
88
- :SDL_imageFilterNormalizeLinear => [:pointer, :pointer, :uint, :int, :int, :int, :int],
89
- }
90
- retvals = {
91
- :SDL_imageFilterMMXdetect => :int,
92
- :SDL_imageFilterMMXoff => :void,
93
- :SDL_imageFilterMMXon => :void,
94
- :SDL_imageFilterAdd => :int,
95
- :SDL_imageFilterMean => :int,
96
- :SDL_imageFilterSub => :int,
97
- :SDL_imageFilterAbsDiff => :int,
98
- :SDL_imageFilterMult => :int,
99
- :SDL_imageFilterMultNor => :int,
100
- :SDL_imageFilterMultDivby2 => :int,
101
- :SDL_imageFilterMultDivby4 => :int,
102
- :SDL_imageFilterBitAnd => :int,
103
- :SDL_imageFilterBitOr => :int,
104
- :SDL_imageFilterDiv => :int,
105
- :SDL_imageFilterBitNegation => :int,
106
- :SDL_imageFilterAddByte => :int,
107
- :SDL_imageFilterAddUint => :int,
108
- :SDL_imageFilterAddByteToHalf => :int,
109
- :SDL_imageFilterSubByte => :int,
110
- :SDL_imageFilterSubUint => :int,
111
- :SDL_imageFilterShiftRight => :int,
112
- :SDL_imageFilterShiftRightUint => :int,
113
- :SDL_imageFilterMultByByte => :int,
114
- :SDL_imageFilterShiftRightAndMultByByte => :int,
115
- :SDL_imageFilterShiftLeftByte => :int,
116
- :SDL_imageFilterShiftLeftUint => :int,
117
- :SDL_imageFilterShiftLeft => :int,
118
- :SDL_imageFilterBinarizeUsingThreshold => :int,
119
- :SDL_imageFilterClipToRange => :int,
120
- :SDL_imageFilterNormalizeLinear => :int,
121
- }
122
- symbols.each do |sym|
123
- begin
124
- attach_function sym, args[sym], retvals[sym]
125
- rescue FFI::NotFoundError => error
126
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
127
- end
128
- end
129
- end
130
-
131
- end
132
-
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
+
23
+ # Function
24
+
25
+ def self.setup_gfx_imagefilter_symbols(output_error = false)
26
+ symbols = [
27
+ :SDL_imageFilterMMXdetect,
28
+ :SDL_imageFilterMMXoff,
29
+ :SDL_imageFilterMMXon,
30
+ :SDL_imageFilterAdd,
31
+ :SDL_imageFilterMean,
32
+ :SDL_imageFilterSub,
33
+ :SDL_imageFilterAbsDiff,
34
+ :SDL_imageFilterMult,
35
+ :SDL_imageFilterMultNor,
36
+ :SDL_imageFilterMultDivby2,
37
+ :SDL_imageFilterMultDivby4,
38
+ :SDL_imageFilterBitAnd,
39
+ :SDL_imageFilterBitOr,
40
+ :SDL_imageFilterDiv,
41
+ :SDL_imageFilterBitNegation,
42
+ :SDL_imageFilterAddByte,
43
+ :SDL_imageFilterAddUint,
44
+ :SDL_imageFilterAddByteToHalf,
45
+ :SDL_imageFilterSubByte,
46
+ :SDL_imageFilterSubUint,
47
+ :SDL_imageFilterShiftRight,
48
+ :SDL_imageFilterShiftRightUint,
49
+ :SDL_imageFilterMultByByte,
50
+ :SDL_imageFilterShiftRightAndMultByByte,
51
+ :SDL_imageFilterShiftLeftByte,
52
+ :SDL_imageFilterShiftLeftUint,
53
+ :SDL_imageFilterShiftLeft,
54
+ :SDL_imageFilterBinarizeUsingThreshold,
55
+ :SDL_imageFilterClipToRange,
56
+ :SDL_imageFilterNormalizeLinear,
57
+ ]
58
+ apis = {
59
+ :SDL_imageFilterMMXdetect => :imageFilterMMXdetect,
60
+ :SDL_imageFilterMMXoff => :imageFilterMMXoff,
61
+ :SDL_imageFilterMMXon => :imageFilterMMXon,
62
+ :SDL_imageFilterAdd => :imageFilterAdd,
63
+ :SDL_imageFilterMean => :imageFilterMean,
64
+ :SDL_imageFilterSub => :imageFilterSub,
65
+ :SDL_imageFilterAbsDiff => :imageFilterAbsDiff,
66
+ :SDL_imageFilterMult => :imageFilterMult,
67
+ :SDL_imageFilterMultNor => :imageFilterMultNor,
68
+ :SDL_imageFilterMultDivby2 => :imageFilterMultDivby2,
69
+ :SDL_imageFilterMultDivby4 => :imageFilterMultDivby4,
70
+ :SDL_imageFilterBitAnd => :imageFilterBitAnd,
71
+ :SDL_imageFilterBitOr => :imageFilterBitOr,
72
+ :SDL_imageFilterDiv => :imageFilterDiv,
73
+ :SDL_imageFilterBitNegation => :imageFilterBitNegation,
74
+ :SDL_imageFilterAddByte => :imageFilterAddByte,
75
+ :SDL_imageFilterAddUint => :imageFilterAddUint,
76
+ :SDL_imageFilterAddByteToHalf => :imageFilterAddByteToHalf,
77
+ :SDL_imageFilterSubByte => :imageFilterSubByte,
78
+ :SDL_imageFilterSubUint => :imageFilterSubUint,
79
+ :SDL_imageFilterShiftRight => :imageFilterShiftRight,
80
+ :SDL_imageFilterShiftRightUint => :imageFilterShiftRightUint,
81
+ :SDL_imageFilterMultByByte => :imageFilterMultByByte,
82
+ :SDL_imageFilterShiftRightAndMultByByte => :imageFilterShiftRightAndMultByByte,
83
+ :SDL_imageFilterShiftLeftByte => :imageFilterShiftLeftByte,
84
+ :SDL_imageFilterShiftLeftUint => :imageFilterShiftLeftUint,
85
+ :SDL_imageFilterShiftLeft => :imageFilterShiftLeft,
86
+ :SDL_imageFilterBinarizeUsingThreshold => :imageFilterBinarizeUsingThreshold,
87
+ :SDL_imageFilterClipToRange => :imageFilterClipToRange,
88
+ :SDL_imageFilterNormalizeLinear => :imageFilterNormalizeLinear,
89
+ }
90
+ args = {
91
+ :SDL_imageFilterMMXdetect => [],
92
+ :SDL_imageFilterMMXoff => [],
93
+ :SDL_imageFilterMMXon => [],
94
+ :SDL_imageFilterAdd => [:pointer, :pointer, :pointer, :uint],
95
+ :SDL_imageFilterMean => [:pointer, :pointer, :pointer, :uint],
96
+ :SDL_imageFilterSub => [:pointer, :pointer, :pointer, :uint],
97
+ :SDL_imageFilterAbsDiff => [:pointer, :pointer, :pointer, :uint],
98
+ :SDL_imageFilterMult => [:pointer, :pointer, :pointer, :uint],
99
+ :SDL_imageFilterMultNor => [:pointer, :pointer, :pointer, :uint],
100
+ :SDL_imageFilterMultDivby2 => [:pointer, :pointer, :pointer, :uint],
101
+ :SDL_imageFilterMultDivby4 => [:pointer, :pointer, :pointer, :uint],
102
+ :SDL_imageFilterBitAnd => [:pointer, :pointer, :pointer, :uint],
103
+ :SDL_imageFilterBitOr => [:pointer, :pointer, :pointer, :uint],
104
+ :SDL_imageFilterDiv => [:pointer, :pointer, :pointer, :uint],
105
+ :SDL_imageFilterBitNegation => [:pointer, :pointer, :uint],
106
+ :SDL_imageFilterAddByte => [:pointer, :pointer, :uint, :uchar],
107
+ :SDL_imageFilterAddUint => [:pointer, :pointer, :uint, :uint],
108
+ :SDL_imageFilterAddByteToHalf => [:pointer, :pointer, :uint, :uchar],
109
+ :SDL_imageFilterSubByte => [:pointer, :pointer, :uint, :uchar],
110
+ :SDL_imageFilterSubUint => [:pointer, :pointer, :uint, :uint],
111
+ :SDL_imageFilterShiftRight => [:pointer, :pointer, :uint, :uchar],
112
+ :SDL_imageFilterShiftRightUint => [:pointer, :pointer, :uint, :uchar],
113
+ :SDL_imageFilterMultByByte => [:pointer, :pointer, :uint, :uchar],
114
+ :SDL_imageFilterShiftRightAndMultByByte => [:pointer, :pointer, :uint, :uchar, :uchar],
115
+ :SDL_imageFilterShiftLeftByte => [:pointer, :pointer, :uint, :uchar],
116
+ :SDL_imageFilterShiftLeftUint => [:pointer, :pointer, :uint, :uchar],
117
+ :SDL_imageFilterShiftLeft => [:pointer, :pointer, :uint, :uchar],
118
+ :SDL_imageFilterBinarizeUsingThreshold => [:pointer, :pointer, :uint, :uchar],
119
+ :SDL_imageFilterClipToRange => [:pointer, :pointer, :uint, :uchar, :uchar],
120
+ :SDL_imageFilterNormalizeLinear => [:pointer, :pointer, :uint, :int, :int, :int, :int],
121
+ }
122
+ retvals = {
123
+ :SDL_imageFilterMMXdetect => :int,
124
+ :SDL_imageFilterMMXoff => :void,
125
+ :SDL_imageFilterMMXon => :void,
126
+ :SDL_imageFilterAdd => :int,
127
+ :SDL_imageFilterMean => :int,
128
+ :SDL_imageFilterSub => :int,
129
+ :SDL_imageFilterAbsDiff => :int,
130
+ :SDL_imageFilterMult => :int,
131
+ :SDL_imageFilterMultNor => :int,
132
+ :SDL_imageFilterMultDivby2 => :int,
133
+ :SDL_imageFilterMultDivby4 => :int,
134
+ :SDL_imageFilterBitAnd => :int,
135
+ :SDL_imageFilterBitOr => :int,
136
+ :SDL_imageFilterDiv => :int,
137
+ :SDL_imageFilterBitNegation => :int,
138
+ :SDL_imageFilterAddByte => :int,
139
+ :SDL_imageFilterAddUint => :int,
140
+ :SDL_imageFilterAddByteToHalf => :int,
141
+ :SDL_imageFilterSubByte => :int,
142
+ :SDL_imageFilterSubUint => :int,
143
+ :SDL_imageFilterShiftRight => :int,
144
+ :SDL_imageFilterShiftRightUint => :int,
145
+ :SDL_imageFilterMultByByte => :int,
146
+ :SDL_imageFilterShiftRightAndMultByByte => :int,
147
+ :SDL_imageFilterShiftLeftByte => :int,
148
+ :SDL_imageFilterShiftLeftUint => :int,
149
+ :SDL_imageFilterShiftLeft => :int,
150
+ :SDL_imageFilterBinarizeUsingThreshold => :int,
151
+ :SDL_imageFilterClipToRange => :int,
152
+ :SDL_imageFilterNormalizeLinear => :int,
153
+ }
154
+ symbols.each do |sym|
155
+ begin
156
+ attach_function apis[sym], sym, args[sym], retvals[sym]
157
+ rescue FFI::NotFoundError => error
158
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
159
+ end
160
+ end
161
+ end
162
+
163
+ end
164
+