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.
- checksums.yaml +4 -4
- data/ChangeLog +124 -92
- data/LICENSE.txt +1 -1
- data/README.md +77 -53
- 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 -197
- 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 +238 -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 -156
- 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 +19 -4
data/lib/sdl2_ttf.rb
CHANGED
@@ -1,202 +1,358 @@
|
|
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
|
11
|
-
extend FFI::Library
|
12
|
-
# Define/Macro
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
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
|
-
:TTF_ByteSwappedUNICODE,
|
45
|
-
:TTF_Init,
|
46
|
-
:TTF_OpenFont,
|
47
|
-
:TTF_OpenFontIndex,
|
48
|
-
:TTF_OpenFontRW,
|
49
|
-
:TTF_OpenFontIndexRW,
|
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
|
-
:
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
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 SDL
|
11
|
+
extend FFI::Library
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
TTF_MAJOR_VERSION = 2
|
15
|
+
TTF_MINOR_VERSION = 0
|
16
|
+
TTF_PATCHLEVEL = 15
|
17
|
+
TTF_STYLE_NORMAL = 0x00
|
18
|
+
TTF_STYLE_BOLD = 0x01
|
19
|
+
TTF_STYLE_ITALIC = 0x02
|
20
|
+
TTF_STYLE_UNDERLINE = 0x04
|
21
|
+
TTF_STYLE_STRIKETHROUGH = 0x08
|
22
|
+
TTF_HINTING_NORMAL = 0
|
23
|
+
TTF_HINTING_LIGHT = 1
|
24
|
+
TTF_HINTING_MONO = 2
|
25
|
+
TTF_HINTING_NONE = 3
|
26
|
+
TTF_HINTING_LIGHT_SUBPIXEL = 4
|
27
|
+
|
28
|
+
# Enum
|
29
|
+
|
30
|
+
|
31
|
+
# Typedef
|
32
|
+
|
33
|
+
|
34
|
+
# Struct
|
35
|
+
|
36
|
+
|
37
|
+
# Function
|
38
|
+
|
39
|
+
def self.setup_ttf_symbols(output_error = false)
|
40
|
+
symbols = [
|
41
|
+
:TTF_Linked_Version,
|
42
|
+
:TTF_GetFreeTypeVersion,
|
43
|
+
:TTF_GetHarfBuzzVersion,
|
44
|
+
:TTF_ByteSwappedUNICODE,
|
45
|
+
:TTF_Init,
|
46
|
+
:TTF_OpenFont,
|
47
|
+
:TTF_OpenFontIndex,
|
48
|
+
:TTF_OpenFontRW,
|
49
|
+
:TTF_OpenFontIndexRW,
|
50
|
+
:TTF_OpenFontDPI,
|
51
|
+
:TTF_OpenFontIndexDPI,
|
52
|
+
:TTF_OpenFontDPIRW,
|
53
|
+
:TTF_OpenFontIndexDPIRW,
|
54
|
+
:TTF_SetFontSize,
|
55
|
+
:TTF_SetFontSizeDPI,
|
56
|
+
:TTF_GetFontStyle,
|
57
|
+
:TTF_SetFontStyle,
|
58
|
+
:TTF_GetFontOutline,
|
59
|
+
:TTF_SetFontOutline,
|
60
|
+
:TTF_GetFontHinting,
|
61
|
+
:TTF_SetFontHinting,
|
62
|
+
:TTF_FontHeight,
|
63
|
+
:TTF_FontAscent,
|
64
|
+
:TTF_FontDescent,
|
65
|
+
:TTF_FontLineSkip,
|
66
|
+
:TTF_GetFontKerning,
|
67
|
+
:TTF_SetFontKerning,
|
68
|
+
:TTF_FontFaces,
|
69
|
+
:TTF_FontFaceIsFixedWidth,
|
70
|
+
:TTF_FontFaceFamilyName,
|
71
|
+
:TTF_FontFaceStyleName,
|
72
|
+
:TTF_GlyphIsProvided,
|
73
|
+
:TTF_GlyphIsProvided32,
|
74
|
+
:TTF_GlyphMetrics,
|
75
|
+
:TTF_GlyphMetrics32,
|
76
|
+
:TTF_SizeText,
|
77
|
+
:TTF_SizeUTF8,
|
78
|
+
:TTF_SizeUNICODE,
|
79
|
+
:TTF_MeasureText,
|
80
|
+
:TTF_MeasureUTF8,
|
81
|
+
:TTF_MeasureUNICODE,
|
82
|
+
:TTF_RenderText_Solid,
|
83
|
+
:TTF_RenderUTF8_Solid,
|
84
|
+
:TTF_RenderUNICODE_Solid,
|
85
|
+
:TTF_RenderText_Solid_Wrapped,
|
86
|
+
:TTF_RenderUTF8_Solid_Wrapped,
|
87
|
+
:TTF_RenderUNICODE_Solid_Wrapped,
|
88
|
+
:TTF_RenderGlyph_Solid,
|
89
|
+
:TTF_RenderGlyph32_Solid,
|
90
|
+
:TTF_RenderText_Shaded,
|
91
|
+
:TTF_RenderUTF8_Shaded,
|
92
|
+
:TTF_RenderUNICODE_Shaded,
|
93
|
+
:TTF_RenderText_Shaded_Wrapped,
|
94
|
+
:TTF_RenderUTF8_Shaded_Wrapped,
|
95
|
+
:TTF_RenderUNICODE_Shaded_Wrapped,
|
96
|
+
:TTF_RenderGlyph_Shaded,
|
97
|
+
:TTF_RenderGlyph32_Shaded,
|
98
|
+
:TTF_RenderText_Blended,
|
99
|
+
:TTF_RenderUTF8_Blended,
|
100
|
+
:TTF_RenderUNICODE_Blended,
|
101
|
+
:TTF_RenderText_Blended_Wrapped,
|
102
|
+
:TTF_RenderUTF8_Blended_Wrapped,
|
103
|
+
:TTF_RenderUNICODE_Blended_Wrapped,
|
104
|
+
:TTF_RenderGlyph_Blended,
|
105
|
+
:TTF_RenderGlyph32_Blended,
|
106
|
+
:TTF_SetDirection,
|
107
|
+
:TTF_SetScript,
|
108
|
+
:TTF_CloseFont,
|
109
|
+
:TTF_Quit,
|
110
|
+
:TTF_WasInit,
|
111
|
+
:TTF_GetFontKerningSize,
|
112
|
+
:TTF_GetFontKerningSizeGlyphs,
|
113
|
+
:TTF_GetFontKerningSizeGlyphs32,
|
114
|
+
:TTF_SetFontSDF,
|
115
|
+
:TTF_GetFontSDF,
|
116
|
+
]
|
117
|
+
apis = {
|
118
|
+
:TTF_Linked_Version => :TTF_Linked_Version,
|
119
|
+
:TTF_GetFreeTypeVersion => :TTF_GetFreeTypeVersion,
|
120
|
+
:TTF_GetHarfBuzzVersion => :TTF_GetHarfBuzzVersion,
|
121
|
+
:TTF_ByteSwappedUNICODE => :TTF_ByteSwappedUNICODE,
|
122
|
+
:TTF_Init => :TTF_Init,
|
123
|
+
:TTF_OpenFont => :TTF_OpenFont,
|
124
|
+
:TTF_OpenFontIndex => :TTF_OpenFontIndex,
|
125
|
+
:TTF_OpenFontRW => :TTF_OpenFontRW,
|
126
|
+
:TTF_OpenFontIndexRW => :TTF_OpenFontIndexRW,
|
127
|
+
:TTF_OpenFontDPI => :TTF_OpenFontDPI,
|
128
|
+
:TTF_OpenFontIndexDPI => :TTF_OpenFontIndexDPI,
|
129
|
+
:TTF_OpenFontDPIRW => :TTF_OpenFontDPIRW,
|
130
|
+
:TTF_OpenFontIndexDPIRW => :TTF_OpenFontIndexDPIRW,
|
131
|
+
:TTF_SetFontSize => :TTF_SetFontSize,
|
132
|
+
:TTF_SetFontSizeDPI => :TTF_SetFontSizeDPI,
|
133
|
+
:TTF_GetFontStyle => :TTF_GetFontStyle,
|
134
|
+
:TTF_SetFontStyle => :TTF_SetFontStyle,
|
135
|
+
:TTF_GetFontOutline => :TTF_GetFontOutline,
|
136
|
+
:TTF_SetFontOutline => :TTF_SetFontOutline,
|
137
|
+
:TTF_GetFontHinting => :TTF_GetFontHinting,
|
138
|
+
:TTF_SetFontHinting => :TTF_SetFontHinting,
|
139
|
+
:TTF_FontHeight => :TTF_FontHeight,
|
140
|
+
:TTF_FontAscent => :TTF_FontAscent,
|
141
|
+
:TTF_FontDescent => :TTF_FontDescent,
|
142
|
+
:TTF_FontLineSkip => :TTF_FontLineSkip,
|
143
|
+
:TTF_GetFontKerning => :TTF_GetFontKerning,
|
144
|
+
:TTF_SetFontKerning => :TTF_SetFontKerning,
|
145
|
+
:TTF_FontFaces => :TTF_FontFaces,
|
146
|
+
:TTF_FontFaceIsFixedWidth => :TTF_FontFaceIsFixedWidth,
|
147
|
+
:TTF_FontFaceFamilyName => :TTF_FontFaceFamilyName,
|
148
|
+
:TTF_FontFaceStyleName => :TTF_FontFaceStyleName,
|
149
|
+
:TTF_GlyphIsProvided => :TTF_GlyphIsProvided,
|
150
|
+
:TTF_GlyphIsProvided32 => :TTF_GlyphIsProvided32,
|
151
|
+
:TTF_GlyphMetrics => :TTF_GlyphMetrics,
|
152
|
+
:TTF_GlyphMetrics32 => :TTF_GlyphMetrics32,
|
153
|
+
:TTF_SizeText => :TTF_SizeText,
|
154
|
+
:TTF_SizeUTF8 => :TTF_SizeUTF8,
|
155
|
+
:TTF_SizeUNICODE => :TTF_SizeUNICODE,
|
156
|
+
:TTF_MeasureText => :TTF_MeasureText,
|
157
|
+
:TTF_MeasureUTF8 => :TTF_MeasureUTF8,
|
158
|
+
:TTF_MeasureUNICODE => :TTF_MeasureUNICODE,
|
159
|
+
:TTF_RenderText_Solid => :TTF_RenderText_Solid,
|
160
|
+
:TTF_RenderUTF8_Solid => :TTF_RenderUTF8_Solid,
|
161
|
+
:TTF_RenderUNICODE_Solid => :TTF_RenderUNICODE_Solid,
|
162
|
+
:TTF_RenderText_Solid_Wrapped => :TTF_RenderText_Solid_Wrapped,
|
163
|
+
:TTF_RenderUTF8_Solid_Wrapped => :TTF_RenderUTF8_Solid_Wrapped,
|
164
|
+
:TTF_RenderUNICODE_Solid_Wrapped => :TTF_RenderUNICODE_Solid_Wrapped,
|
165
|
+
:TTF_RenderGlyph_Solid => :TTF_RenderGlyph_Solid,
|
166
|
+
:TTF_RenderGlyph32_Solid => :TTF_RenderGlyph32_Solid,
|
167
|
+
:TTF_RenderText_Shaded => :TTF_RenderText_Shaded,
|
168
|
+
:TTF_RenderUTF8_Shaded => :TTF_RenderUTF8_Shaded,
|
169
|
+
:TTF_RenderUNICODE_Shaded => :TTF_RenderUNICODE_Shaded,
|
170
|
+
:TTF_RenderText_Shaded_Wrapped => :TTF_RenderText_Shaded_Wrapped,
|
171
|
+
:TTF_RenderUTF8_Shaded_Wrapped => :TTF_RenderUTF8_Shaded_Wrapped,
|
172
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => :TTF_RenderUNICODE_Shaded_Wrapped,
|
173
|
+
:TTF_RenderGlyph_Shaded => :TTF_RenderGlyph_Shaded,
|
174
|
+
:TTF_RenderGlyph32_Shaded => :TTF_RenderGlyph32_Shaded,
|
175
|
+
:TTF_RenderText_Blended => :TTF_RenderText_Blended,
|
176
|
+
:TTF_RenderUTF8_Blended => :TTF_RenderUTF8_Blended,
|
177
|
+
:TTF_RenderUNICODE_Blended => :TTF_RenderUNICODE_Blended,
|
178
|
+
:TTF_RenderText_Blended_Wrapped => :TTF_RenderText_Blended_Wrapped,
|
179
|
+
:TTF_RenderUTF8_Blended_Wrapped => :TTF_RenderUTF8_Blended_Wrapped,
|
180
|
+
:TTF_RenderUNICODE_Blended_Wrapped => :TTF_RenderUNICODE_Blended_Wrapped,
|
181
|
+
:TTF_RenderGlyph_Blended => :TTF_RenderGlyph_Blended,
|
182
|
+
:TTF_RenderGlyph32_Blended => :TTF_RenderGlyph32_Blended,
|
183
|
+
:TTF_SetDirection => :TTF_SetDirection,
|
184
|
+
:TTF_SetScript => :TTF_SetScript,
|
185
|
+
:TTF_CloseFont => :TTF_CloseFont,
|
186
|
+
:TTF_Quit => :TTF_Quit,
|
187
|
+
:TTF_WasInit => :TTF_WasInit,
|
188
|
+
:TTF_GetFontKerningSize => :TTF_GetFontKerningSize,
|
189
|
+
:TTF_GetFontKerningSizeGlyphs => :TTF_GetFontKerningSizeGlyphs,
|
190
|
+
:TTF_GetFontKerningSizeGlyphs32 => :TTF_GetFontKerningSizeGlyphs32,
|
191
|
+
:TTF_SetFontSDF => :TTF_SetFontSDF,
|
192
|
+
:TTF_GetFontSDF => :TTF_GetFontSDF,
|
193
|
+
}
|
194
|
+
args = {
|
195
|
+
:TTF_Linked_Version => [],
|
196
|
+
:TTF_GetFreeTypeVersion => [:pointer, :pointer, :pointer],
|
197
|
+
:TTF_GetHarfBuzzVersion => [:pointer, :pointer, :pointer],
|
198
|
+
:TTF_ByteSwappedUNICODE => [:int],
|
199
|
+
:TTF_Init => [],
|
200
|
+
:TTF_OpenFont => [:pointer, :int],
|
201
|
+
:TTF_OpenFontIndex => [:pointer, :int, :long],
|
202
|
+
:TTF_OpenFontRW => [:pointer, :int, :int],
|
203
|
+
:TTF_OpenFontIndexRW => [:pointer, :int, :int, :long],
|
204
|
+
:TTF_OpenFontDPI => [:pointer, :int, :uint, :uint],
|
205
|
+
:TTF_OpenFontIndexDPI => [:pointer, :int, :long, :uint, :uint],
|
206
|
+
:TTF_OpenFontDPIRW => [:pointer, :int, :int, :uint, :uint],
|
207
|
+
:TTF_OpenFontIndexDPIRW => [:pointer, :int, :int, :long, :uint, :uint],
|
208
|
+
:TTF_SetFontSize => [:pointer, :int],
|
209
|
+
:TTF_SetFontSizeDPI => [:pointer, :int, :uint, :uint],
|
210
|
+
:TTF_GetFontStyle => [:pointer],
|
211
|
+
:TTF_SetFontStyle => [:pointer, :int],
|
212
|
+
:TTF_GetFontOutline => [:pointer],
|
213
|
+
:TTF_SetFontOutline => [:pointer, :int],
|
214
|
+
:TTF_GetFontHinting => [:pointer],
|
215
|
+
:TTF_SetFontHinting => [:pointer, :int],
|
216
|
+
:TTF_FontHeight => [:pointer],
|
217
|
+
:TTF_FontAscent => [:pointer],
|
218
|
+
:TTF_FontDescent => [:pointer],
|
219
|
+
:TTF_FontLineSkip => [:pointer],
|
220
|
+
:TTF_GetFontKerning => [:pointer],
|
221
|
+
:TTF_SetFontKerning => [:pointer, :int],
|
222
|
+
:TTF_FontFaces => [:pointer],
|
223
|
+
:TTF_FontFaceIsFixedWidth => [:pointer],
|
224
|
+
:TTF_FontFaceFamilyName => [:pointer],
|
225
|
+
:TTF_FontFaceStyleName => [:pointer],
|
226
|
+
:TTF_GlyphIsProvided => [:pointer, :ushort],
|
227
|
+
:TTF_GlyphIsProvided32 => [:pointer, :uint],
|
228
|
+
:TTF_GlyphMetrics => [:pointer, :ushort, :pointer, :pointer, :pointer, :pointer, :pointer],
|
229
|
+
:TTF_GlyphMetrics32 => [:pointer, :uint, :pointer, :pointer, :pointer, :pointer, :pointer],
|
230
|
+
:TTF_SizeText => [:pointer, :pointer, :pointer, :pointer],
|
231
|
+
:TTF_SizeUTF8 => [:pointer, :pointer, :pointer, :pointer],
|
232
|
+
:TTF_SizeUNICODE => [:pointer, :pointer, :pointer, :pointer],
|
233
|
+
:TTF_MeasureText => [:pointer, :pointer, :int, :pointer, :pointer],
|
234
|
+
:TTF_MeasureUTF8 => [:pointer, :pointer, :int, :pointer, :pointer],
|
235
|
+
:TTF_MeasureUNICODE => [:pointer, :pointer, :int, :pointer, :pointer],
|
236
|
+
:TTF_RenderText_Solid => [:pointer, :pointer, Color.by_value],
|
237
|
+
:TTF_RenderUTF8_Solid => [:pointer, :pointer, Color.by_value],
|
238
|
+
:TTF_RenderUNICODE_Solid => [:pointer, :pointer, Color.by_value],
|
239
|
+
:TTF_RenderText_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
240
|
+
:TTF_RenderUTF8_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
241
|
+
:TTF_RenderUNICODE_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
242
|
+
:TTF_RenderGlyph_Solid => [:pointer, :ushort, Color.by_value],
|
243
|
+
:TTF_RenderGlyph32_Solid => [:pointer, :uint, Color.by_value],
|
244
|
+
:TTF_RenderText_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
245
|
+
:TTF_RenderUTF8_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
246
|
+
:TTF_RenderUNICODE_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
|
247
|
+
:TTF_RenderText_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
248
|
+
:TTF_RenderUTF8_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
249
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
|
250
|
+
:TTF_RenderGlyph_Shaded => [:pointer, :ushort, Color.by_value, Color.by_value],
|
251
|
+
:TTF_RenderGlyph32_Shaded => [:pointer, :uint, Color.by_value, Color.by_value],
|
252
|
+
:TTF_RenderText_Blended => [:pointer, :pointer, Color.by_value],
|
253
|
+
:TTF_RenderUTF8_Blended => [:pointer, :pointer, Color.by_value],
|
254
|
+
:TTF_RenderUNICODE_Blended => [:pointer, :pointer, Color.by_value],
|
255
|
+
:TTF_RenderText_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
256
|
+
:TTF_RenderUTF8_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
257
|
+
:TTF_RenderUNICODE_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
|
258
|
+
:TTF_RenderGlyph_Blended => [:pointer, :ushort, Color.by_value],
|
259
|
+
:TTF_RenderGlyph32_Blended => [:pointer, :uint, Color.by_value],
|
260
|
+
:TTF_SetDirection => [:int],
|
261
|
+
:TTF_SetScript => [:int],
|
262
|
+
:TTF_CloseFont => [:pointer],
|
263
|
+
:TTF_Quit => [],
|
264
|
+
:TTF_WasInit => [],
|
265
|
+
:TTF_GetFontKerningSize => [:pointer, :int, :int],
|
266
|
+
:TTF_GetFontKerningSizeGlyphs => [:pointer, :ushort, :ushort],
|
267
|
+
:TTF_GetFontKerningSizeGlyphs32 => [:pointer, :uint, :uint],
|
268
|
+
:TTF_SetFontSDF => [:pointer, :int],
|
269
|
+
:TTF_GetFontSDF => [:pointer],
|
270
|
+
}
|
271
|
+
retvals = {
|
272
|
+
:TTF_Linked_Version => :pointer,
|
273
|
+
:TTF_GetFreeTypeVersion => :void,
|
274
|
+
:TTF_GetHarfBuzzVersion => :void,
|
275
|
+
:TTF_ByteSwappedUNICODE => :void,
|
276
|
+
:TTF_Init => :int,
|
277
|
+
:TTF_OpenFont => :pointer,
|
278
|
+
:TTF_OpenFontIndex => :pointer,
|
279
|
+
:TTF_OpenFontRW => :pointer,
|
280
|
+
:TTF_OpenFontIndexRW => :pointer,
|
281
|
+
:TTF_OpenFontDPI => :pointer,
|
282
|
+
:TTF_OpenFontIndexDPI => :pointer,
|
283
|
+
:TTF_OpenFontDPIRW => :pointer,
|
284
|
+
:TTF_OpenFontIndexDPIRW => :pointer,
|
285
|
+
:TTF_SetFontSize => :int,
|
286
|
+
:TTF_SetFontSizeDPI => :int,
|
287
|
+
:TTF_GetFontStyle => :int,
|
288
|
+
:TTF_SetFontStyle => :void,
|
289
|
+
:TTF_GetFontOutline => :int,
|
290
|
+
:TTF_SetFontOutline => :void,
|
291
|
+
:TTF_GetFontHinting => :int,
|
292
|
+
:TTF_SetFontHinting => :void,
|
293
|
+
:TTF_FontHeight => :int,
|
294
|
+
:TTF_FontAscent => :int,
|
295
|
+
:TTF_FontDescent => :int,
|
296
|
+
:TTF_FontLineSkip => :int,
|
297
|
+
:TTF_GetFontKerning => :int,
|
298
|
+
:TTF_SetFontKerning => :void,
|
299
|
+
:TTF_FontFaces => :long,
|
300
|
+
:TTF_FontFaceIsFixedWidth => :int,
|
301
|
+
:TTF_FontFaceFamilyName => :pointer,
|
302
|
+
:TTF_FontFaceStyleName => :pointer,
|
303
|
+
:TTF_GlyphIsProvided => :int,
|
304
|
+
:TTF_GlyphIsProvided32 => :int,
|
305
|
+
:TTF_GlyphMetrics => :int,
|
306
|
+
:TTF_GlyphMetrics32 => :int,
|
307
|
+
:TTF_SizeText => :int,
|
308
|
+
:TTF_SizeUTF8 => :int,
|
309
|
+
:TTF_SizeUNICODE => :int,
|
310
|
+
:TTF_MeasureText => :int,
|
311
|
+
:TTF_MeasureUTF8 => :int,
|
312
|
+
:TTF_MeasureUNICODE => :int,
|
313
|
+
:TTF_RenderText_Solid => :pointer,
|
314
|
+
:TTF_RenderUTF8_Solid => :pointer,
|
315
|
+
:TTF_RenderUNICODE_Solid => :pointer,
|
316
|
+
:TTF_RenderText_Solid_Wrapped => :pointer,
|
317
|
+
:TTF_RenderUTF8_Solid_Wrapped => :pointer,
|
318
|
+
:TTF_RenderUNICODE_Solid_Wrapped => :pointer,
|
319
|
+
:TTF_RenderGlyph_Solid => :pointer,
|
320
|
+
:TTF_RenderGlyph32_Solid => :pointer,
|
321
|
+
:TTF_RenderText_Shaded => :pointer,
|
322
|
+
:TTF_RenderUTF8_Shaded => :pointer,
|
323
|
+
:TTF_RenderUNICODE_Shaded => :pointer,
|
324
|
+
:TTF_RenderText_Shaded_Wrapped => :pointer,
|
325
|
+
:TTF_RenderUTF8_Shaded_Wrapped => :pointer,
|
326
|
+
:TTF_RenderUNICODE_Shaded_Wrapped => :pointer,
|
327
|
+
:TTF_RenderGlyph_Shaded => :pointer,
|
328
|
+
:TTF_RenderGlyph32_Shaded => :pointer,
|
329
|
+
:TTF_RenderText_Blended => :pointer,
|
330
|
+
:TTF_RenderUTF8_Blended => :pointer,
|
331
|
+
:TTF_RenderUNICODE_Blended => :pointer,
|
332
|
+
:TTF_RenderText_Blended_Wrapped => :pointer,
|
333
|
+
:TTF_RenderUTF8_Blended_Wrapped => :pointer,
|
334
|
+
:TTF_RenderUNICODE_Blended_Wrapped => :pointer,
|
335
|
+
:TTF_RenderGlyph_Blended => :pointer,
|
336
|
+
:TTF_RenderGlyph32_Blended => :pointer,
|
337
|
+
:TTF_SetDirection => :int,
|
338
|
+
:TTF_SetScript => :int,
|
339
|
+
:TTF_CloseFont => :void,
|
340
|
+
:TTF_Quit => :void,
|
341
|
+
:TTF_WasInit => :int,
|
342
|
+
:TTF_GetFontKerningSize => :int,
|
343
|
+
:TTF_GetFontKerningSizeGlyphs => :int,
|
344
|
+
:TTF_GetFontKerningSizeGlyphs32 => :int,
|
345
|
+
:TTF_SetFontSDF => :int,
|
346
|
+
:TTF_GetFontSDF => :int,
|
347
|
+
}
|
348
|
+
symbols.each do |sym|
|
349
|
+
begin
|
350
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
351
|
+
rescue FFI::NotFoundError => error
|
352
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
353
|
+
end
|
354
|
+
end
|
355
|
+
end
|
356
|
+
|
357
|
+
end
|
358
|
+
|