sdl2-bindings 0.1.0 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +134 -108
- data/LICENSE.txt +0 -0
- data/README.md +86 -68
- data/lib/sdl2.rb +131 -127
- data/lib/sdl2_audio.rb +261 -261
- data/lib/sdl2_blendmode.rb +72 -72
- data/lib/sdl2_clipboard.rb +56 -56
- data/lib/sdl2_cpuinfo.rb +129 -129
- data/lib/sdl2_error.rb +71 -71
- data/lib/sdl2_events.rb +564 -552
- data/lib/sdl2_filesystem.rb +52 -52
- data/lib/sdl2_framerate.rb +74 -74
- data/lib/sdl2_gamecontroller.rb +329 -329
- data/lib/sdl2_gesture.rb +61 -61
- data/lib/sdl2_gfxPrimitives.rb +283 -283
- data/lib/sdl2_haptic.rb +301 -301
- data/lib/sdl2_hidapi.rb +139 -139
- data/lib/sdl2_hints.rb +221 -207
- data/lib/sdl2_image.rb +296 -232
- data/lib/sdl2_imageFilter.rb +164 -164
- data/lib/sdl2_joystick.rb +294 -294
- data/lib/sdl2_keyboard.rb +125 -117
- data/lib/sdl2_keycode.rb +307 -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 -109
- data/lib/sdl2_render.rb +408 -404
- data/lib/sdl2_rotozoom.rb +76 -76
- data/lib/sdl2_rwops.rb +242 -238
- data/lib/sdl2_scancode.rb +289 -289
- data/lib/sdl2_sensor.rb +115 -115
- data/lib/sdl2_shape.rb +83 -83
- data/lib/sdl2_sound.rb +154 -0
- data/lib/sdl2_stdinc.rb +548 -564
- 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 -82
- data/lib/sdl2_ttf.rb +414 -357
- data/lib/sdl2_version.rb +67 -67
- data/lib/sdl2_video.rb +540 -540
- data/lib/sdl2_vulkan.rb +72 -72
- metadata +3 -2
data/lib/sdl2_version.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 SDL
|
10
|
-
extend FFI::Library
|
11
|
-
# Define/Macro
|
12
|
-
|
13
|
-
MAJOR_VERSION = 2
|
14
|
-
MINOR_VERSION = 0
|
15
|
-
PATCHLEVEL =
|
16
|
-
|
17
|
-
# Enum
|
18
|
-
|
19
|
-
|
20
|
-
# Typedef
|
21
|
-
|
22
|
-
|
23
|
-
# Struct
|
24
|
-
|
25
|
-
class Version < FFI::Struct
|
26
|
-
layout(
|
27
|
-
:major, :uchar,
|
28
|
-
:minor, :uchar,
|
29
|
-
:patch, :uchar,
|
30
|
-
)
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
# Function
|
35
|
-
|
36
|
-
def self.setup_version_symbols(output_error = false)
|
37
|
-
symbols = [
|
38
|
-
:SDL_GetVersion,
|
39
|
-
:SDL_GetRevision,
|
40
|
-
:SDL_GetRevisionNumber,
|
41
|
-
]
|
42
|
-
apis = {
|
43
|
-
:SDL_GetVersion => :GetVersion,
|
44
|
-
:SDL_GetRevision => :GetRevision,
|
45
|
-
:SDL_GetRevisionNumber => :GetRevisionNumber,
|
46
|
-
}
|
47
|
-
args = {
|
48
|
-
:SDL_GetVersion => [:pointer],
|
49
|
-
:SDL_GetRevision => [],
|
50
|
-
:SDL_GetRevisionNumber => [],
|
51
|
-
}
|
52
|
-
retvals = {
|
53
|
-
:SDL_GetVersion => :void,
|
54
|
-
:SDL_GetRevision => :pointer,
|
55
|
-
:SDL_GetRevisionNumber => :int,
|
56
|
-
}
|
57
|
-
symbols.each do |sym|
|
58
|
-
begin
|
59
|
-
attach_function apis[sym], sym, args[sym], retvals[sym]
|
60
|
-
rescue FFI::NotFoundError => error
|
61
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_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 SDL
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
MAJOR_VERSION = 2
|
14
|
+
MINOR_VERSION = 0
|
15
|
+
PATCHLEVEL = 22
|
16
|
+
|
17
|
+
# Enum
|
18
|
+
|
19
|
+
|
20
|
+
# Typedef
|
21
|
+
|
22
|
+
|
23
|
+
# Struct
|
24
|
+
|
25
|
+
class Version < FFI::Struct
|
26
|
+
layout(
|
27
|
+
:major, :uchar,
|
28
|
+
:minor, :uchar,
|
29
|
+
:patch, :uchar,
|
30
|
+
)
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
# Function
|
35
|
+
|
36
|
+
def self.setup_version_symbols(output_error = false)
|
37
|
+
symbols = [
|
38
|
+
:SDL_GetVersion,
|
39
|
+
:SDL_GetRevision,
|
40
|
+
:SDL_GetRevisionNumber,
|
41
|
+
]
|
42
|
+
apis = {
|
43
|
+
:SDL_GetVersion => :GetVersion,
|
44
|
+
:SDL_GetRevision => :GetRevision,
|
45
|
+
:SDL_GetRevisionNumber => :GetRevisionNumber,
|
46
|
+
}
|
47
|
+
args = {
|
48
|
+
:SDL_GetVersion => [:pointer],
|
49
|
+
:SDL_GetRevision => [],
|
50
|
+
:SDL_GetRevisionNumber => [],
|
51
|
+
}
|
52
|
+
retvals = {
|
53
|
+
:SDL_GetVersion => :void,
|
54
|
+
:SDL_GetRevision => :pointer,
|
55
|
+
:SDL_GetRevisionNumber => :int,
|
56
|
+
}
|
57
|
+
symbols.each do |sym|
|
58
|
+
begin
|
59
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
60
|
+
rescue FFI::NotFoundError => error
|
61
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|