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.
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_hidapi.rb CHANGED
@@ -1,139 +1,139 @@
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
- class Hid_device_info < FFI::Struct
23
- layout(
24
- :path, :pointer,
25
- :vendor_id, :ushort,
26
- :product_id, :ushort,
27
- :serial_number, :pointer,
28
- :release_number, :ushort,
29
- :manufacturer_string, :pointer,
30
- :product_string, :pointer,
31
- :usage_page, :ushort,
32
- :usage, :ushort,
33
- :interface_number, :int,
34
- :interface_class, :int,
35
- :interface_subclass, :int,
36
- :interface_protocol, :int,
37
- :next, :pointer,
38
- )
39
- end
40
-
41
-
42
- # Function
43
-
44
- def self.setup_hidapi_symbols(output_error = false)
45
- symbols = [
46
- :SDL_hid_init,
47
- :SDL_hid_exit,
48
- :SDL_hid_device_change_count,
49
- :SDL_hid_enumerate,
50
- :SDL_hid_free_enumeration,
51
- :SDL_hid_open,
52
- :SDL_hid_open_path,
53
- :SDL_hid_write,
54
- :SDL_hid_read_timeout,
55
- :SDL_hid_read,
56
- :SDL_hid_set_nonblocking,
57
- :SDL_hid_send_feature_report,
58
- :SDL_hid_get_feature_report,
59
- :SDL_hid_close,
60
- :SDL_hid_get_manufacturer_string,
61
- :SDL_hid_get_product_string,
62
- :SDL_hid_get_serial_number_string,
63
- :SDL_hid_get_indexed_string,
64
- :SDL_hid_ble_scan,
65
- ]
66
- apis = {
67
- :SDL_hid_init => :hid_init,
68
- :SDL_hid_exit => :hid_exit,
69
- :SDL_hid_device_change_count => :hid_device_change_count,
70
- :SDL_hid_enumerate => :hid_enumerate,
71
- :SDL_hid_free_enumeration => :hid_free_enumeration,
72
- :SDL_hid_open => :hid_open,
73
- :SDL_hid_open_path => :hid_open_path,
74
- :SDL_hid_write => :hid_write,
75
- :SDL_hid_read_timeout => :hid_read_timeout,
76
- :SDL_hid_read => :hid_read,
77
- :SDL_hid_set_nonblocking => :hid_set_nonblocking,
78
- :SDL_hid_send_feature_report => :hid_send_feature_report,
79
- :SDL_hid_get_feature_report => :hid_get_feature_report,
80
- :SDL_hid_close => :hid_close,
81
- :SDL_hid_get_manufacturer_string => :hid_get_manufacturer_string,
82
- :SDL_hid_get_product_string => :hid_get_product_string,
83
- :SDL_hid_get_serial_number_string => :hid_get_serial_number_string,
84
- :SDL_hid_get_indexed_string => :hid_get_indexed_string,
85
- :SDL_hid_ble_scan => :hid_ble_scan,
86
- }
87
- args = {
88
- :SDL_hid_init => [],
89
- :SDL_hid_exit => [],
90
- :SDL_hid_device_change_count => [],
91
- :SDL_hid_enumerate => [:ushort, :ushort],
92
- :SDL_hid_free_enumeration => [:pointer],
93
- :SDL_hid_open => [:ushort, :ushort, :pointer],
94
- :SDL_hid_open_path => [:pointer, :int],
95
- :SDL_hid_write => [:pointer, :pointer, :int],
96
- :SDL_hid_read_timeout => [:pointer, :pointer, :int, :int],
97
- :SDL_hid_read => [:pointer, :pointer, :int],
98
- :SDL_hid_set_nonblocking => [:pointer, :int],
99
- :SDL_hid_send_feature_report => [:pointer, :pointer, :int],
100
- :SDL_hid_get_feature_report => [:pointer, :pointer, :int],
101
- :SDL_hid_close => [:pointer],
102
- :SDL_hid_get_manufacturer_string => [:pointer, :pointer, :int],
103
- :SDL_hid_get_product_string => [:pointer, :pointer, :int],
104
- :SDL_hid_get_serial_number_string => [:pointer, :pointer, :int],
105
- :SDL_hid_get_indexed_string => [:pointer, :int, :pointer, :int],
106
- :SDL_hid_ble_scan => [:int],
107
- }
108
- retvals = {
109
- :SDL_hid_init => :int,
110
- :SDL_hid_exit => :int,
111
- :SDL_hid_device_change_count => :uint,
112
- :SDL_hid_enumerate => :pointer,
113
- :SDL_hid_free_enumeration => :void,
114
- :SDL_hid_open => :pointer,
115
- :SDL_hid_open_path => :pointer,
116
- :SDL_hid_write => :int,
117
- :SDL_hid_read_timeout => :int,
118
- :SDL_hid_read => :int,
119
- :SDL_hid_set_nonblocking => :int,
120
- :SDL_hid_send_feature_report => :int,
121
- :SDL_hid_get_feature_report => :int,
122
- :SDL_hid_close => :void,
123
- :SDL_hid_get_manufacturer_string => :int,
124
- :SDL_hid_get_product_string => :int,
125
- :SDL_hid_get_serial_number_string => :int,
126
- :SDL_hid_get_indexed_string => :int,
127
- :SDL_hid_ble_scan => :void,
128
- }
129
- symbols.each do |sym|
130
- begin
131
- attach_function apis[sym], sym, args[sym], retvals[sym]
132
- rescue FFI::NotFoundError => error
133
- $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
134
- end
135
- end
136
- end
137
-
138
- end
139
-
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
+ class Hid_device_info < FFI::Struct
23
+ layout(
24
+ :path, :pointer,
25
+ :vendor_id, :ushort,
26
+ :product_id, :ushort,
27
+ :serial_number, :pointer,
28
+ :release_number, :ushort,
29
+ :manufacturer_string, :pointer,
30
+ :product_string, :pointer,
31
+ :usage_page, :ushort,
32
+ :usage, :ushort,
33
+ :interface_number, :int,
34
+ :interface_class, :int,
35
+ :interface_subclass, :int,
36
+ :interface_protocol, :int,
37
+ :next, :pointer,
38
+ )
39
+ end
40
+
41
+
42
+ # Function
43
+
44
+ def self.setup_hidapi_symbols(output_error = false)
45
+ symbols = [
46
+ :SDL_hid_init,
47
+ :SDL_hid_exit,
48
+ :SDL_hid_device_change_count,
49
+ :SDL_hid_enumerate,
50
+ :SDL_hid_free_enumeration,
51
+ :SDL_hid_open,
52
+ :SDL_hid_open_path,
53
+ :SDL_hid_write,
54
+ :SDL_hid_read_timeout,
55
+ :SDL_hid_read,
56
+ :SDL_hid_set_nonblocking,
57
+ :SDL_hid_send_feature_report,
58
+ :SDL_hid_get_feature_report,
59
+ :SDL_hid_close,
60
+ :SDL_hid_get_manufacturer_string,
61
+ :SDL_hid_get_product_string,
62
+ :SDL_hid_get_serial_number_string,
63
+ :SDL_hid_get_indexed_string,
64
+ :SDL_hid_ble_scan,
65
+ ]
66
+ apis = {
67
+ :SDL_hid_init => :hid_init,
68
+ :SDL_hid_exit => :hid_exit,
69
+ :SDL_hid_device_change_count => :hid_device_change_count,
70
+ :SDL_hid_enumerate => :hid_enumerate,
71
+ :SDL_hid_free_enumeration => :hid_free_enumeration,
72
+ :SDL_hid_open => :hid_open,
73
+ :SDL_hid_open_path => :hid_open_path,
74
+ :SDL_hid_write => :hid_write,
75
+ :SDL_hid_read_timeout => :hid_read_timeout,
76
+ :SDL_hid_read => :hid_read,
77
+ :SDL_hid_set_nonblocking => :hid_set_nonblocking,
78
+ :SDL_hid_send_feature_report => :hid_send_feature_report,
79
+ :SDL_hid_get_feature_report => :hid_get_feature_report,
80
+ :SDL_hid_close => :hid_close,
81
+ :SDL_hid_get_manufacturer_string => :hid_get_manufacturer_string,
82
+ :SDL_hid_get_product_string => :hid_get_product_string,
83
+ :SDL_hid_get_serial_number_string => :hid_get_serial_number_string,
84
+ :SDL_hid_get_indexed_string => :hid_get_indexed_string,
85
+ :SDL_hid_ble_scan => :hid_ble_scan,
86
+ }
87
+ args = {
88
+ :SDL_hid_init => [],
89
+ :SDL_hid_exit => [],
90
+ :SDL_hid_device_change_count => [],
91
+ :SDL_hid_enumerate => [:ushort, :ushort],
92
+ :SDL_hid_free_enumeration => [:pointer],
93
+ :SDL_hid_open => [:ushort, :ushort, :pointer],
94
+ :SDL_hid_open_path => [:pointer, :int],
95
+ :SDL_hid_write => [:pointer, :pointer, :ulong],
96
+ :SDL_hid_read_timeout => [:pointer, :pointer, :ulong, :int],
97
+ :SDL_hid_read => [:pointer, :pointer, :ulong],
98
+ :SDL_hid_set_nonblocking => [:pointer, :int],
99
+ :SDL_hid_send_feature_report => [:pointer, :pointer, :ulong],
100
+ :SDL_hid_get_feature_report => [:pointer, :pointer, :ulong],
101
+ :SDL_hid_close => [:pointer],
102
+ :SDL_hid_get_manufacturer_string => [:pointer, :pointer, :ulong],
103
+ :SDL_hid_get_product_string => [:pointer, :pointer, :ulong],
104
+ :SDL_hid_get_serial_number_string => [:pointer, :pointer, :ulong],
105
+ :SDL_hid_get_indexed_string => [:pointer, :int, :pointer, :ulong],
106
+ :SDL_hid_ble_scan => [:int],
107
+ }
108
+ retvals = {
109
+ :SDL_hid_init => :int,
110
+ :SDL_hid_exit => :int,
111
+ :SDL_hid_device_change_count => :uint,
112
+ :SDL_hid_enumerate => :pointer,
113
+ :SDL_hid_free_enumeration => :void,
114
+ :SDL_hid_open => :pointer,
115
+ :SDL_hid_open_path => :pointer,
116
+ :SDL_hid_write => :int,
117
+ :SDL_hid_read_timeout => :int,
118
+ :SDL_hid_read => :int,
119
+ :SDL_hid_set_nonblocking => :int,
120
+ :SDL_hid_send_feature_report => :int,
121
+ :SDL_hid_get_feature_report => :int,
122
+ :SDL_hid_close => :void,
123
+ :SDL_hid_get_manufacturer_string => :int,
124
+ :SDL_hid_get_product_string => :int,
125
+ :SDL_hid_get_serial_number_string => :int,
126
+ :SDL_hid_get_indexed_string => :int,
127
+ :SDL_hid_ble_scan => :void,
128
+ }
129
+ symbols.each do |sym|
130
+ begin
131
+ attach_function apis[sym], sym, args[sym], retvals[sym]
132
+ rescue FFI::NotFoundError => error
133
+ $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
134
+ end
135
+ end
136
+ end
137
+
138
+ end
139
+