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_shape.rb
CHANGED
@@ -1,77 +1,77 @@
|
|
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 SDL2
|
11
|
-
extend FFI::Library
|
12
|
-
# Define/Macro
|
13
|
-
|
14
|
-
SDL_NONSHAPEABLE_WINDOW = -1
|
15
|
-
SDL_INVALID_SHAPE_ARGUMENT = -2
|
16
|
-
SDL_WINDOW_LACKS_SHAPE = -3
|
17
|
-
|
18
|
-
# Enum
|
19
|
-
|
20
|
-
ShapeModeDefault = 0
|
21
|
-
ShapeModeBinarizeAlpha = 1
|
22
|
-
ShapeModeReverseBinarizeAlpha = 2
|
23
|
-
ShapeModeColorKey = 3
|
24
|
-
|
25
|
-
# Typedef
|
26
|
-
|
27
|
-
typedef :int, :WindowShapeMode
|
28
|
-
|
29
|
-
# Struct
|
30
|
-
|
31
|
-
class SDL_WindowShapeParams < FFI::Union
|
32
|
-
layout(
|
33
|
-
:binarizationCutoff, :uchar,
|
34
|
-
:colorKey, SDL_Color,
|
35
|
-
)
|
36
|
-
end
|
37
|
-
|
38
|
-
class SDL_WindowShapeMode < FFI::Struct
|
39
|
-
layout(
|
40
|
-
:mode, :int,
|
41
|
-
:parameters, SDL_WindowShapeParams,
|
42
|
-
)
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
# Function
|
47
|
-
|
48
|
-
def self.setup_shape_symbols()
|
49
|
-
symbols = [
|
50
|
-
:SDL_CreateShapedWindow,
|
51
|
-
:SDL_IsShapedWindow,
|
52
|
-
:SDL_SetWindowShape,
|
53
|
-
:SDL_GetShapedWindowMode,
|
54
|
-
]
|
55
|
-
args = {
|
56
|
-
:SDL_CreateShapedWindow => [:pointer, :uint, :uint, :uint, :uint, :uint],
|
57
|
-
:SDL_IsShapedWindow => [:pointer],
|
58
|
-
:SDL_SetWindowShape => [:pointer, :pointer, :pointer],
|
59
|
-
:SDL_GetShapedWindowMode => [:pointer, :pointer],
|
60
|
-
}
|
61
|
-
retvals = {
|
62
|
-
:SDL_CreateShapedWindow => :pointer,
|
63
|
-
:SDL_IsShapedWindow => :int,
|
64
|
-
:SDL_SetWindowShape => :int,
|
65
|
-
:SDL_GetShapedWindowMode => :int,
|
66
|
-
}
|
67
|
-
symbols.each do |sym|
|
68
|
-
begin
|
69
|
-
attach_function sym, args[sym], retvals[sym]
|
70
|
-
rescue FFI::NotFoundError => error
|
71
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
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 SDL2
|
11
|
+
extend FFI::Library
|
12
|
+
# Define/Macro
|
13
|
+
|
14
|
+
SDL_NONSHAPEABLE_WINDOW = -1
|
15
|
+
SDL_INVALID_SHAPE_ARGUMENT = -2
|
16
|
+
SDL_WINDOW_LACKS_SHAPE = -3
|
17
|
+
|
18
|
+
# Enum
|
19
|
+
|
20
|
+
ShapeModeDefault = 0
|
21
|
+
ShapeModeBinarizeAlpha = 1
|
22
|
+
ShapeModeReverseBinarizeAlpha = 2
|
23
|
+
ShapeModeColorKey = 3
|
24
|
+
|
25
|
+
# Typedef
|
26
|
+
|
27
|
+
typedef :int, :WindowShapeMode
|
28
|
+
|
29
|
+
# Struct
|
30
|
+
|
31
|
+
class SDL_WindowShapeParams < FFI::Union
|
32
|
+
layout(
|
33
|
+
:binarizationCutoff, :uchar,
|
34
|
+
:colorKey, SDL_Color,
|
35
|
+
)
|
36
|
+
end
|
37
|
+
|
38
|
+
class SDL_WindowShapeMode < FFI::Struct
|
39
|
+
layout(
|
40
|
+
:mode, :int,
|
41
|
+
:parameters, SDL_WindowShapeParams,
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
|
46
|
+
# Function
|
47
|
+
|
48
|
+
def self.setup_shape_symbols()
|
49
|
+
symbols = [
|
50
|
+
:SDL_CreateShapedWindow,
|
51
|
+
:SDL_IsShapedWindow,
|
52
|
+
:SDL_SetWindowShape,
|
53
|
+
:SDL_GetShapedWindowMode,
|
54
|
+
]
|
55
|
+
args = {
|
56
|
+
:SDL_CreateShapedWindow => [:pointer, :uint, :uint, :uint, :uint, :uint],
|
57
|
+
:SDL_IsShapedWindow => [:pointer],
|
58
|
+
:SDL_SetWindowShape => [:pointer, :pointer, :pointer],
|
59
|
+
:SDL_GetShapedWindowMode => [:pointer, :pointer],
|
60
|
+
}
|
61
|
+
retvals = {
|
62
|
+
:SDL_CreateShapedWindow => :pointer,
|
63
|
+
:SDL_IsShapedWindow => :int,
|
64
|
+
:SDL_SetWindowShape => :int,
|
65
|
+
:SDL_GetShapedWindowMode => :int,
|
66
|
+
}
|
67
|
+
symbols.each do |sym|
|
68
|
+
begin
|
69
|
+
attach_function sym, args[sym], retvals[sym]
|
70
|
+
rescue FFI::NotFoundError => error
|
71
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
|