sdl2-bindings 0.1.1 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +140 -124
- data/LICENSE.txt +0 -0
- data/README.md +93 -77
- data/lib/sdl2.rb +131 -131
- data/lib/sdl2_audio.rb +265 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +137 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +575 -564
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +345 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_guid.rb +58 -0
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +240 -221
- data/lib/sdl2_image.rb +296 -232
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +332 -294
- data/lib/sdl2_keyboard.rb +129 -125
- data/lib/sdl2_keycode.rb +311 -307
- data/lib/sdl2_log.rb +131 -131
- data/lib/sdl2_main.rb +74 -74
- data/lib/sdl2_messagebox.rb +102 -102
- data/lib/sdl2_misc.rb +48 -48
- data/lib/sdl2_mixer.rb +464 -392
- data/lib/sdl2_mouse.rb +136 -136
- data/lib/sdl2_pixels.rb +240 -240
- data/lib/sdl2_platform.rb +48 -48
- data/lib/sdl2_power.rb +54 -54
- data/lib/sdl2_rect.rb +145 -145
- data/lib/sdl2_render.rb +408 -408
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -238
- data/lib/sdl2_scancode.rb +293 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -154
- data/lib/sdl2_stdinc.rb +564 -556
- data/lib/sdl2_surface.rb +229 -229
- data/lib/sdl2_syswm.rb +160 -160
- data/lib/sdl2_timer.rb +74 -74
- data/lib/sdl2_touch.rb +86 -86
- data/lib/sdl2_ttf.rb +414 -358
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +549 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +4 -3
data/lib/sdl2_blendmode.rb
CHANGED
@@ -1,72 +1,72 @@
|
|
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
|
-
BLENDMODE_NONE = 0
|
17
|
-
BLENDMODE_BLEND = 1
|
18
|
-
BLENDMODE_ADD = 2
|
19
|
-
BLENDMODE_MOD = 4
|
20
|
-
BLENDMODE_MUL = 8
|
21
|
-
BLENDMODE_INVALID = 2147483647
|
22
|
-
BLENDOPERATION_ADD = 1
|
23
|
-
BLENDOPERATION_SUBTRACT = 2
|
24
|
-
BLENDOPERATION_REV_SUBTRACT = 3
|
25
|
-
BLENDOPERATION_MINIMUM = 4
|
26
|
-
BLENDOPERATION_MAXIMUM = 5
|
27
|
-
BLENDFACTOR_ZERO = 1
|
28
|
-
BLENDFACTOR_ONE = 2
|
29
|
-
BLENDFACTOR_SRC_COLOR = 3
|
30
|
-
BLENDFACTOR_ONE_MINUS_SRC_COLOR = 4
|
31
|
-
BLENDFACTOR_SRC_ALPHA = 5
|
32
|
-
BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 6
|
33
|
-
BLENDFACTOR_DST_COLOR = 7
|
34
|
-
BLENDFACTOR_ONE_MINUS_DST_COLOR = 8
|
35
|
-
BLENDFACTOR_DST_ALPHA = 9
|
36
|
-
BLENDFACTOR_ONE_MINUS_DST_ALPHA = 10
|
37
|
-
|
38
|
-
# Typedef
|
39
|
-
|
40
|
-
typedef :int, :SDL_BlendMode
|
41
|
-
typedef :int, :SDL_BlendOperation
|
42
|
-
typedef :int, :SDL_BlendFactor
|
43
|
-
|
44
|
-
# Struct
|
45
|
-
|
46
|
-
|
47
|
-
# Function
|
48
|
-
|
49
|
-
def self.setup_blendmode_symbols(output_error = false)
|
50
|
-
symbols = [
|
51
|
-
:SDL_ComposeCustomBlendMode,
|
52
|
-
]
|
53
|
-
apis = {
|
54
|
-
:SDL_ComposeCustomBlendMode => :ComposeCustomBlendMode,
|
55
|
-
}
|
56
|
-
args = {
|
57
|
-
:SDL_ComposeCustomBlendMode => [:int, :int, :int, :int, :int, :int],
|
58
|
-
}
|
59
|
-
retvals = {
|
60
|
-
:SDL_ComposeCustomBlendMode => :int,
|
61
|
-
}
|
62
|
-
symbols.each do |sym|
|
63
|
-
begin
|
64
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
65
|
-
rescue FFI::NotFoundError => error
|
66
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
end
|
72
|
-
|
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
|
+
BLENDMODE_NONE = 0
|
17
|
+
BLENDMODE_BLEND = 1
|
18
|
+
BLENDMODE_ADD = 2
|
19
|
+
BLENDMODE_MOD = 4
|
20
|
+
BLENDMODE_MUL = 8
|
21
|
+
BLENDMODE_INVALID = 2147483647
|
22
|
+
BLENDOPERATION_ADD = 1
|
23
|
+
BLENDOPERATION_SUBTRACT = 2
|
24
|
+
BLENDOPERATION_REV_SUBTRACT = 3
|
25
|
+
BLENDOPERATION_MINIMUM = 4
|
26
|
+
BLENDOPERATION_MAXIMUM = 5
|
27
|
+
BLENDFACTOR_ZERO = 1
|
28
|
+
BLENDFACTOR_ONE = 2
|
29
|
+
BLENDFACTOR_SRC_COLOR = 3
|
30
|
+
BLENDFACTOR_ONE_MINUS_SRC_COLOR = 4
|
31
|
+
BLENDFACTOR_SRC_ALPHA = 5
|
32
|
+
BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 6
|
33
|
+
BLENDFACTOR_DST_COLOR = 7
|
34
|
+
BLENDFACTOR_ONE_MINUS_DST_COLOR = 8
|
35
|
+
BLENDFACTOR_DST_ALPHA = 9
|
36
|
+
BLENDFACTOR_ONE_MINUS_DST_ALPHA = 10
|
37
|
+
|
38
|
+
# Typedef
|
39
|
+
|
40
|
+
typedef :int, :SDL_BlendMode
|
41
|
+
typedef :int, :SDL_BlendOperation
|
42
|
+
typedef :int, :SDL_BlendFactor
|
43
|
+
|
44
|
+
# Struct
|
45
|
+
|
46
|
+
|
47
|
+
# Function
|
48
|
+
|
49
|
+
def self.setup_blendmode_symbols(output_error = false)
|
50
|
+
symbols = [
|
51
|
+
:SDL_ComposeCustomBlendMode,
|
52
|
+
]
|
53
|
+
apis = {
|
54
|
+
:SDL_ComposeCustomBlendMode => :ComposeCustomBlendMode,
|
55
|
+
}
|
56
|
+
args = {
|
57
|
+
:SDL_ComposeCustomBlendMode => [:int, :int, :int, :int, :int, :int],
|
58
|
+
}
|
59
|
+
retvals = {
|
60
|
+
:SDL_ComposeCustomBlendMode => :int,
|
61
|
+
}
|
62
|
+
symbols.each do |sym|
|
63
|
+
begin
|
64
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
65
|
+
rescue FFI::NotFoundError => error
|
66
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
|
data/lib/sdl2_clipboard.rb
CHANGED
@@ -1,56 +1,56 @@
|
|
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_clipboard_symbols(output_error = false)
|
26
|
-
symbols = [
|
27
|
-
:SDL_SetClipboardText,
|
28
|
-
:SDL_GetClipboardText,
|
29
|
-
:SDL_HasClipboardText,
|
30
|
-
]
|
31
|
-
apis = {
|
32
|
-
:SDL_SetClipboardText => :SetClipboardText,
|
33
|
-
:SDL_GetClipboardText => :GetClipboardText,
|
34
|
-
:SDL_HasClipboardText => :HasClipboardText,
|
35
|
-
}
|
36
|
-
args = {
|
37
|
-
:SDL_SetClipboardText => [:pointer],
|
38
|
-
:SDL_GetClipboardText => [],
|
39
|
-
:SDL_HasClipboardText => [],
|
40
|
-
}
|
41
|
-
retvals = {
|
42
|
-
:SDL_SetClipboardText => :int,
|
43
|
-
:SDL_GetClipboardText => :pointer,
|
44
|
-
:SDL_HasClipboardText => :int,
|
45
|
-
}
|
46
|
-
symbols.each do |sym|
|
47
|
-
begin
|
48
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
49
|
-
rescue FFI::NotFoundError => error
|
50
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|
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_clipboard_symbols(output_error = false)
|
26
|
+
symbols = [
|
27
|
+
:SDL_SetClipboardText,
|
28
|
+
:SDL_GetClipboardText,
|
29
|
+
:SDL_HasClipboardText,
|
30
|
+
]
|
31
|
+
apis = {
|
32
|
+
:SDL_SetClipboardText => :SetClipboardText,
|
33
|
+
:SDL_GetClipboardText => :GetClipboardText,
|
34
|
+
:SDL_HasClipboardText => :HasClipboardText,
|
35
|
+
}
|
36
|
+
args = {
|
37
|
+
:SDL_SetClipboardText => [:pointer],
|
38
|
+
:SDL_GetClipboardText => [],
|
39
|
+
:SDL_HasClipboardText => [],
|
40
|
+
}
|
41
|
+
retvals = {
|
42
|
+
:SDL_SetClipboardText => :int,
|
43
|
+
:SDL_GetClipboardText => :pointer,
|
44
|
+
:SDL_HasClipboardText => :int,
|
45
|
+
}
|
46
|
+
symbols.each do |sym|
|
47
|
+
begin
|
48
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
49
|
+
rescue FFI::NotFoundError => error
|
50
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
|
data/lib/sdl2_cpuinfo.rb
CHANGED
@@ -1,129 +1,137 @@
|
|
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
|
-
CACHELINE_SIZE = 128
|
14
|
-
|
15
|
-
# Enum
|
16
|
-
|
17
|
-
|
18
|
-
# Typedef
|
19
|
-
|
20
|
-
|
21
|
-
# Struct
|
22
|
-
|
23
|
-
|
24
|
-
# Function
|
25
|
-
|
26
|
-
def self.setup_cpuinfo_symbols(output_error = false)
|
27
|
-
symbols = [
|
28
|
-
:SDL_GetCPUCount,
|
29
|
-
:SDL_GetCPUCacheLineSize,
|
30
|
-
:SDL_HasRDTSC,
|
31
|
-
:SDL_HasAltiVec,
|
32
|
-
:SDL_HasMMX,
|
33
|
-
:SDL_Has3DNow,
|
34
|
-
:SDL_HasSSE,
|
35
|
-
:SDL_HasSSE2,
|
36
|
-
:SDL_HasSSE3,
|
37
|
-
:SDL_HasSSE41,
|
38
|
-
:SDL_HasSSE42,
|
39
|
-
:SDL_HasAVX,
|
40
|
-
:SDL_HasAVX2,
|
41
|
-
:SDL_HasAVX512F,
|
42
|
-
:SDL_HasARMSIMD,
|
43
|
-
:SDL_HasNEON,
|
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
|
-
|
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
|
+
CACHELINE_SIZE = 128
|
14
|
+
|
15
|
+
# Enum
|
16
|
+
|
17
|
+
|
18
|
+
# Typedef
|
19
|
+
|
20
|
+
|
21
|
+
# Struct
|
22
|
+
|
23
|
+
|
24
|
+
# Function
|
25
|
+
|
26
|
+
def self.setup_cpuinfo_symbols(output_error = false)
|
27
|
+
symbols = [
|
28
|
+
:SDL_GetCPUCount,
|
29
|
+
:SDL_GetCPUCacheLineSize,
|
30
|
+
:SDL_HasRDTSC,
|
31
|
+
:SDL_HasAltiVec,
|
32
|
+
:SDL_HasMMX,
|
33
|
+
:SDL_Has3DNow,
|
34
|
+
:SDL_HasSSE,
|
35
|
+
:SDL_HasSSE2,
|
36
|
+
:SDL_HasSSE3,
|
37
|
+
:SDL_HasSSE41,
|
38
|
+
:SDL_HasSSE42,
|
39
|
+
:SDL_HasAVX,
|
40
|
+
:SDL_HasAVX2,
|
41
|
+
:SDL_HasAVX512F,
|
42
|
+
:SDL_HasARMSIMD,
|
43
|
+
:SDL_HasNEON,
|
44
|
+
:SDL_HasLSX,
|
45
|
+
:SDL_HasLASX,
|
46
|
+
:SDL_GetSystemRAM,
|
47
|
+
:SDL_SIMDGetAlignment,
|
48
|
+
:SDL_SIMDAlloc,
|
49
|
+
:SDL_SIMDRealloc,
|
50
|
+
:SDL_SIMDFree,
|
51
|
+
]
|
52
|
+
apis = {
|
53
|
+
:SDL_GetCPUCount => :GetCPUCount,
|
54
|
+
:SDL_GetCPUCacheLineSize => :GetCPUCacheLineSize,
|
55
|
+
:SDL_HasRDTSC => :HasRDTSC,
|
56
|
+
:SDL_HasAltiVec => :HasAltiVec,
|
57
|
+
:SDL_HasMMX => :HasMMX,
|
58
|
+
:SDL_Has3DNow => :Has3DNow,
|
59
|
+
:SDL_HasSSE => :HasSSE,
|
60
|
+
:SDL_HasSSE2 => :HasSSE2,
|
61
|
+
:SDL_HasSSE3 => :HasSSE3,
|
62
|
+
:SDL_HasSSE41 => :HasSSE41,
|
63
|
+
:SDL_HasSSE42 => :HasSSE42,
|
64
|
+
:SDL_HasAVX => :HasAVX,
|
65
|
+
:SDL_HasAVX2 => :HasAVX2,
|
66
|
+
:SDL_HasAVX512F => :HasAVX512F,
|
67
|
+
:SDL_HasARMSIMD => :HasARMSIMD,
|
68
|
+
:SDL_HasNEON => :HasNEON,
|
69
|
+
:SDL_HasLSX => :HasLSX,
|
70
|
+
:SDL_HasLASX => :HasLASX,
|
71
|
+
:SDL_GetSystemRAM => :GetSystemRAM,
|
72
|
+
:SDL_SIMDGetAlignment => :SIMDGetAlignment,
|
73
|
+
:SDL_SIMDAlloc => :SIMDAlloc,
|
74
|
+
:SDL_SIMDRealloc => :SIMDRealloc,
|
75
|
+
:SDL_SIMDFree => :SIMDFree,
|
76
|
+
}
|
77
|
+
args = {
|
78
|
+
:SDL_GetCPUCount => [],
|
79
|
+
:SDL_GetCPUCacheLineSize => [],
|
80
|
+
:SDL_HasRDTSC => [],
|
81
|
+
:SDL_HasAltiVec => [],
|
82
|
+
:SDL_HasMMX => [],
|
83
|
+
:SDL_Has3DNow => [],
|
84
|
+
:SDL_HasSSE => [],
|
85
|
+
:SDL_HasSSE2 => [],
|
86
|
+
:SDL_HasSSE3 => [],
|
87
|
+
:SDL_HasSSE41 => [],
|
88
|
+
:SDL_HasSSE42 => [],
|
89
|
+
:SDL_HasAVX => [],
|
90
|
+
:SDL_HasAVX2 => [],
|
91
|
+
:SDL_HasAVX512F => [],
|
92
|
+
:SDL_HasARMSIMD => [],
|
93
|
+
:SDL_HasNEON => [],
|
94
|
+
:SDL_HasLSX => [],
|
95
|
+
:SDL_HasLASX => [],
|
96
|
+
:SDL_GetSystemRAM => [],
|
97
|
+
:SDL_SIMDGetAlignment => [],
|
98
|
+
:SDL_SIMDAlloc => [:ulong],
|
99
|
+
:SDL_SIMDRealloc => [:pointer, :ulong],
|
100
|
+
:SDL_SIMDFree => [:pointer],
|
101
|
+
}
|
102
|
+
retvals = {
|
103
|
+
:SDL_GetCPUCount => :int,
|
104
|
+
:SDL_GetCPUCacheLineSize => :int,
|
105
|
+
:SDL_HasRDTSC => :int,
|
106
|
+
:SDL_HasAltiVec => :int,
|
107
|
+
:SDL_HasMMX => :int,
|
108
|
+
:SDL_Has3DNow => :int,
|
109
|
+
:SDL_HasSSE => :int,
|
110
|
+
:SDL_HasSSE2 => :int,
|
111
|
+
:SDL_HasSSE3 => :int,
|
112
|
+
:SDL_HasSSE41 => :int,
|
113
|
+
:SDL_HasSSE42 => :int,
|
114
|
+
:SDL_HasAVX => :int,
|
115
|
+
:SDL_HasAVX2 => :int,
|
116
|
+
:SDL_HasAVX512F => :int,
|
117
|
+
:SDL_HasARMSIMD => :int,
|
118
|
+
:SDL_HasNEON => :int,
|
119
|
+
:SDL_HasLSX => :int,
|
120
|
+
:SDL_HasLASX => :int,
|
121
|
+
:SDL_GetSystemRAM => :int,
|
122
|
+
:SDL_SIMDGetAlignment => :size_t,
|
123
|
+
:SDL_SIMDAlloc => :pointer,
|
124
|
+
:SDL_SIMDRealloc => :pointer,
|
125
|
+
:SDL_SIMDFree => :void,
|
126
|
+
}
|
127
|
+
symbols.each do |sym|
|
128
|
+
begin
|
129
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
130
|
+
rescue FFI::NotFoundError => error
|
131
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
132
|
+
end
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
end
|
137
|
+
|
data/lib/sdl2_error.rb
CHANGED
@@ -1,71 +1,71 @@
|
|
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
|
-
ENOMEM = 0
|
17
|
-
EFREAD = 1
|
18
|
-
EFWRITE = 2
|
19
|
-
EFSEEK = 3
|
20
|
-
UNSUPPORTED = 4
|
21
|
-
LASTERROR = 5
|
22
|
-
|
23
|
-
# Typedef
|
24
|
-
|
25
|
-
typedef :int, :SDL_errorcode
|
26
|
-
|
27
|
-
# Struct
|
28
|
-
|
29
|
-
|
30
|
-
# Function
|
31
|
-
|
32
|
-
def self.setup_error_symbols(output_error = false)
|
33
|
-
symbols = [
|
34
|
-
:SDL_SetError,
|
35
|
-
:SDL_GetError,
|
36
|
-
:SDL_GetErrorMsg,
|
37
|
-
:SDL_ClearError,
|
38
|
-
:SDL_Error,
|
39
|
-
]
|
40
|
-
apis = {
|
41
|
-
:SDL_SetError => :SetError,
|
42
|
-
:SDL_GetError => :GetError,
|
43
|
-
:SDL_GetErrorMsg => :GetErrorMsg,
|
44
|
-
:SDL_ClearError => :ClearError,
|
45
|
-
:SDL_Error => :Error,
|
46
|
-
}
|
47
|
-
args = {
|
48
|
-
:SDL_SetError => [:pointer],
|
49
|
-
:SDL_GetError => [],
|
50
|
-
:SDL_GetErrorMsg => [:pointer, :int],
|
51
|
-
:SDL_ClearError => [],
|
52
|
-
:SDL_Error => [:int],
|
53
|
-
}
|
54
|
-
retvals = {
|
55
|
-
:SDL_SetError => :int,
|
56
|
-
:SDL_GetError => :pointer,
|
57
|
-
:SDL_GetErrorMsg => :pointer,
|
58
|
-
:SDL_ClearError => :void,
|
59
|
-
:SDL_Error => :int,
|
60
|
-
}
|
61
|
-
symbols.each do |sym|
|
62
|
-
begin
|
63
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
64
|
-
rescue FFI::NotFoundError => error
|
65
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
66
|
-
end
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
|
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
|
+
ENOMEM = 0
|
17
|
+
EFREAD = 1
|
18
|
+
EFWRITE = 2
|
19
|
+
EFSEEK = 3
|
20
|
+
UNSUPPORTED = 4
|
21
|
+
LASTERROR = 5
|
22
|
+
|
23
|
+
# Typedef
|
24
|
+
|
25
|
+
typedef :int, :SDL_errorcode
|
26
|
+
|
27
|
+
# Struct
|
28
|
+
|
29
|
+
|
30
|
+
# Function
|
31
|
+
|
32
|
+
def self.setup_error_symbols(output_error = false)
|
33
|
+
symbols = [
|
34
|
+
:SDL_SetError,
|
35
|
+
:SDL_GetError,
|
36
|
+
:SDL_GetErrorMsg,
|
37
|
+
:SDL_ClearError,
|
38
|
+
:SDL_Error,
|
39
|
+
]
|
40
|
+
apis = {
|
41
|
+
:SDL_SetError => :SetError,
|
42
|
+
:SDL_GetError => :GetError,
|
43
|
+
:SDL_GetErrorMsg => :GetErrorMsg,
|
44
|
+
:SDL_ClearError => :ClearError,
|
45
|
+
:SDL_Error => :Error,
|
46
|
+
}
|
47
|
+
args = {
|
48
|
+
:SDL_SetError => [:pointer],
|
49
|
+
:SDL_GetError => [],
|
50
|
+
:SDL_GetErrorMsg => [:pointer, :int],
|
51
|
+
:SDL_ClearError => [],
|
52
|
+
:SDL_Error => [:int],
|
53
|
+
}
|
54
|
+
retvals = {
|
55
|
+
:SDL_SetError => :int,
|
56
|
+
:SDL_GetError => :pointer,
|
57
|
+
:SDL_GetErrorMsg => :pointer,
|
58
|
+
:SDL_ClearError => :void,
|
59
|
+
:SDL_Error => :int,
|
60
|
+
}
|
61
|
+
symbols.each do |sym|
|
62
|
+
begin
|
63
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
64
|
+
rescue FFI::NotFoundError => error
|
65
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|