sdl2-bindings 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +83 -79
- data/LICENSE.txt +1 -1
- data/README.md +49 -49
- data/lib/sdl2.rb +170 -170
- data/lib/sdl2_audio.rb +219 -201
- data/lib/sdl2_blendmode.rb +69 -69
- data/lib/sdl2_clipboard.rb +51 -51
- data/lib/sdl2_cpuinfo.rb +106 -106
- data/lib/sdl2_error.rb +64 -64
- data/lib/sdl2_events.rb +530 -530
- data/lib/sdl2_filesystem.rb +48 -48
- data/lib/sdl2_framerate.rb +67 -67
- data/lib/sdl2_gamecontroller.rb +254 -254
- data/lib/sdl2_gesture.rb +55 -55
- data/lib/sdl2_gfxPrimitives.rb +222 -222
- data/lib/sdl2_haptic.rb +269 -269
- data/lib/sdl2_hints.rb +174 -174
- data/lib/sdl2_image.rb +185 -185
- data/lib/sdl2_imageFilter.rb +132 -132
- data/lib/sdl2_joystick.rb +230 -230
- data/lib/sdl2_keyboard.rb +99 -99
- data/lib/sdl2_keycode.rb +304 -304
- data/lib/sdl2_log.rb +115 -115
- data/lib/sdl2_main.rb +67 -67
- data/lib/sdl2_messagebox.rb +98 -98
- data/lib/sdl2_mixer.rb +317 -307
- data/lib/sdl2_mouse.rb +117 -117
- data/lib/sdl2_pixels.rb +224 -224
- data/lib/sdl2_platform.rb +45 -45
- data/lib/sdl2_power.rb +51 -51
- data/lib/sdl2_rect.rb +102 -102
- data/lib/sdl2_render.rb +290 -290
- data/lib/sdl2_rotozoom.rb +66 -66
- data/lib/sdl2_rwops.rb +208 -208
- data/lib/sdl2_scancode.rb +287 -287
- data/lib/sdl2_shape.rb +77 -77
- data/lib/sdl2_stdinc.rb +393 -393
- data/lib/sdl2_surface.rb +182 -182
- data/lib/sdl2_syswm.rb +154 -154
- data/lib/sdl2_timer.rb +62 -62
- data/lib/sdl2_touch.rb +73 -73
- data/lib/sdl2_ttf.rb +202 -190
- data/lib/sdl2_version.rb +62 -62
- data/lib/sdl2_video.rb +411 -411
- data/lib/sdl2_vulkan.rb +64 -64
- metadata +6 -6
data/lib/sdl2_timer.rb
CHANGED
@@ -1,62 +1,62 @@
|
|
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
|
-
callback :SDL_TimerCallback, [:uint, :pointer], :uint
|
20
|
-
typedef :int, :SDL_TimerID
|
21
|
-
|
22
|
-
# Struct
|
23
|
-
|
24
|
-
|
25
|
-
# Function
|
26
|
-
|
27
|
-
def self.setup_timer_symbols()
|
28
|
-
symbols = [
|
29
|
-
:SDL_GetTicks,
|
30
|
-
:SDL_GetPerformanceCounter,
|
31
|
-
:SDL_GetPerformanceFrequency,
|
32
|
-
:SDL_Delay,
|
33
|
-
:SDL_AddTimer,
|
34
|
-
:SDL_RemoveTimer,
|
35
|
-
]
|
36
|
-
args = {
|
37
|
-
:SDL_GetTicks => [],
|
38
|
-
:SDL_GetPerformanceCounter => [],
|
39
|
-
:SDL_GetPerformanceFrequency => [],
|
40
|
-
:SDL_Delay => [:uint],
|
41
|
-
:SDL_AddTimer => [:uint, :SDL_TimerCallback, :pointer],
|
42
|
-
:SDL_RemoveTimer => [:int],
|
43
|
-
}
|
44
|
-
retvals = {
|
45
|
-
:SDL_GetTicks => :uint,
|
46
|
-
:SDL_GetPerformanceCounter => :ulong_long,
|
47
|
-
:SDL_GetPerformanceFrequency => :ulong_long,
|
48
|
-
:SDL_Delay => :void,
|
49
|
-
:SDL_AddTimer => :int,
|
50
|
-
:SDL_RemoveTimer => :int,
|
51
|
-
}
|
52
|
-
symbols.each do |sym|
|
53
|
-
begin
|
54
|
-
attach_function sym, args[sym], retvals[sym]
|
55
|
-
rescue FFI::NotFoundError => error
|
56
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
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
|
+
callback :SDL_TimerCallback, [:uint, :pointer], :uint
|
20
|
+
typedef :int, :SDL_TimerID
|
21
|
+
|
22
|
+
# Struct
|
23
|
+
|
24
|
+
|
25
|
+
# Function
|
26
|
+
|
27
|
+
def self.setup_timer_symbols()
|
28
|
+
symbols = [
|
29
|
+
:SDL_GetTicks,
|
30
|
+
:SDL_GetPerformanceCounter,
|
31
|
+
:SDL_GetPerformanceFrequency,
|
32
|
+
:SDL_Delay,
|
33
|
+
:SDL_AddTimer,
|
34
|
+
:SDL_RemoveTimer,
|
35
|
+
]
|
36
|
+
args = {
|
37
|
+
:SDL_GetTicks => [],
|
38
|
+
:SDL_GetPerformanceCounter => [],
|
39
|
+
:SDL_GetPerformanceFrequency => [],
|
40
|
+
:SDL_Delay => [:uint],
|
41
|
+
:SDL_AddTimer => [:uint, :SDL_TimerCallback, :pointer],
|
42
|
+
:SDL_RemoveTimer => [:int],
|
43
|
+
}
|
44
|
+
retvals = {
|
45
|
+
:SDL_GetTicks => :uint,
|
46
|
+
:SDL_GetPerformanceCounter => :ulong_long,
|
47
|
+
:SDL_GetPerformanceFrequency => :ulong_long,
|
48
|
+
:SDL_Delay => :void,
|
49
|
+
:SDL_AddTimer => :int,
|
50
|
+
:SDL_RemoveTimer => :int,
|
51
|
+
}
|
52
|
+
symbols.each do |sym|
|
53
|
+
begin
|
54
|
+
attach_function sym, args[sym], retvals[sym]
|
55
|
+
rescue FFI::NotFoundError => error
|
56
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
data/lib/sdl2_touch.rb
CHANGED
@@ -1,73 +1,73 @@
|
|
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
|
-
SDL_TOUCH_DEVICE_INVALID = -1
|
17
|
-
SDL_TOUCH_DEVICE_DIRECT = 0
|
18
|
-
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE = 1
|
19
|
-
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE = 2
|
20
|
-
|
21
|
-
# Typedef
|
22
|
-
|
23
|
-
typedef :long_long, :SDL_TouchID
|
24
|
-
typedef :long_long, :SDL_FingerID
|
25
|
-
typedef :int, :SDL_TouchDeviceType
|
26
|
-
|
27
|
-
# Struct
|
28
|
-
|
29
|
-
class SDL_Finger < FFI::Struct
|
30
|
-
layout(
|
31
|
-
:id, :long_long,
|
32
|
-
:x, :float,
|
33
|
-
:y, :float,
|
34
|
-
:pressure, :float,
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
|
39
|
-
# Function
|
40
|
-
|
41
|
-
def self.setup_touch_symbols()
|
42
|
-
symbols = [
|
43
|
-
:SDL_GetNumTouchDevices,
|
44
|
-
:SDL_GetTouchDevice,
|
45
|
-
:SDL_GetTouchDeviceType,
|
46
|
-
:SDL_GetNumTouchFingers,
|
47
|
-
:SDL_GetTouchFinger,
|
48
|
-
]
|
49
|
-
args = {
|
50
|
-
:SDL_GetNumTouchDevices => [],
|
51
|
-
:SDL_GetTouchDevice => [:int],
|
52
|
-
:SDL_GetTouchDeviceType => [:long_long],
|
53
|
-
:SDL_GetNumTouchFingers => [:long_long],
|
54
|
-
:SDL_GetTouchFinger => [:long_long, :int],
|
55
|
-
}
|
56
|
-
retvals = {
|
57
|
-
:SDL_GetNumTouchDevices => :int,
|
58
|
-
:SDL_GetTouchDevice => :long_long,
|
59
|
-
:SDL_GetTouchDeviceType => :int,
|
60
|
-
:SDL_GetNumTouchFingers => :int,
|
61
|
-
:SDL_GetTouchFinger => :pointer,
|
62
|
-
}
|
63
|
-
symbols.each do |sym|
|
64
|
-
begin
|
65
|
-
attach_function sym, args[sym], retvals[sym]
|
66
|
-
rescue FFI::NotFoundError => error
|
67
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
73
|
-
|
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
|
+
SDL_TOUCH_DEVICE_INVALID = -1
|
17
|
+
SDL_TOUCH_DEVICE_DIRECT = 0
|
18
|
+
SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE = 1
|
19
|
+
SDL_TOUCH_DEVICE_INDIRECT_RELATIVE = 2
|
20
|
+
|
21
|
+
# Typedef
|
22
|
+
|
23
|
+
typedef :long_long, :SDL_TouchID
|
24
|
+
typedef :long_long, :SDL_FingerID
|
25
|
+
typedef :int, :SDL_TouchDeviceType
|
26
|
+
|
27
|
+
# Struct
|
28
|
+
|
29
|
+
class SDL_Finger < FFI::Struct
|
30
|
+
layout(
|
31
|
+
:id, :long_long,
|
32
|
+
:x, :float,
|
33
|
+
:y, :float,
|
34
|
+
:pressure, :float,
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
|
39
|
+
# Function
|
40
|
+
|
41
|
+
def self.setup_touch_symbols()
|
42
|
+
symbols = [
|
43
|
+
:SDL_GetNumTouchDevices,
|
44
|
+
:SDL_GetTouchDevice,
|
45
|
+
:SDL_GetTouchDeviceType,
|
46
|
+
:SDL_GetNumTouchFingers,
|
47
|
+
:SDL_GetTouchFinger,
|
48
|
+
]
|
49
|
+
args = {
|
50
|
+
:SDL_GetNumTouchDevices => [],
|
51
|
+
:SDL_GetTouchDevice => [:int],
|
52
|
+
:SDL_GetTouchDeviceType => [:long_long],
|
53
|
+
:SDL_GetNumTouchFingers => [:long_long],
|
54
|
+
:SDL_GetTouchFinger => [:long_long, :int],
|
55
|
+
}
|
56
|
+
retvals = {
|
57
|
+
:SDL_GetNumTouchDevices => :int,
|
58
|
+
:SDL_GetTouchDevice => :long_long,
|
59
|
+
:SDL_GetTouchDeviceType => :int,
|
60
|
+
:SDL_GetNumTouchFingers => :int,
|
61
|
+
:SDL_GetTouchFinger => :pointer,
|
62
|
+
}
|
63
|
+
symbols.each do |sym|
|
64
|
+
begin
|
65
|
+
attach_function sym, args[sym], retvals[sym]
|
66
|
+
rescue FFI::NotFoundError => error
|
67
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
|
data/lib/sdl2_ttf.rb
CHANGED
@@ -1,190 +1,202 @@
|
|
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
|
-
require_relative 'sdl2_pixels'
|
9
|
-
|
10
|
-
module SDL2
|
11
|
-
extend FFI::Library
|
12
|
-
# Define/Macro
|
13
|
-
|
14
|
-
SDL_TTF_MAJOR_VERSION = 2
|
15
|
-
SDL_TTF_MINOR_VERSION = 0
|
16
|
-
SDL_TTF_PATCHLEVEL = 15
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
79
|
-
|
80
|
-
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
|
92
|
-
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
:
|
123
|
-
:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
|
130
|
-
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
135
|
-
:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
|
142
|
-
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
:
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
163
|
-
:
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
:
|
175
|
-
:
|
176
|
-
:
|
177
|
-
:
|
178
|
-
:
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
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
|
+
require_relative 'sdl2_pixels'
|
9
|
+
|
10
|
+
module SDL2
|
11
|
+
extend FFI::Library
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
SDL_TTF_MAJOR_VERSION = 2
|
15
|
+
SDL_TTF_MINOR_VERSION = 0
|
16
|
+
SDL_TTF_PATCHLEVEL = 15
|
17
|
+
TTF_MAJOR_VERSION = SDL_TTF_MAJOR_VERSION
|
18
|
+
TTF_MINOR_VERSION = SDL_TTF_MINOR_VERSION
|
19
|
+
TTF_PATCHLEVEL = SDL_TTF_PATCHLEVEL
|
20
|
+
TTF_STYLE_NORMAL = 0x00
|
21
|
+
TTF_STYLE_BOLD = 0x01
|
22
|
+
TTF_STYLE_ITALIC = 0x02
|
23
|
+
TTF_STYLE_UNDERLINE = 0x04
|
24
|
+
TTF_STYLE_STRIKETHROUGH = 0x08
|
25
|
+
TTF_HINTING_NORMAL = 0
|
26
|
+
TTF_HINTING_LIGHT = 1
|
27
|
+
TTF_HINTING_MONO = 2
|
28
|
+
TTF_HINTING_NONE = 3
|
29
|
+
|
30
|
+
# Enum
|
31
|
+
|
32
|
+
|
33
|
+
# Typedef
|
34
|
+
|
35
|
+
|
36
|
+
# Struct
|
37
|
+
|
38
|
+
|
39
|
+
# Function
|
40
|
+
|
41
|
+
def self.setup_ttf_symbols()
|
42
|
+
symbols = [
|
43
|
+
:TTF_Linked_Version,
|
44
|
+
:TTF_ByteSwappedUNICODE,
|
45
|
+
:TTF_Init,
|
46
|
+
:TTF_OpenFont,
|
47
|
+
:TTF_OpenFontIndex,
|
48
|
+
:TTF_OpenFontRW,
|
49
|
+
:TTF_OpenFontIndexRW,
|
50
|
+
:TTF_GetFontStyle,
|
51
|
+
:TTF_SetFontStyle,
|
52
|
+
:TTF_GetFontOutline,
|
53
|
+
:TTF_SetFontOutline,
|
54
|
+
:TTF_GetFontHinting,
|
55
|
+
:TTF_SetFontHinting,
|
56
|
+
:TTF_FontHeight,
|
57
|
+
:TTF_FontAscent,
|
58
|
+
:TTF_FontDescent,
|
59
|
+
:TTF_FontLineSkip,
|
60
|
+
:TTF_GetFontKerning,
|
61
|
+
:TTF_SetFontKerning,
|
62
|
+
:TTF_FontFaces,
|
63
|
+
:TTF_FontFaceIsFixedWidth,
|
64
|
+
:TTF_FontFaceFamilyName,
|
65
|
+
:TTF_FontFaceStyleName,
|
66
|
+
:TTF_GlyphIsProvided,
|
67
|
+
:TTF_GlyphMetrics,
|
68
|
+
:TTF_SizeText,
|
69
|
+
:TTF_SizeUTF8,
|
70
|
+
:TTF_SizeUNICODE,
|
71
|
+
:TTF_RenderText_Solid,
|
72
|
+
:TTF_RenderUTF8_Solid,
|
73
|
+
:TTF_RenderUNICODE_Solid,
|
74
|
+
:TTF_RenderGlyph_Solid,
|
75
|
+
:TTF_RenderText_Shaded,
|
76
|
+
:TTF_RenderUTF8_Shaded,
|
77
|
+
:TTF_RenderUNICODE_Shaded,
|
78
|
+
:TTF_RenderGlyph_Shaded,
|
79
|
+
:TTF_RenderText_Blended,
|
80
|
+
:TTF_RenderUTF8_Blended,
|
81
|
+
:TTF_RenderUNICODE_Blended,
|
82
|
+
:TTF_RenderText_Blended_Wrapped,
|
83
|
+
:TTF_RenderUTF8_Blended_Wrapped,
|
84
|
+
:TTF_RenderUNICODE_Blended_Wrapped,
|
85
|
+
:TTF_RenderGlyph_Blended,
|
86
|
+
:TTF_CloseFont,
|
87
|
+
:TTF_Quit,
|
88
|
+
:TTF_WasInit,
|
89
|
+
:TTF_GetFontKerningSize,
|
90
|
+
:TTF_GetFontKerningSizeGlyphs,
|
91
|
+
]
|
92
|
+
args = {
|
93
|
+
:TTF_Linked_Version => [],
|
94
|
+
:TTF_ByteSwappedUNICODE => [:int],
|
95
|
+
:TTF_Init => [],
|
96
|
+
:TTF_OpenFont => [:pointer, :int],
|
97
|
+
:TTF_OpenFontIndex => [:pointer, :int, :long],
|
98
|
+
:TTF_OpenFontRW => [:pointer, :int, :int],
|
99
|
+
:TTF_OpenFontIndexRW => [:pointer, :int, :int, :long],
|
100
|
+
:TTF_GetFontStyle => [:pointer],
|
101
|
+
:TTF_SetFontStyle => [:pointer, :int],
|
102
|
+
:TTF_GetFontOutline => [:pointer],
|
103
|
+
:TTF_SetFontOutline => [:pointer, :int],
|
104
|
+
:TTF_GetFontHinting => [:pointer],
|
105
|
+
:TTF_SetFontHinting => [:pointer, :int],
|
106
|
+
:TTF_FontHeight => [:pointer],
|
107
|
+
:TTF_FontAscent => [:pointer],
|
108
|
+
:TTF_FontDescent => [:pointer],
|
109
|
+
:TTF_FontLineSkip => [:pointer],
|
110
|
+
:TTF_GetFontKerning => [:pointer],
|
111
|
+
:TTF_SetFontKerning => [:pointer, :int],
|
112
|
+
:TTF_FontFaces => [:pointer],
|
113
|
+
:TTF_FontFaceIsFixedWidth => [:pointer],
|
114
|
+
:TTF_FontFaceFamilyName => [:pointer],
|
115
|
+
:TTF_FontFaceStyleName => [:pointer],
|
116
|
+
:TTF_GlyphIsProvided => [:pointer, :ushort],
|
117
|
+
:TTF_GlyphMetrics => [:pointer, :ushort, :pointer, :pointer, :pointer, :pointer, :pointer],
|
118
|
+
:TTF_SizeText => [:pointer, :pointer, :pointer, :pointer],
|
119
|
+
:TTF_SizeUTF8 => [:pointer, :pointer, :pointer, :pointer],
|
120
|
+
:TTF_SizeUNICODE => [:pointer, :pointer, :pointer, :pointer],
|
121
|
+
:TTF_RenderText_Solid => [:pointer, :pointer, SDL_Color],
|
122
|
+
:TTF_RenderUTF8_Solid => [:pointer, :pointer, SDL_Color],
|
123
|
+
:TTF_RenderUNICODE_Solid => [:pointer, :pointer, SDL_Color],
|
124
|
+
:TTF_RenderGlyph_Solid => [:pointer, :ushort, SDL_Color],
|
125
|
+
:TTF_RenderText_Shaded => [:pointer, :pointer, SDL_Color, SDL_Color],
|
126
|
+
:TTF_RenderUTF8_Shaded => [:pointer, :pointer, SDL_Color, SDL_Color],
|
127
|
+
:TTF_RenderUNICODE_Shaded => [:pointer, :pointer, SDL_Color, SDL_Color],
|
128
|
+
:TTF_RenderGlyph_Shaded => [:pointer, :ushort, SDL_Color, SDL_Color],
|
129
|
+
:TTF_RenderText_Blended => [:pointer, :pointer, SDL_Color],
|
130
|
+
:TTF_RenderUTF8_Blended => [:pointer, :pointer, SDL_Color],
|
131
|
+
:TTF_RenderUNICODE_Blended => [:pointer, :pointer, SDL_Color],
|
132
|
+
:TTF_RenderText_Blended_Wrapped => [:pointer, :pointer, SDL_Color, :uint],
|
133
|
+
:TTF_RenderUTF8_Blended_Wrapped => [:pointer, :pointer, SDL_Color, :uint],
|
134
|
+
:TTF_RenderUNICODE_Blended_Wrapped => [:pointer, :pointer, SDL_Color, :uint],
|
135
|
+
:TTF_RenderGlyph_Blended => [:pointer, :ushort, SDL_Color],
|
136
|
+
:TTF_CloseFont => [:pointer],
|
137
|
+
:TTF_Quit => [],
|
138
|
+
:TTF_WasInit => [],
|
139
|
+
:TTF_GetFontKerningSize => [:pointer, :int, :int],
|
140
|
+
:TTF_GetFontKerningSizeGlyphs => [:pointer, :ushort, :ushort],
|
141
|
+
}
|
142
|
+
retvals = {
|
143
|
+
:TTF_Linked_Version => :pointer,
|
144
|
+
:TTF_ByteSwappedUNICODE => :void,
|
145
|
+
:TTF_Init => :int,
|
146
|
+
:TTF_OpenFont => :pointer,
|
147
|
+
:TTF_OpenFontIndex => :pointer,
|
148
|
+
:TTF_OpenFontRW => :pointer,
|
149
|
+
:TTF_OpenFontIndexRW => :pointer,
|
150
|
+
:TTF_GetFontStyle => :int,
|
151
|
+
:TTF_SetFontStyle => :void,
|
152
|
+
:TTF_GetFontOutline => :int,
|
153
|
+
:TTF_SetFontOutline => :void,
|
154
|
+
:TTF_GetFontHinting => :int,
|
155
|
+
:TTF_SetFontHinting => :void,
|
156
|
+
:TTF_FontHeight => :int,
|
157
|
+
:TTF_FontAscent => :int,
|
158
|
+
:TTF_FontDescent => :int,
|
159
|
+
:TTF_FontLineSkip => :int,
|
160
|
+
:TTF_GetFontKerning => :int,
|
161
|
+
:TTF_SetFontKerning => :void,
|
162
|
+
:TTF_FontFaces => :long,
|
163
|
+
:TTF_FontFaceIsFixedWidth => :int,
|
164
|
+
:TTF_FontFaceFamilyName => :pointer,
|
165
|
+
:TTF_FontFaceStyleName => :pointer,
|
166
|
+
:TTF_GlyphIsProvided => :int,
|
167
|
+
:TTF_GlyphMetrics => :int,
|
168
|
+
:TTF_SizeText => :int,
|
169
|
+
:TTF_SizeUTF8 => :int,
|
170
|
+
:TTF_SizeUNICODE => :int,
|
171
|
+
:TTF_RenderText_Solid => :pointer,
|
172
|
+
:TTF_RenderUTF8_Solid => :pointer,
|
173
|
+
:TTF_RenderUNICODE_Solid => :pointer,
|
174
|
+
:TTF_RenderGlyph_Solid => :pointer,
|
175
|
+
:TTF_RenderText_Shaded => :pointer,
|
176
|
+
:TTF_RenderUTF8_Shaded => :pointer,
|
177
|
+
:TTF_RenderUNICODE_Shaded => :pointer,
|
178
|
+
:TTF_RenderGlyph_Shaded => :pointer,
|
179
|
+
:TTF_RenderText_Blended => :pointer,
|
180
|
+
:TTF_RenderUTF8_Blended => :pointer,
|
181
|
+
:TTF_RenderUNICODE_Blended => :pointer,
|
182
|
+
:TTF_RenderText_Blended_Wrapped => :pointer,
|
183
|
+
:TTF_RenderUTF8_Blended_Wrapped => :pointer,
|
184
|
+
:TTF_RenderUNICODE_Blended_Wrapped => :pointer,
|
185
|
+
:TTF_RenderGlyph_Blended => :pointer,
|
186
|
+
:TTF_CloseFont => :void,
|
187
|
+
:TTF_Quit => :void,
|
188
|
+
:TTF_WasInit => :int,
|
189
|
+
:TTF_GetFontKerningSize => :int,
|
190
|
+
:TTF_GetFontKerningSizeGlyphs => :int,
|
191
|
+
}
|
192
|
+
symbols.each do |sym|
|
193
|
+
begin
|
194
|
+
attach_function sym, args[sym], retvals[sym]
|
195
|
+
rescue FFI::NotFoundError => error
|
196
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|