sdl2-bindings 0.0.4 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +23 -0
- data/LICENSE.txt +1 -1
- data/README.md +8 -2
- data/lib/sdl2.rb +5 -3
- data/lib/sdl2_audio.rb +22 -0
- data/lib/sdl2_cpuinfo.rb +5 -2
- data/lib/sdl2_error.rb +3 -0
- data/lib/sdl2_events.rb +34 -1
- data/lib/sdl2_gamecontroller.rb +69 -2
- data/lib/sdl2_haptic.rb +1 -0
- data/lib/sdl2_hidapi.rb +118 -0
- data/lib/sdl2_hints.rb +108 -70
- data/lib/sdl2_joystick.rb +41 -1
- data/lib/sdl2_keycode.rb +5 -0
- data/lib/sdl2_misc.rb +45 -0
- data/lib/sdl2_mixer.rb +10 -0
- data/lib/sdl2_pixels.rb +6 -0
- data/lib/sdl2_render.rb +32 -0
- data/lib/sdl2_rwops.rb +11 -11
- data/lib/sdl2_sensor.rb +97 -0
- data/lib/sdl2_stdinc.rb +103 -34
- data/lib/sdl2_surface.rb +10 -1
- data/lib/sdl2_syswm.rb +2 -0
- data/lib/sdl2_timer.rb +3 -0
- data/lib/sdl2_touch.rb +2 -0
- data/lib/sdl2_ttf.rb +12 -0
- data/lib/sdl2_version.rb +1 -1
- data/lib/sdl2_video.rb +40 -1
- metadata +6 -3
data/lib/sdl2_sensor.rb
ADDED
@@ -0,0 +1,97 @@
|
|
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
|
+
SDL_STANDARD_GRAVITY = 9.80665
|
14
|
+
|
15
|
+
# Enum
|
16
|
+
|
17
|
+
SDL_SENSOR_INVALID = -1
|
18
|
+
SDL_SENSOR_UNKNOWN = 0
|
19
|
+
SDL_SENSOR_ACCEL = 1
|
20
|
+
SDL_SENSOR_GYRO = 2
|
21
|
+
|
22
|
+
# Typedef
|
23
|
+
|
24
|
+
typedef :int, :SDL_SensorID
|
25
|
+
typedef :int, :SDL_SensorType
|
26
|
+
|
27
|
+
# Struct
|
28
|
+
|
29
|
+
|
30
|
+
# Function
|
31
|
+
|
32
|
+
def self.setup_sensor_symbols()
|
33
|
+
symbols = [
|
34
|
+
:SDL_LockSensors,
|
35
|
+
:SDL_UnlockSensors,
|
36
|
+
:SDL_NumSensors,
|
37
|
+
:SDL_SensorGetDeviceName,
|
38
|
+
:SDL_SensorGetDeviceType,
|
39
|
+
:SDL_SensorGetDeviceNonPortableType,
|
40
|
+
:SDL_SensorGetDeviceInstanceID,
|
41
|
+
:SDL_SensorOpen,
|
42
|
+
:SDL_SensorFromInstanceID,
|
43
|
+
:SDL_SensorGetName,
|
44
|
+
:SDL_SensorGetType,
|
45
|
+
:SDL_SensorGetNonPortableType,
|
46
|
+
:SDL_SensorGetInstanceID,
|
47
|
+
:SDL_SensorGetData,
|
48
|
+
:SDL_SensorClose,
|
49
|
+
:SDL_SensorUpdate,
|
50
|
+
]
|
51
|
+
args = {
|
52
|
+
:SDL_LockSensors => [],
|
53
|
+
:SDL_UnlockSensors => [],
|
54
|
+
:SDL_NumSensors => [],
|
55
|
+
:SDL_SensorGetDeviceName => [:int],
|
56
|
+
:SDL_SensorGetDeviceType => [:int],
|
57
|
+
:SDL_SensorGetDeviceNonPortableType => [:int],
|
58
|
+
:SDL_SensorGetDeviceInstanceID => [:int],
|
59
|
+
:SDL_SensorOpen => [:int],
|
60
|
+
:SDL_SensorFromInstanceID => [:int],
|
61
|
+
:SDL_SensorGetName => [:pointer],
|
62
|
+
:SDL_SensorGetType => [:pointer],
|
63
|
+
:SDL_SensorGetNonPortableType => [:pointer],
|
64
|
+
:SDL_SensorGetInstanceID => [:pointer],
|
65
|
+
:SDL_SensorGetData => [:pointer, :pointer, :int],
|
66
|
+
:SDL_SensorClose => [:pointer],
|
67
|
+
:SDL_SensorUpdate => [],
|
68
|
+
}
|
69
|
+
retvals = {
|
70
|
+
:SDL_LockSensors => :void,
|
71
|
+
:SDL_UnlockSensors => :void,
|
72
|
+
:SDL_NumSensors => :int,
|
73
|
+
:SDL_SensorGetDeviceName => :pointer,
|
74
|
+
:SDL_SensorGetDeviceType => :int,
|
75
|
+
:SDL_SensorGetDeviceNonPortableType => :int,
|
76
|
+
:SDL_SensorGetDeviceInstanceID => :int,
|
77
|
+
:SDL_SensorOpen => :pointer,
|
78
|
+
:SDL_SensorFromInstanceID => :pointer,
|
79
|
+
:SDL_SensorGetName => :pointer,
|
80
|
+
:SDL_SensorGetType => :int,
|
81
|
+
:SDL_SensorGetNonPortableType => :int,
|
82
|
+
:SDL_SensorGetInstanceID => :int,
|
83
|
+
:SDL_SensorGetData => :int,
|
84
|
+
:SDL_SensorClose => :void,
|
85
|
+
:SDL_SensorUpdate => :void,
|
86
|
+
}
|
87
|
+
symbols.each do |sym|
|
88
|
+
begin
|
89
|
+
attach_function sym, args[sym], retvals[sym]
|
90
|
+
rescue FFI::NotFoundError => error
|
91
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
data/lib/sdl2_stdinc.rb
CHANGED
@@ -10,6 +10,10 @@ module SDL2
|
|
10
10
|
extend FFI::Library
|
11
11
|
# Define/Macro
|
12
12
|
|
13
|
+
SDL_ICONV_ERROR = -1
|
14
|
+
SDL_ICONV_E2BIG = -2
|
15
|
+
SDL_ICONV_EILSEQ = -3
|
16
|
+
SDL_ICONV_EINVAL = -4
|
13
17
|
|
14
18
|
# Enum
|
15
19
|
|
@@ -18,6 +22,14 @@ module SDL2
|
|
18
22
|
|
19
23
|
# Typedef
|
20
24
|
|
25
|
+
typedef :char, :int8_t
|
26
|
+
typedef :short, :int16_t
|
27
|
+
typedef :int, :int32_t
|
28
|
+
typedef :long_long, :int64_t
|
29
|
+
typedef :uchar, :uint8_t
|
30
|
+
typedef :ushort, :uint16_t
|
31
|
+
typedef :uint, :uint32_t
|
32
|
+
typedef :ulong_long, :uint64_t
|
21
33
|
typedef :int, :SDL_bool
|
22
34
|
typedef :char, :Sint8
|
23
35
|
typedef :uchar, :Uint8
|
@@ -27,9 +39,9 @@ module SDL2
|
|
27
39
|
typedef :uint, :Uint32
|
28
40
|
typedef :long_long, :Sint64
|
29
41
|
typedef :ulong_long, :Uint64
|
30
|
-
callback :SDL_malloc_func, [:
|
31
|
-
callback :SDL_calloc_func, [:
|
32
|
-
callback :SDL_realloc_func, [:pointer, :
|
42
|
+
callback :SDL_malloc_func, [:int], :pointer
|
43
|
+
callback :SDL_calloc_func, [:int, :int], :pointer
|
44
|
+
callback :SDL_realloc_func, [:pointer, :int], :pointer
|
33
45
|
callback :SDL_free_func, [:pointer], :void
|
34
46
|
typedef :pointer, :SDL_iconv_t
|
35
47
|
|
@@ -51,12 +63,21 @@ module SDL2
|
|
51
63
|
:SDL_setenv,
|
52
64
|
:SDL_qsort,
|
53
65
|
:SDL_abs,
|
66
|
+
:SDL_isalpha,
|
67
|
+
:SDL_isalnum,
|
68
|
+
:SDL_isblank,
|
69
|
+
:SDL_iscntrl,
|
54
70
|
:SDL_isdigit,
|
71
|
+
:SDL_isxdigit,
|
72
|
+
:SDL_ispunct,
|
55
73
|
:SDL_isspace,
|
56
74
|
:SDL_isupper,
|
57
75
|
:SDL_islower,
|
76
|
+
:SDL_isprint,
|
77
|
+
:SDL_isgraph,
|
58
78
|
:SDL_toupper,
|
59
79
|
:SDL_tolower,
|
80
|
+
:SDL_crc32,
|
60
81
|
:SDL_memset,
|
61
82
|
:SDL_memset4,
|
62
83
|
:SDL_memcpy,
|
@@ -69,6 +90,8 @@ module SDL2
|
|
69
90
|
:SDL_wcsstr,
|
70
91
|
:SDL_wcscmp,
|
71
92
|
:SDL_wcsncmp,
|
93
|
+
:SDL_wcscasecmp,
|
94
|
+
:SDL_wcsncasecmp,
|
72
95
|
:SDL_strlen,
|
73
96
|
:SDL_strlcpy,
|
74
97
|
:SDL_utf8strlcpy,
|
@@ -103,6 +126,8 @@ module SDL2
|
|
103
126
|
:SDL_vsscanf,
|
104
127
|
:SDL_snprintf,
|
105
128
|
:SDL_vsnprintf,
|
129
|
+
:SDL_asprintf,
|
130
|
+
:SDL_vasprintf,
|
106
131
|
:SDL_acos,
|
107
132
|
:SDL_acosf,
|
108
133
|
:SDL_asin,
|
@@ -123,6 +148,8 @@ module SDL2
|
|
123
148
|
:SDL_fabsf,
|
124
149
|
:SDL_floor,
|
125
150
|
:SDL_floorf,
|
151
|
+
:SDL_trunc,
|
152
|
+
:SDL_truncf,
|
126
153
|
:SDL_fmod,
|
127
154
|
:SDL_fmodf,
|
128
155
|
:SDL_log,
|
@@ -131,6 +158,10 @@ module SDL2
|
|
131
158
|
:SDL_log10f,
|
132
159
|
:SDL_pow,
|
133
160
|
:SDL_powf,
|
161
|
+
:SDL_round,
|
162
|
+
:SDL_roundf,
|
163
|
+
:SDL_lround,
|
164
|
+
:SDL_lroundf,
|
134
165
|
:SDL_scalbn,
|
135
166
|
:SDL_scalbnf,
|
136
167
|
:SDL_sin,
|
@@ -146,39 +177,50 @@ module SDL2
|
|
146
177
|
:SDL_memcpy4,
|
147
178
|
]
|
148
179
|
args = {
|
149
|
-
:SDL_malloc => [:
|
150
|
-
:SDL_calloc => [:
|
151
|
-
:SDL_realloc => [:pointer, :
|
180
|
+
:SDL_malloc => [:int],
|
181
|
+
:SDL_calloc => [:int, :int],
|
182
|
+
:SDL_realloc => [:pointer, :int],
|
152
183
|
:SDL_free => [:pointer],
|
153
184
|
:SDL_GetMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
|
154
185
|
:SDL_SetMemoryFunctions => [:SDL_malloc_func, :SDL_calloc_func, :SDL_realloc_func, :SDL_free_func],
|
155
186
|
:SDL_GetNumAllocations => [],
|
156
187
|
:SDL_getenv => [:pointer],
|
157
188
|
:SDL_setenv => [:pointer, :pointer, :int],
|
158
|
-
:SDL_qsort => [:pointer, :
|
189
|
+
:SDL_qsort => [:pointer, :int, :int, :pointer],
|
159
190
|
:SDL_abs => [:int],
|
191
|
+
:SDL_isalpha => [:int],
|
192
|
+
:SDL_isalnum => [:int],
|
193
|
+
:SDL_isblank => [:int],
|
194
|
+
:SDL_iscntrl => [:int],
|
160
195
|
:SDL_isdigit => [:int],
|
196
|
+
:SDL_isxdigit => [:int],
|
197
|
+
:SDL_ispunct => [:int],
|
161
198
|
:SDL_isspace => [:int],
|
162
199
|
:SDL_isupper => [:int],
|
163
200
|
:SDL_islower => [:int],
|
201
|
+
:SDL_isprint => [:int],
|
202
|
+
:SDL_isgraph => [:int],
|
164
203
|
:SDL_toupper => [:int],
|
165
204
|
:SDL_tolower => [:int],
|
166
|
-
:
|
167
|
-
:
|
168
|
-
:
|
169
|
-
:
|
170
|
-
:
|
205
|
+
:SDL_crc32 => [:uint, :pointer, :int],
|
206
|
+
:SDL_memset => [:pointer, :int, :int],
|
207
|
+
:SDL_memset4 => [:pointer, :uint, :int],
|
208
|
+
:SDL_memcpy => [:pointer, :pointer, :int],
|
209
|
+
:SDL_memmove => [:pointer, :pointer, :int],
|
210
|
+
:SDL_memcmp => [:pointer, :pointer, :int],
|
171
211
|
:SDL_wcslen => [:pointer],
|
172
|
-
:SDL_wcslcpy => [:pointer, :pointer, :
|
173
|
-
:SDL_wcslcat => [:pointer, :pointer, :
|
212
|
+
:SDL_wcslcpy => [:pointer, :pointer, :int],
|
213
|
+
:SDL_wcslcat => [:pointer, :pointer, :int],
|
174
214
|
:SDL_wcsdup => [:pointer],
|
175
215
|
:SDL_wcsstr => [:pointer, :pointer],
|
176
216
|
:SDL_wcscmp => [:pointer, :pointer],
|
177
|
-
:SDL_wcsncmp => [:pointer, :pointer, :
|
217
|
+
:SDL_wcsncmp => [:pointer, :pointer, :int],
|
218
|
+
:SDL_wcscasecmp => [:pointer, :pointer],
|
219
|
+
:SDL_wcsncasecmp => [:pointer, :pointer, :int],
|
178
220
|
:SDL_strlen => [:pointer],
|
179
|
-
:SDL_strlcpy => [:pointer, :pointer, :
|
180
|
-
:SDL_utf8strlcpy => [:pointer, :pointer, :
|
181
|
-
:SDL_strlcat => [:pointer, :pointer, :
|
221
|
+
:SDL_strlcpy => [:pointer, :pointer, :int],
|
222
|
+
:SDL_utf8strlcpy => [:pointer, :pointer, :int],
|
223
|
+
:SDL_strlcat => [:pointer, :pointer, :int],
|
182
224
|
:SDL_strdup => [:pointer],
|
183
225
|
:SDL_strrev => [:pointer],
|
184
226
|
:SDL_strupr => [:pointer],
|
@@ -202,13 +244,15 @@ module SDL2
|
|
202
244
|
:SDL_strtoull => [:pointer, :pointer, :int],
|
203
245
|
:SDL_strtod => [:pointer, :pointer],
|
204
246
|
:SDL_strcmp => [:pointer, :pointer],
|
205
|
-
:SDL_strncmp => [:pointer, :pointer, :
|
247
|
+
:SDL_strncmp => [:pointer, :pointer, :int],
|
206
248
|
:SDL_strcasecmp => [:pointer, :pointer],
|
207
|
-
:SDL_strncasecmp => [:pointer, :pointer, :
|
249
|
+
:SDL_strncasecmp => [:pointer, :pointer, :int],
|
208
250
|
:SDL_sscanf => [:pointer, :pointer],
|
209
|
-
:SDL_vsscanf => [:pointer, :pointer, :
|
210
|
-
:SDL_snprintf => [:pointer, :
|
211
|
-
:SDL_vsnprintf => [:pointer, :
|
251
|
+
:SDL_vsscanf => [:pointer, :pointer, :int],
|
252
|
+
:SDL_snprintf => [:pointer, :int, :pointer],
|
253
|
+
:SDL_vsnprintf => [:pointer, :int, :pointer, :int],
|
254
|
+
:SDL_asprintf => [:pointer, :pointer],
|
255
|
+
:SDL_vasprintf => [:pointer, :pointer, :int],
|
212
256
|
:SDL_acos => [:double],
|
213
257
|
:SDL_acosf => [:float],
|
214
258
|
:SDL_asin => [:double],
|
@@ -229,6 +273,8 @@ module SDL2
|
|
229
273
|
:SDL_fabsf => [:float],
|
230
274
|
:SDL_floor => [:double],
|
231
275
|
:SDL_floorf => [:float],
|
276
|
+
:SDL_trunc => [:double],
|
277
|
+
:SDL_truncf => [:float],
|
232
278
|
:SDL_fmod => [:double, :double],
|
233
279
|
:SDL_fmodf => [:float, :float],
|
234
280
|
:SDL_log => [:double],
|
@@ -237,6 +283,10 @@ module SDL2
|
|
237
283
|
:SDL_log10f => [:float],
|
238
284
|
:SDL_pow => [:double, :double],
|
239
285
|
:SDL_powf => [:float, :float],
|
286
|
+
:SDL_round => [:double],
|
287
|
+
:SDL_roundf => [:float],
|
288
|
+
:SDL_lround => [:double],
|
289
|
+
:SDL_lroundf => [:float],
|
240
290
|
:SDL_scalbn => [:double, :int],
|
241
291
|
:SDL_scalbnf => [:float, :int],
|
242
292
|
:SDL_sin => [:double],
|
@@ -248,8 +298,8 @@ module SDL2
|
|
248
298
|
:SDL_iconv_open => [:pointer, :pointer],
|
249
299
|
:SDL_iconv_close => [:pointer],
|
250
300
|
:SDL_iconv => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
251
|
-
:SDL_iconv_string => [:pointer, :pointer, :pointer, :
|
252
|
-
:SDL_memcpy4 => [:pointer, :pointer, :
|
301
|
+
:SDL_iconv_string => [:pointer, :pointer, :pointer, :int],
|
302
|
+
:SDL_memcpy4 => [:pointer, :pointer, :int],
|
253
303
|
}
|
254
304
|
retvals = {
|
255
305
|
:SDL_malloc => :pointer,
|
@@ -263,28 +313,39 @@ module SDL2
|
|
263
313
|
:SDL_setenv => :int,
|
264
314
|
:SDL_qsort => :void,
|
265
315
|
:SDL_abs => :int,
|
316
|
+
:SDL_isalpha => :int,
|
317
|
+
:SDL_isalnum => :int,
|
318
|
+
:SDL_isblank => :int,
|
319
|
+
:SDL_iscntrl => :int,
|
266
320
|
:SDL_isdigit => :int,
|
321
|
+
:SDL_isxdigit => :int,
|
322
|
+
:SDL_ispunct => :int,
|
267
323
|
:SDL_isspace => :int,
|
268
324
|
:SDL_isupper => :int,
|
269
325
|
:SDL_islower => :int,
|
326
|
+
:SDL_isprint => :int,
|
327
|
+
:SDL_isgraph => :int,
|
270
328
|
:SDL_toupper => :int,
|
271
329
|
:SDL_tolower => :int,
|
330
|
+
:SDL_crc32 => :uint,
|
272
331
|
:SDL_memset => :pointer,
|
273
332
|
:SDL_memset4 => :void,
|
274
333
|
:SDL_memcpy => :pointer,
|
275
334
|
:SDL_memmove => :pointer,
|
276
335
|
:SDL_memcmp => :int,
|
277
|
-
:SDL_wcslen => :
|
278
|
-
:SDL_wcslcpy => :
|
279
|
-
:SDL_wcslcat => :
|
336
|
+
:SDL_wcslen => :int,
|
337
|
+
:SDL_wcslcpy => :int,
|
338
|
+
:SDL_wcslcat => :int,
|
280
339
|
:SDL_wcsdup => :pointer,
|
281
340
|
:SDL_wcsstr => :pointer,
|
282
341
|
:SDL_wcscmp => :int,
|
283
342
|
:SDL_wcsncmp => :int,
|
284
|
-
:
|
285
|
-
:
|
286
|
-
:
|
287
|
-
:
|
343
|
+
:SDL_wcscasecmp => :int,
|
344
|
+
:SDL_wcsncasecmp => :int,
|
345
|
+
:SDL_strlen => :int,
|
346
|
+
:SDL_strlcpy => :int,
|
347
|
+
:SDL_utf8strlcpy => :int,
|
348
|
+
:SDL_strlcat => :int,
|
288
349
|
:SDL_strdup => :pointer,
|
289
350
|
:SDL_strrev => :pointer,
|
290
351
|
:SDL_strupr => :pointer,
|
@@ -293,7 +354,7 @@ module SDL2
|
|
293
354
|
:SDL_strrchr => :pointer,
|
294
355
|
:SDL_strstr => :pointer,
|
295
356
|
:SDL_strtokr => :pointer,
|
296
|
-
:SDL_utf8strlen => :
|
357
|
+
:SDL_utf8strlen => :int,
|
297
358
|
:SDL_itoa => :pointer,
|
298
359
|
:SDL_uitoa => :pointer,
|
299
360
|
:SDL_ltoa => :pointer,
|
@@ -315,6 +376,8 @@ module SDL2
|
|
315
376
|
:SDL_vsscanf => :int,
|
316
377
|
:SDL_snprintf => :int,
|
317
378
|
:SDL_vsnprintf => :int,
|
379
|
+
:SDL_asprintf => :int,
|
380
|
+
:SDL_vasprintf => :int,
|
318
381
|
:SDL_acos => :double,
|
319
382
|
:SDL_acosf => :float,
|
320
383
|
:SDL_asin => :double,
|
@@ -335,6 +398,8 @@ module SDL2
|
|
335
398
|
:SDL_fabsf => :float,
|
336
399
|
:SDL_floor => :double,
|
337
400
|
:SDL_floorf => :float,
|
401
|
+
:SDL_trunc => :double,
|
402
|
+
:SDL_truncf => :float,
|
338
403
|
:SDL_fmod => :double,
|
339
404
|
:SDL_fmodf => :float,
|
340
405
|
:SDL_log => :double,
|
@@ -343,6 +408,10 @@ module SDL2
|
|
343
408
|
:SDL_log10f => :float,
|
344
409
|
:SDL_pow => :double,
|
345
410
|
:SDL_powf => :float,
|
411
|
+
:SDL_round => :double,
|
412
|
+
:SDL_roundf => :float,
|
413
|
+
:SDL_lround => :long,
|
414
|
+
:SDL_lroundf => :long,
|
346
415
|
:SDL_scalbn => :double,
|
347
416
|
:SDL_scalbnf => :float,
|
348
417
|
:SDL_sin => :double,
|
@@ -353,7 +422,7 @@ module SDL2
|
|
353
422
|
:SDL_tanf => :float,
|
354
423
|
:SDL_iconv_open => :pointer,
|
355
424
|
:SDL_iconv_close => :int,
|
356
|
-
:SDL_iconv => :
|
425
|
+
:SDL_iconv => :int,
|
357
426
|
:SDL_iconv_string => :pointer,
|
358
427
|
:SDL_memcpy4 => :pointer,
|
359
428
|
}
|
data/lib/sdl2_surface.rb
CHANGED
@@ -41,7 +41,7 @@ module SDL2
|
|
41
41
|
:pixels, :pointer,
|
42
42
|
:userdata, :pointer,
|
43
43
|
:locked, :int,
|
44
|
-
:
|
44
|
+
:list_blitmap, :pointer,
|
45
45
|
:clip_rect, SDL_Rect,
|
46
46
|
:map, :pointer,
|
47
47
|
:refcount, :int,
|
@@ -64,6 +64,7 @@ module SDL2
|
|
64
64
|
:SDL_LoadBMP_RW,
|
65
65
|
:SDL_SaveBMP_RW,
|
66
66
|
:SDL_SetSurfaceRLE,
|
67
|
+
:SDL_HasSurfaceRLE,
|
67
68
|
:SDL_SetColorKey,
|
68
69
|
:SDL_HasColorKey,
|
69
70
|
:SDL_GetColorKey,
|
@@ -79,11 +80,13 @@ module SDL2
|
|
79
80
|
:SDL_ConvertSurface,
|
80
81
|
:SDL_ConvertSurfaceFormat,
|
81
82
|
:SDL_ConvertPixels,
|
83
|
+
:SDL_PremultiplyAlpha,
|
82
84
|
:SDL_FillRect,
|
83
85
|
:SDL_FillRects,
|
84
86
|
:SDL_UpperBlit,
|
85
87
|
:SDL_LowerBlit,
|
86
88
|
:SDL_SoftStretch,
|
89
|
+
:SDL_SoftStretchLinear,
|
87
90
|
:SDL_UpperBlitScaled,
|
88
91
|
:SDL_LowerBlitScaled,
|
89
92
|
:SDL_SetYUVConversionMode,
|
@@ -102,6 +105,7 @@ module SDL2
|
|
102
105
|
:SDL_LoadBMP_RW => [:pointer, :int],
|
103
106
|
:SDL_SaveBMP_RW => [:pointer, :pointer, :int],
|
104
107
|
:SDL_SetSurfaceRLE => [:pointer, :int],
|
108
|
+
:SDL_HasSurfaceRLE => [:pointer],
|
105
109
|
:SDL_SetColorKey => [:pointer, :int, :uint],
|
106
110
|
:SDL_HasColorKey => [:pointer],
|
107
111
|
:SDL_GetColorKey => [:pointer, :pointer],
|
@@ -117,11 +121,13 @@ module SDL2
|
|
117
121
|
:SDL_ConvertSurface => [:pointer, :pointer, :uint],
|
118
122
|
:SDL_ConvertSurfaceFormat => [:pointer, :uint, :uint],
|
119
123
|
:SDL_ConvertPixels => [:int, :int, :uint, :pointer, :int, :uint, :pointer, :int],
|
124
|
+
:SDL_PremultiplyAlpha => [:int, :int, :uint, :pointer, :int, :uint, :pointer, :int],
|
120
125
|
:SDL_FillRect => [:pointer, :pointer, :uint],
|
121
126
|
:SDL_FillRects => [:pointer, :pointer, :int, :uint],
|
122
127
|
:SDL_UpperBlit => [:pointer, :pointer, :pointer, :pointer],
|
123
128
|
:SDL_LowerBlit => [:pointer, :pointer, :pointer, :pointer],
|
124
129
|
:SDL_SoftStretch => [:pointer, :pointer, :pointer, :pointer],
|
130
|
+
:SDL_SoftStretchLinear => [:pointer, :pointer, :pointer, :pointer],
|
125
131
|
:SDL_UpperBlitScaled => [:pointer, :pointer, :pointer, :pointer],
|
126
132
|
:SDL_LowerBlitScaled => [:pointer, :pointer, :pointer, :pointer],
|
127
133
|
:SDL_SetYUVConversionMode => [:int],
|
@@ -140,6 +146,7 @@ module SDL2
|
|
140
146
|
:SDL_LoadBMP_RW => :pointer,
|
141
147
|
:SDL_SaveBMP_RW => :int,
|
142
148
|
:SDL_SetSurfaceRLE => :int,
|
149
|
+
:SDL_HasSurfaceRLE => :int,
|
143
150
|
:SDL_SetColorKey => :int,
|
144
151
|
:SDL_HasColorKey => :int,
|
145
152
|
:SDL_GetColorKey => :int,
|
@@ -155,11 +162,13 @@ module SDL2
|
|
155
162
|
:SDL_ConvertSurface => :pointer,
|
156
163
|
:SDL_ConvertSurfaceFormat => :pointer,
|
157
164
|
:SDL_ConvertPixels => :int,
|
165
|
+
:SDL_PremultiplyAlpha => :int,
|
158
166
|
:SDL_FillRect => :int,
|
159
167
|
:SDL_FillRects => :int,
|
160
168
|
:SDL_UpperBlit => :int,
|
161
169
|
:SDL_LowerBlit => :int,
|
162
170
|
:SDL_SoftStretch => :int,
|
171
|
+
:SDL_SoftStretchLinear => :int,
|
163
172
|
:SDL_UpperBlitScaled => :int,
|
164
173
|
:SDL_LowerBlitScaled => :int,
|
165
174
|
:SDL_SetYUVConversionMode => :void,
|
data/lib/sdl2_syswm.rb
CHANGED
data/lib/sdl2_timer.rb
CHANGED
@@ -27,6 +27,7 @@ module SDL2
|
|
27
27
|
def self.setup_timer_symbols()
|
28
28
|
symbols = [
|
29
29
|
:SDL_GetTicks,
|
30
|
+
:SDL_GetTicks64,
|
30
31
|
:SDL_GetPerformanceCounter,
|
31
32
|
:SDL_GetPerformanceFrequency,
|
32
33
|
:SDL_Delay,
|
@@ -35,6 +36,7 @@ module SDL2
|
|
35
36
|
]
|
36
37
|
args = {
|
37
38
|
:SDL_GetTicks => [],
|
39
|
+
:SDL_GetTicks64 => [],
|
38
40
|
:SDL_GetPerformanceCounter => [],
|
39
41
|
:SDL_GetPerformanceFrequency => [],
|
40
42
|
:SDL_Delay => [:uint],
|
@@ -43,6 +45,7 @@ module SDL2
|
|
43
45
|
}
|
44
46
|
retvals = {
|
45
47
|
:SDL_GetTicks => :uint,
|
48
|
+
:SDL_GetTicks64 => :ulong_long,
|
46
49
|
:SDL_GetPerformanceCounter => :ulong_long,
|
47
50
|
:SDL_GetPerformanceFrequency => :ulong_long,
|
48
51
|
:SDL_Delay => :void,
|
data/lib/sdl2_touch.rb
CHANGED
data/lib/sdl2_ttf.rb
CHANGED
@@ -14,6 +14,18 @@ module SDL2
|
|
14
14
|
SDL_TTF_MAJOR_VERSION = 2
|
15
15
|
SDL_TTF_MINOR_VERSION = 0
|
16
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
|
17
29
|
|
18
30
|
# Enum
|
19
31
|
|