sdl2-bindings 0.1.1 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +140 -124
  3. data/LICENSE.txt +0 -0
  4. data/README.md +93 -77
  5. data/lib/sdl2.rb +131 -131
  6. data/lib/sdl2_audio.rb +265 -261
  7. data/lib/sdl2_blendmode.rb +72 -72
  8. data/lib/sdl2_clipboard.rb +56 -56
  9. data/lib/sdl2_cpuinfo.rb +137 -129
  10. data/lib/sdl2_error.rb +71 -71
  11. data/lib/sdl2_events.rb +575 -564
  12. data/lib/sdl2_filesystem.rb +52 -52
  13. data/lib/sdl2_framerate.rb +74 -74
  14. data/lib/sdl2_gamecontroller.rb +345 -329
  15. data/lib/sdl2_gesture.rb +61 -61
  16. data/lib/sdl2_gfxPrimitives.rb +283 -283
  17. data/lib/sdl2_guid.rb +58 -0
  18. data/lib/sdl2_haptic.rb +301 -301
  19. data/lib/sdl2_hidapi.rb +139 -139
  20. data/lib/sdl2_hints.rb +240 -221
  21. data/lib/sdl2_image.rb +296 -232
  22. data/lib/sdl2_imageFilter.rb +164 -164
  23. data/lib/sdl2_joystick.rb +332 -294
  24. data/lib/sdl2_keyboard.rb +129 -125
  25. data/lib/sdl2_keycode.rb +311 -307
  26. data/lib/sdl2_log.rb +131 -131
  27. data/lib/sdl2_main.rb +74 -74
  28. data/lib/sdl2_messagebox.rb +102 -102
  29. data/lib/sdl2_misc.rb +48 -48
  30. data/lib/sdl2_mixer.rb +464 -392
  31. data/lib/sdl2_mouse.rb +136 -136
  32. data/lib/sdl2_pixels.rb +240 -240
  33. data/lib/sdl2_platform.rb +48 -48
  34. data/lib/sdl2_power.rb +54 -54
  35. data/lib/sdl2_rect.rb +145 -145
  36. data/lib/sdl2_render.rb +408 -408
  37. data/lib/sdl2_rotozoom.rb +76 -76
  38. data/lib/sdl2_rwops.rb +242 -238
  39. data/lib/sdl2_scancode.rb +293 -289
  40. data/lib/sdl2_sensor.rb +115 -115
  41. data/lib/sdl2_shape.rb +83 -83
  42. data/lib/sdl2_sound.rb +154 -154
  43. data/lib/sdl2_stdinc.rb +564 -556
  44. data/lib/sdl2_surface.rb +229 -229
  45. data/lib/sdl2_syswm.rb +160 -160
  46. data/lib/sdl2_timer.rb +74 -74
  47. data/lib/sdl2_touch.rb +86 -86
  48. data/lib/sdl2_ttf.rb +414 -358
  49. data/lib/sdl2_version.rb +67 -67
  50. data/lib/sdl2_video.rb +549 -540
  51. data/lib/sdl2_vulkan.rb +72 -72
  52. metadata +4 -3
data/lib/sdl2_sensor.rb CHANGED
@@ -1,115 +1,115 @@
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
- STANDARD_GRAVITY = 9.80665
14
-
15
- # Enum
16
-
17
- SENSOR_INVALID = -1
18
- SENSOR_UNKNOWN = 0
19
- SENSOR_ACCEL = 1
20
- 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(output_error = false)
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
- apis = {
52
- :SDL_LockSensors => :LockSensors,
53
- :SDL_UnlockSensors => :UnlockSensors,
54
- :SDL_NumSensors => :NumSensors,
55
- :SDL_SensorGetDeviceName => :SensorGetDeviceName,
56
- :SDL_SensorGetDeviceType => :SensorGetDeviceType,
57
- :SDL_SensorGetDeviceNonPortableType => :SensorGetDeviceNonPortableType,
58
- :SDL_SensorGetDeviceInstanceID => :SensorGetDeviceInstanceID,
59
- :SDL_SensorOpen => :SensorOpen,
60
- :SDL_SensorFromInstanceID => :SensorFromInstanceID,
61
- :SDL_SensorGetName => :SensorGetName,
62
- :SDL_SensorGetType => :SensorGetType,
63
- :SDL_SensorGetNonPortableType => :SensorGetNonPortableType,
64
- :SDL_SensorGetInstanceID => :SensorGetInstanceID,
65
- :SDL_SensorGetData => :SensorGetData,
66
- :SDL_SensorClose => :SensorClose,
67
- :SDL_SensorUpdate => :SensorUpdate,
68
- }
69
- args = {
70
- :SDL_LockSensors => [],
71
- :SDL_UnlockSensors => [],
72
- :SDL_NumSensors => [],
73
- :SDL_SensorGetDeviceName => [:int],
74
- :SDL_SensorGetDeviceType => [:int],
75
- :SDL_SensorGetDeviceNonPortableType => [:int],
76
- :SDL_SensorGetDeviceInstanceID => [:int],
77
- :SDL_SensorOpen => [:int],
78
- :SDL_SensorFromInstanceID => [:int],
79
- :SDL_SensorGetName => [:pointer],
80
- :SDL_SensorGetType => [:pointer],
81
- :SDL_SensorGetNonPortableType => [:pointer],
82
- :SDL_SensorGetInstanceID => [:pointer],
83
- :SDL_SensorGetData => [:pointer, :pointer, :int],
84
- :SDL_SensorClose => [:pointer],
85
- :SDL_SensorUpdate => [],
86
- }
87
- retvals = {
88
- :SDL_LockSensors => :void,
89
- :SDL_UnlockSensors => :void,
90
- :SDL_NumSensors => :int,
91
- :SDL_SensorGetDeviceName => :pointer,
92
- :SDL_SensorGetDeviceType => :int,
93
- :SDL_SensorGetDeviceNonPortableType => :int,
94
- :SDL_SensorGetDeviceInstanceID => :int,
95
- :SDL_SensorOpen => :pointer,
96
- :SDL_SensorFromInstanceID => :pointer,
97
- :SDL_SensorGetName => :pointer,
98
- :SDL_SensorGetType => :int,
99
- :SDL_SensorGetNonPortableType => :int,
100
- :SDL_SensorGetInstanceID => :int,
101
- :SDL_SensorGetData => :int,
102
- :SDL_SensorClose => :void,
103
- :SDL_SensorUpdate => :void,
104
- }
105
- symbols.each do |sym|
106
- begin
107
- attach_function apis[sym], sym, args[sym], retvals[sym]
108
- rescue FFI::NotFoundError => error
109
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
110
- end
111
- end
112
- end
113
-
114
- end
115
-
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
+ STANDARD_GRAVITY = 9.80665
14
+
15
+ # Enum
16
+
17
+ SENSOR_INVALID = -1
18
+ SENSOR_UNKNOWN = 0
19
+ SENSOR_ACCEL = 1
20
+ 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(output_error = false)
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
+ apis = {
52
+ :SDL_LockSensors => :LockSensors,
53
+ :SDL_UnlockSensors => :UnlockSensors,
54
+ :SDL_NumSensors => :NumSensors,
55
+ :SDL_SensorGetDeviceName => :SensorGetDeviceName,
56
+ :SDL_SensorGetDeviceType => :SensorGetDeviceType,
57
+ :SDL_SensorGetDeviceNonPortableType => :SensorGetDeviceNonPortableType,
58
+ :SDL_SensorGetDeviceInstanceID => :SensorGetDeviceInstanceID,
59
+ :SDL_SensorOpen => :SensorOpen,
60
+ :SDL_SensorFromInstanceID => :SensorFromInstanceID,
61
+ :SDL_SensorGetName => :SensorGetName,
62
+ :SDL_SensorGetType => :SensorGetType,
63
+ :SDL_SensorGetNonPortableType => :SensorGetNonPortableType,
64
+ :SDL_SensorGetInstanceID => :SensorGetInstanceID,
65
+ :SDL_SensorGetData => :SensorGetData,
66
+ :SDL_SensorClose => :SensorClose,
67
+ :SDL_SensorUpdate => :SensorUpdate,
68
+ }
69
+ args = {
70
+ :SDL_LockSensors => [],
71
+ :SDL_UnlockSensors => [],
72
+ :SDL_NumSensors => [],
73
+ :SDL_SensorGetDeviceName => [:int],
74
+ :SDL_SensorGetDeviceType => [:int],
75
+ :SDL_SensorGetDeviceNonPortableType => [:int],
76
+ :SDL_SensorGetDeviceInstanceID => [:int],
77
+ :SDL_SensorOpen => [:int],
78
+ :SDL_SensorFromInstanceID => [:int],
79
+ :SDL_SensorGetName => [:pointer],
80
+ :SDL_SensorGetType => [:pointer],
81
+ :SDL_SensorGetNonPortableType => [:pointer],
82
+ :SDL_SensorGetInstanceID => [:pointer],
83
+ :SDL_SensorGetData => [:pointer, :pointer, :int],
84
+ :SDL_SensorClose => [:pointer],
85
+ :SDL_SensorUpdate => [],
86
+ }
87
+ retvals = {
88
+ :SDL_LockSensors => :void,
89
+ :SDL_UnlockSensors => :void,
90
+ :SDL_NumSensors => :int,
91
+ :SDL_SensorGetDeviceName => :pointer,
92
+ :SDL_SensorGetDeviceType => :int,
93
+ :SDL_SensorGetDeviceNonPortableType => :int,
94
+ :SDL_SensorGetDeviceInstanceID => :int,
95
+ :SDL_SensorOpen => :pointer,
96
+ :SDL_SensorFromInstanceID => :pointer,
97
+ :SDL_SensorGetName => :pointer,
98
+ :SDL_SensorGetType => :int,
99
+ :SDL_SensorGetNonPortableType => :int,
100
+ :SDL_SensorGetInstanceID => :int,
101
+ :SDL_SensorGetData => :int,
102
+ :SDL_SensorClose => :void,
103
+ :SDL_SensorUpdate => :void,
104
+ }
105
+ symbols.each do |sym|
106
+ begin
107
+ attach_function apis[sym], sym, args[sym], retvals[sym]
108
+ rescue FFI::NotFoundError => error
109
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
110
+ end
111
+ end
112
+ end
113
+
114
+ end
115
+
data/lib/sdl2_shape.rb CHANGED
@@ -1,83 +1,83 @@
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 SDL
11
- extend FFI::Library
12
- # Define/Macro
13
-
14
- NONSHAPEABLE_WINDOW = -1
15
- INVALID_SHAPE_ARGUMENT = -2
16
- 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 WindowShapeParams < FFI::Union
32
- layout(
33
- :binarizationCutoff, :uchar,
34
- :colorKey, Color,
35
- )
36
- end
37
-
38
- class WindowShapeMode < FFI::Struct
39
- layout(
40
- :mode, :int,
41
- :parameters, WindowShapeParams,
42
- )
43
- end
44
-
45
-
46
- # Function
47
-
48
- def self.setup_shape_symbols(output_error = false)
49
- symbols = [
50
- :SDL_CreateShapedWindow,
51
- :SDL_IsShapedWindow,
52
- :SDL_SetWindowShape,
53
- :SDL_GetShapedWindowMode,
54
- ]
55
- apis = {
56
- :SDL_CreateShapedWindow => :CreateShapedWindow,
57
- :SDL_IsShapedWindow => :IsShapedWindow,
58
- :SDL_SetWindowShape => :SetWindowShape,
59
- :SDL_GetShapedWindowMode => :GetShapedWindowMode,
60
- }
61
- args = {
62
- :SDL_CreateShapedWindow => [:pointer, :uint, :uint, :uint, :uint, :uint],
63
- :SDL_IsShapedWindow => [:pointer],
64
- :SDL_SetWindowShape => [:pointer, :pointer, :pointer],
65
- :SDL_GetShapedWindowMode => [:pointer, :pointer],
66
- }
67
- retvals = {
68
- :SDL_CreateShapedWindow => :pointer,
69
- :SDL_IsShapedWindow => :int,
70
- :SDL_SetWindowShape => :int,
71
- :SDL_GetShapedWindowMode => :int,
72
- }
73
- symbols.each do |sym|
74
- begin
75
- attach_function apis[sym], sym, args[sym], retvals[sym]
76
- rescue FFI::NotFoundError => error
77
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
78
- end
79
- end
80
- end
81
-
82
- end
83
-
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 SDL
11
+ extend FFI::Library
12
+ # Define/Macro
13
+
14
+ NONSHAPEABLE_WINDOW = -1
15
+ INVALID_SHAPE_ARGUMENT = -2
16
+ 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 WindowShapeParams < FFI::Union
32
+ layout(
33
+ :binarizationCutoff, :uchar,
34
+ :colorKey, Color,
35
+ )
36
+ end
37
+
38
+ class WindowShapeMode < FFI::Struct
39
+ layout(
40
+ :mode, :int,
41
+ :parameters, WindowShapeParams,
42
+ )
43
+ end
44
+
45
+
46
+ # Function
47
+
48
+ def self.setup_shape_symbols(output_error = false)
49
+ symbols = [
50
+ :SDL_CreateShapedWindow,
51
+ :SDL_IsShapedWindow,
52
+ :SDL_SetWindowShape,
53
+ :SDL_GetShapedWindowMode,
54
+ ]
55
+ apis = {
56
+ :SDL_CreateShapedWindow => :CreateShapedWindow,
57
+ :SDL_IsShapedWindow => :IsShapedWindow,
58
+ :SDL_SetWindowShape => :SetWindowShape,
59
+ :SDL_GetShapedWindowMode => :GetShapedWindowMode,
60
+ }
61
+ args = {
62
+ :SDL_CreateShapedWindow => [:pointer, :uint, :uint, :uint, :uint, :uint],
63
+ :SDL_IsShapedWindow => [:pointer],
64
+ :SDL_SetWindowShape => [:pointer, :pointer, :pointer],
65
+ :SDL_GetShapedWindowMode => [:pointer, :pointer],
66
+ }
67
+ retvals = {
68
+ :SDL_CreateShapedWindow => :pointer,
69
+ :SDL_IsShapedWindow => :int,
70
+ :SDL_SetWindowShape => :int,
71
+ :SDL_GetShapedWindowMode => :int,
72
+ }
73
+ symbols.each do |sym|
74
+ begin
75
+ attach_function apis[sym], sym, args[sym], retvals[sym]
76
+ rescue FFI::NotFoundError => error
77
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
78
+ end
79
+ end
80
+ end
81
+
82
+ end
83
+