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.
- checksums.yaml +4 -4
- data/ChangeLog +129 -96
- data/LICENSE.txt +0 -0
- data/README.md +78 -55
- 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 -198
- 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 +242 -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 -157
- 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 +18 -3
data/lib/sdl2_imageFilter.rb
CHANGED
@@ -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
|
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
|
-
|
59
|
-
:SDL_imageFilterMMXdetect =>
|
60
|
-
:SDL_imageFilterMMXoff =>
|
61
|
-
:SDL_imageFilterMMXon =>
|
62
|
-
:SDL_imageFilterAdd =>
|
63
|
-
:SDL_imageFilterMean =>
|
64
|
-
:SDL_imageFilterSub =>
|
65
|
-
:SDL_imageFilterAbsDiff =>
|
66
|
-
:SDL_imageFilterMult =>
|
67
|
-
:SDL_imageFilterMultNor =>
|
68
|
-
:SDL_imageFilterMultDivby2 =>
|
69
|
-
:SDL_imageFilterMultDivby4 =>
|
70
|
-
:SDL_imageFilterBitAnd =>
|
71
|
-
:SDL_imageFilterBitOr =>
|
72
|
-
:SDL_imageFilterDiv =>
|
73
|
-
:SDL_imageFilterBitNegation =>
|
74
|
-
:SDL_imageFilterAddByte =>
|
75
|
-
:SDL_imageFilterAddUint =>
|
76
|
-
:SDL_imageFilterAddByteToHalf =>
|
77
|
-
:SDL_imageFilterSubByte =>
|
78
|
-
:SDL_imageFilterSubUint =>
|
79
|
-
:SDL_imageFilterShiftRight =>
|
80
|
-
:SDL_imageFilterShiftRightUint =>
|
81
|
-
:SDL_imageFilterMultByByte =>
|
82
|
-
:SDL_imageFilterShiftRightAndMultByByte =>
|
83
|
-
:SDL_imageFilterShiftLeftByte =>
|
84
|
-
:SDL_imageFilterShiftLeftUint =>
|
85
|
-
:SDL_imageFilterShiftLeft =>
|
86
|
-
:SDL_imageFilterBinarizeUsingThreshold =>
|
87
|
-
:SDL_imageFilterClipToRange =>
|
88
|
-
:SDL_imageFilterNormalizeLinear =>
|
89
|
-
}
|
90
|
-
|
91
|
-
:SDL_imageFilterMMXdetect =>
|
92
|
-
:SDL_imageFilterMMXoff =>
|
93
|
-
:SDL_imageFilterMMXon =>
|
94
|
-
:SDL_imageFilterAdd => :
|
95
|
-
:SDL_imageFilterMean => :
|
96
|
-
:SDL_imageFilterSub => :
|
97
|
-
:SDL_imageFilterAbsDiff => :
|
98
|
-
:SDL_imageFilterMult => :
|
99
|
-
:SDL_imageFilterMultNor => :
|
100
|
-
:SDL_imageFilterMultDivby2 => :
|
101
|
-
:SDL_imageFilterMultDivby4 => :
|
102
|
-
:SDL_imageFilterBitAnd => :
|
103
|
-
:SDL_imageFilterBitOr => :
|
104
|
-
:SDL_imageFilterDiv => :
|
105
|
-
:SDL_imageFilterBitNegation => :
|
106
|
-
:SDL_imageFilterAddByte => :
|
107
|
-
:SDL_imageFilterAddUint => :
|
108
|
-
:SDL_imageFilterAddByteToHalf => :
|
109
|
-
:SDL_imageFilterSubByte => :
|
110
|
-
:SDL_imageFilterSubUint => :
|
111
|
-
:SDL_imageFilterShiftRight => :
|
112
|
-
:SDL_imageFilterShiftRightUint => :
|
113
|
-
:SDL_imageFilterMultByByte => :
|
114
|
-
:SDL_imageFilterShiftRightAndMultByByte => :
|
115
|
-
:SDL_imageFilterShiftLeftByte => :
|
116
|
-
:SDL_imageFilterShiftLeftUint => :
|
117
|
-
:SDL_imageFilterShiftLeft => :
|
118
|
-
:SDL_imageFilterBinarizeUsingThreshold => :
|
119
|
-
:SDL_imageFilterClipToRange => :
|
120
|
-
:SDL_imageFilterNormalizeLinear => :int,
|
121
|
-
}
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
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
|
+
|