sdl2-bindings 0.0.5 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +96 -79
- data/LICENSE.txt +1 -1
- data/README.md +55 -49
- data/lib/sdl2.rb +172 -170
- data/lib/sdl2_audio.rb +222 -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 +533 -530
- data/lib/sdl2_filesystem.rb +48 -48
- data/lib/sdl2_framerate.rb +67 -67
- data/lib/sdl2_gamecontroller.rb +274 -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_hidapi.rb +118 -0
- data/lib/sdl2_hints.rb +198 -174
- data/lib/sdl2_image.rb +185 -185
- data/lib/sdl2_imageFilter.rb +132 -132
- data/lib/sdl2_joystick.rb +239 -230
- data/lib/sdl2_keyboard.rb +99 -99
- data/lib/sdl2_keycode.rb +305 -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_misc.rb +45 -0
- 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 +322 -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_sensor.rb +97 -0
- data/lib/sdl2_shape.rb +77 -77
- data/lib/sdl2_stdinc.rb +439 -393
- data/lib/sdl2_surface.rb +188 -182
- data/lib/sdl2_syswm.rb +157 -154
- data/lib/sdl2_timer.rb +65 -62
- data/lib/sdl2_touch.rb +75 -73
- data/lib/sdl2_ttf.rb +202 -190
- data/lib/sdl2_version.rb +62 -62
- data/lib/sdl2_video.rb +446 -411
- data/lib/sdl2_vulkan.rb +64 -64
- metadata +9 -6
data/lib/sdl2_filesystem.rb
CHANGED
@@ -1,48 +1,48 @@
|
|
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
|
-
|
20
|
-
# Struct
|
21
|
-
|
22
|
-
|
23
|
-
# Function
|
24
|
-
|
25
|
-
def self.setup_filesystem_symbols()
|
26
|
-
symbols = [
|
27
|
-
:SDL_GetBasePath,
|
28
|
-
:SDL_GetPrefPath,
|
29
|
-
]
|
30
|
-
args = {
|
31
|
-
:SDL_GetBasePath => [],
|
32
|
-
:SDL_GetPrefPath => [:pointer, :pointer],
|
33
|
-
}
|
34
|
-
retvals = {
|
35
|
-
:SDL_GetBasePath => :pointer,
|
36
|
-
:SDL_GetPrefPath => :pointer,
|
37
|
-
}
|
38
|
-
symbols.each do |sym|
|
39
|
-
begin
|
40
|
-
attach_function sym, args[sym], retvals[sym]
|
41
|
-
rescue FFI::NotFoundError => error
|
42
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
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
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
|
23
|
+
# Function
|
24
|
+
|
25
|
+
def self.setup_filesystem_symbols()
|
26
|
+
symbols = [
|
27
|
+
:SDL_GetBasePath,
|
28
|
+
:SDL_GetPrefPath,
|
29
|
+
]
|
30
|
+
args = {
|
31
|
+
:SDL_GetBasePath => [],
|
32
|
+
:SDL_GetPrefPath => [:pointer, :pointer],
|
33
|
+
}
|
34
|
+
retvals = {
|
35
|
+
:SDL_GetBasePath => :pointer,
|
36
|
+
:SDL_GetPrefPath => :pointer,
|
37
|
+
}
|
38
|
+
symbols.each do |sym|
|
39
|
+
begin
|
40
|
+
attach_function sym, args[sym], retvals[sym]
|
41
|
+
rescue FFI::NotFoundError => error
|
42
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
|
data/lib/sdl2_framerate.rb
CHANGED
@@ -1,67 +1,67 @@
|
|
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
|
-
|
20
|
-
# Struct
|
21
|
-
|
22
|
-
class FPSmanager < FFI::Struct
|
23
|
-
layout(
|
24
|
-
:framecount, :uint,
|
25
|
-
:rateticks, :float,
|
26
|
-
:baseticks, :uint,
|
27
|
-
:lastticks, :uint,
|
28
|
-
:rate, :uint,
|
29
|
-
)
|
30
|
-
end
|
31
|
-
|
32
|
-
|
33
|
-
# Function
|
34
|
-
|
35
|
-
def self.setup_gfx_framerate_symbols()
|
36
|
-
symbols = [
|
37
|
-
:SDL_initFramerate,
|
38
|
-
:SDL_setFramerate,
|
39
|
-
:SDL_getFramerate,
|
40
|
-
:SDL_getFramecount,
|
41
|
-
:SDL_framerateDelay,
|
42
|
-
]
|
43
|
-
args = {
|
44
|
-
:SDL_initFramerate => [:pointer],
|
45
|
-
:SDL_setFramerate => [:pointer, :uint],
|
46
|
-
:SDL_getFramerate => [:pointer],
|
47
|
-
:SDL_getFramecount => [:pointer],
|
48
|
-
:SDL_framerateDelay => [:pointer],
|
49
|
-
}
|
50
|
-
retvals = {
|
51
|
-
:SDL_initFramerate => :void,
|
52
|
-
:SDL_setFramerate => :int,
|
53
|
-
:SDL_getFramerate => :int,
|
54
|
-
:SDL_getFramecount => :int,
|
55
|
-
:SDL_framerateDelay => :uint,
|
56
|
-
}
|
57
|
-
symbols.each do |sym|
|
58
|
-
begin
|
59
|
-
attach_function sym, args[sym], retvals[sym]
|
60
|
-
rescue FFI::NotFoundError => error
|
61
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
end
|
67
|
-
|
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
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
class FPSmanager < FFI::Struct
|
23
|
+
layout(
|
24
|
+
:framecount, :uint,
|
25
|
+
:rateticks, :float,
|
26
|
+
:baseticks, :uint,
|
27
|
+
:lastticks, :uint,
|
28
|
+
:rate, :uint,
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
# Function
|
34
|
+
|
35
|
+
def self.setup_gfx_framerate_symbols()
|
36
|
+
symbols = [
|
37
|
+
:SDL_initFramerate,
|
38
|
+
:SDL_setFramerate,
|
39
|
+
:SDL_getFramerate,
|
40
|
+
:SDL_getFramecount,
|
41
|
+
:SDL_framerateDelay,
|
42
|
+
]
|
43
|
+
args = {
|
44
|
+
:SDL_initFramerate => [:pointer],
|
45
|
+
:SDL_setFramerate => [:pointer, :uint],
|
46
|
+
:SDL_getFramerate => [:pointer],
|
47
|
+
:SDL_getFramecount => [:pointer],
|
48
|
+
:SDL_framerateDelay => [:pointer],
|
49
|
+
}
|
50
|
+
retvals = {
|
51
|
+
:SDL_initFramerate => :void,
|
52
|
+
:SDL_setFramerate => :int,
|
53
|
+
:SDL_getFramerate => :int,
|
54
|
+
:SDL_getFramecount => :int,
|
55
|
+
:SDL_framerateDelay => :uint,
|
56
|
+
}
|
57
|
+
symbols.each do |sym|
|
58
|
+
begin
|
59
|
+
attach_function sym, args[sym], retvals[sym]
|
60
|
+
rescue FFI::NotFoundError => error
|
61
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|