SDLRuby 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -19
  3. data/LICENSE.txt +21 -21
  4. data/README.md +31 -31
  5. data/Rakefile +12 -12
  6. data/SDLRuby.gemspec +38 -0
  7. data/examples/alert.rb +8 -0
  8. data/examples/window.rb +7 -0
  9. data/lib/SDLRuby/event/accessor.rb +2 -2
  10. data/lib/SDLRuby/event.rb +101 -101
  11. data/lib/SDLRuby/image/include/SDL_image.h.rb +61 -61
  12. data/lib/SDLRuby/mixer/include/SDL_mixer.h.rb +95 -95
  13. data/lib/SDLRuby/rw/operational.rb +116 -0
  14. data/lib/SDLRuby/rw/read_closure.rb +28 -0
  15. data/lib/SDLRuby/rw/seek_closure.rb +22 -0
  16. data/lib/SDLRuby/rw/size_closure.rb +21 -0
  17. data/lib/SDLRuby/rw/write_closure.rb +21 -0
  18. data/lib/SDLRuby/rw_ops/mem_close.rb +27 -0
  19. data/lib/SDLRuby/rw_ops/rw_object.rb +13 -107
  20. data/lib/SDLRuby/rw_ops.rb +40 -165
  21. data/lib/SDLRuby/sdl/include/SDL.h.rb +44 -44
  22. data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +160 -160
  23. data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +30 -30
  24. data/lib/SDLRuby/sdl/include/SDL_clipboard.h.rb +10 -10
  25. data/lib/SDLRuby/sdl/include/SDL_config.h.rb +13 -13
  26. data/lib/SDLRuby/sdl/include/SDL_cpuinfo.h.rb +27 -27
  27. data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +12 -12
  28. data/lib/SDLRuby/sdl/include/SDL_error.h.rb +28 -28
  29. data/lib/SDLRuby/sdl/include/SDL_events.h.rb +472 -472
  30. data/lib/SDLRuby/sdl/include/SDL_filesystem.h.rb +6 -6
  31. data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +147 -147
  32. data/lib/SDLRuby/sdl/include/SDL_gesture.h.rb +12 -12
  33. data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +13 -13
  34. data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +199 -199
  35. data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +131 -131
  36. data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +35 -35
  37. data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +292 -292
  38. data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +13 -13
  39. data/lib/SDLRuby/sdl/include/SDL_main.h.rb +3 -3
  40. data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +58 -58
  41. data/lib/SDLRuby/sdl/include/SDL_misc.h.rb +5 -5
  42. data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +57 -57
  43. data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +285 -285
  44. data/lib/SDLRuby/sdl/include/SDL_platform.h.rb +3 -3
  45. data/lib/SDLRuby/sdl/include/SDL_power.h.rb +6 -6
  46. data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +46 -46
  47. data/lib/SDLRuby/sdl/include/SDL_render.h.rb +131 -131
  48. data/lib/SDLRuby/sdl/include/SDL_revision.h.rb +2 -2
  49. data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +78 -78
  50. data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +252 -252
  51. data/lib/SDLRuby/sdl/include/SDL_sensor.h.rb +25 -25
  52. data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +40 -40
  53. data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +62 -62
  54. data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +100 -100
  55. data/lib/SDLRuby/sdl/include/SDL_system.h.rb +6 -6
  56. data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +10 -10
  57. data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +21 -21
  58. data/lib/SDLRuby/sdl/include/SDL_touch.h.rb +15 -15
  59. data/lib/SDLRuby/sdl/include/SDL_types.h.rb +3 -3
  60. data/lib/SDLRuby/sdl/include/SDL_version.h.rb +14 -14
  61. data/lib/SDLRuby/sdl/include/SDL_video.h.rb +264 -264
  62. data/lib/SDLRuby/sdl.rb +6 -6
  63. data/lib/SDLRuby/ttf/include/SDL_ttf.h.rb +54 -54
  64. data/lib/SDLRuby/version.rb +5 -5
  65. data/lib/SDLRuby/window/surfacer.rb +37 -37
  66. data/lib/SDLRuby.rb +32 -16
  67. data/sig/SDLRuby.rbs +4 -4
  68. data/sig/lib/SDLRuby/event/accessor.rbs +157 -157
  69. data/sig/lib/SDLRuby/event/type.rbs +67 -67
  70. data/sig/lib/SDLRuby/event.rbs +47 -47
  71. data/sig/lib/SDLRuby/keyboard.rbs +25 -25
  72. data/sig/lib/SDLRuby/mouse.rbs +35 -35
  73. data/sig/lib/SDLRuby/sdl.rbs +655 -655
  74. data/sig/lib/SDLRuby/timer.rbs +7 -7
  75. metadata +12 -3
@@ -1,67 +1,67 @@
1
- module SDLRuby
2
- class Event
3
- module Type
4
- include SDL
5
-
6
- QUIT_EVENT: ::Range[Integer]
7
-
8
- DISPLAY_EVENT: ::Range[Integer]
9
-
10
- WINDOW_EVENT: ::Range[Integer]
11
-
12
- SYSWM_EVENT: ::Range[Integer]
13
-
14
- KEY_EVENT: ::Range[Integer]
15
-
16
- EDIT_EVENT: ::Range[Integer]
17
-
18
- TEXT_EVENT: ::Range[Integer]
19
-
20
- EDIT_EXT_EVENT: ::Range[Integer]
21
-
22
- MOTION_EVENT: ::Range[Integer]
23
-
24
- BUTTON_EVENT: ::Range[Integer]
25
-
26
- WHEEL_EVENT: ::Range[Integer]
27
-
28
- JAXIS_EVENT: ::Range[Integer]
29
-
30
- JBALL_EVENT: ::Range[Integer]
31
-
32
- JHAT_EVENT: ::Range[Integer]
33
-
34
- JBUTTON_EVENT: ::Range[Integer]
35
-
36
- JDEVICE_EVENT: ::Range[Integer]
37
-
38
- JBATTERY_EVENT: ::Range[Integer]
39
-
40
- CAXIS_EVENT: ::Range[Integer]
41
-
42
- CBUTTON_EVENT: ::Range[Integer]
43
-
44
- CDEVICE_EVENT: ::Range[Integer]
45
-
46
- CTOUCHPAD_EVENT: ::Range[Integer]
47
-
48
- CSENSOR_EVENT: ::Range[Integer]
49
-
50
- TFINGER_EVENT: ::Range[Integer]
51
-
52
- DGESTURE_EVENT: ::Range[Integer]
53
-
54
- MGESTURE_EVENT: ::Range[Integer]
55
-
56
- DROP_EVENT: ::Range[Integer]
57
-
58
- ADEVICE_EVENT: ::Range[Integer]
59
-
60
- SENSOR_EVENT: ::Range[Integer]
61
-
62
- USER_EVENT: ::Range[Integer]
63
-
64
- def self.to_sym: (Integer `type`) -> Symbol
65
- end
66
- end
67
- end
1
+ module SDLRuby
2
+ class Event
3
+ module Type
4
+ include SDL
5
+
6
+ QUIT_EVENT: ::Range[Integer]
7
+
8
+ DISPLAY_EVENT: ::Range[Integer]
9
+
10
+ WINDOW_EVENT: ::Range[Integer]
11
+
12
+ SYSWM_EVENT: ::Range[Integer]
13
+
14
+ KEY_EVENT: ::Range[Integer]
15
+
16
+ EDIT_EVENT: ::Range[Integer]
17
+
18
+ TEXT_EVENT: ::Range[Integer]
19
+
20
+ EDIT_EXT_EVENT: ::Range[Integer]
21
+
22
+ MOTION_EVENT: ::Range[Integer]
23
+
24
+ BUTTON_EVENT: ::Range[Integer]
25
+
26
+ WHEEL_EVENT: ::Range[Integer]
27
+
28
+ JAXIS_EVENT: ::Range[Integer]
29
+
30
+ JBALL_EVENT: ::Range[Integer]
31
+
32
+ JHAT_EVENT: ::Range[Integer]
33
+
34
+ JBUTTON_EVENT: ::Range[Integer]
35
+
36
+ JDEVICE_EVENT: ::Range[Integer]
37
+
38
+ JBATTERY_EVENT: ::Range[Integer]
39
+
40
+ CAXIS_EVENT: ::Range[Integer]
41
+
42
+ CBUTTON_EVENT: ::Range[Integer]
43
+
44
+ CDEVICE_EVENT: ::Range[Integer]
45
+
46
+ CTOUCHPAD_EVENT: ::Range[Integer]
47
+
48
+ CSENSOR_EVENT: ::Range[Integer]
49
+
50
+ TFINGER_EVENT: ::Range[Integer]
51
+
52
+ DGESTURE_EVENT: ::Range[Integer]
53
+
54
+ MGESTURE_EVENT: ::Range[Integer]
55
+
56
+ DROP_EVENT: ::Range[Integer]
57
+
58
+ ADEVICE_EVENT: ::Range[Integer]
59
+
60
+ SENSOR_EVENT: ::Range[Integer]
61
+
62
+ USER_EVENT: ::Range[Integer]
63
+
64
+ def self.to_sym: (Integer `type`) -> Symbol
65
+ end
66
+ end
67
+ end
@@ -1,47 +1,47 @@
1
- module SDLRuby
2
- class Event
3
- include Accessor
4
-
5
- include SDL
6
-
7
- private
8
-
9
- def self.__malloc__: () -> untyped
10
-
11
- public
12
-
13
- def self.clear: () -> void
14
-
15
- def self.deq: (?bool non_block) -> (self | nil)
16
-
17
- def self.disable: (Integer `type`) -> void
18
-
19
- def self.empty?: () -> untyped
20
-
21
- def self.enable: (Integer `type`) -> void
22
-
23
- def self.get: () -> Event
24
-
25
- def self.length: () -> Integer
26
-
27
- alias self.size self.length
28
-
29
- def self.quit?: () -> bool
30
-
31
- def self.reserve: (Integer num) -> Integer
32
-
33
- def self.update: () -> void
34
-
35
- def self.wait: (?Integer|Float|Rational? timeout) -> boolish
36
-
37
- def initialize: (untyped ptr) -> void
38
-
39
- private
40
-
41
- attr_reader entity: untyped
42
-
43
- public
44
-
45
- def to_ptr: () -> untyped
46
- end
47
- end
1
+ module SDLRuby
2
+ class Event
3
+ include Accessor
4
+
5
+ include SDL
6
+
7
+ private
8
+
9
+ def self.__malloc__: () -> untyped
10
+
11
+ public
12
+
13
+ def self.clear: () -> void
14
+
15
+ def self.deq: (?bool non_block) -> (self | nil)
16
+
17
+ def self.disable: (Integer `type`) -> void
18
+
19
+ def self.empty?: () -> untyped
20
+
21
+ def self.enable: (Integer `type`) -> void
22
+
23
+ def self.get: () -> Event
24
+
25
+ def self.length: () -> Integer
26
+
27
+ alias self.size self.length
28
+
29
+ def self.quit?: () -> bool
30
+
31
+ def self.reserve: (Integer num) -> Integer
32
+
33
+ def self.update: () -> void
34
+
35
+ def self.wait: (?Integer|Float|Rational? timeout) -> boolish
36
+
37
+ def initialize: (untyped ptr) -> void
38
+
39
+ private
40
+
41
+ attr_reader entity: untyped
42
+
43
+ public
44
+
45
+ def to_ptr: () -> untyped
46
+ end
47
+ end
@@ -1,25 +1,25 @@
1
- module SDLRuby
2
- module Keyboard
3
- include SDL
4
-
5
- def self.==: (untyped other) -> bool
6
-
7
- def self.any?: () -> bool
8
-
9
- def self.clear: () -> void
10
-
11
- def self.mod: () -> Integer
12
-
13
- def self.scancode: (String | Symbol s) -> Integer
14
-
15
- def self.scancode_name: (Integer num) -> String
16
-
17
- def self.size: () -> Integer
18
-
19
- alias self.length self.size
20
-
21
- def self.to_a: () -> Array[Integer]
22
-
23
- def self.to_str: () -> String
24
- end
25
- end
1
+ module SDLRuby
2
+ module Keyboard
3
+ include SDL
4
+
5
+ def self.==: (untyped other) -> bool
6
+
7
+ def self.any?: () -> bool
8
+
9
+ def self.clear: () -> void
10
+
11
+ def self.mod: () -> Integer
12
+
13
+ def self.scancode: (String | Symbol s) -> Integer
14
+
15
+ def self.scancode_name: (Integer num) -> String
16
+
17
+ def self.size: () -> Integer
18
+
19
+ alias self.length self.size
20
+
21
+ def self.to_a: () -> Array[Integer]
22
+
23
+ def self.to_str: () -> String
24
+ end
25
+ end
@@ -1,35 +1,35 @@
1
- module SDLRuby
2
- module Mouse
3
- include SDL
4
-
5
- def self.button: () -> Array[bool]
6
-
7
- def self.capture=: (boolish) -> void
8
-
9
- def self.global_button: () -> Array[bool]
10
-
11
- def self.global_pos: () -> [Integer, Integer]
12
-
13
- def self.global_pos=: ([Integer, Integer] xy) -> void
14
-
15
- def self.global_state: () -> [Array[bool], Integer, Integer]
16
-
17
- def self.pos: () -> [Integer, Integer]
18
-
19
- def self.pos=: ([Integer, Integer] xy) -> void
20
-
21
- def self.relative=: (boolish) -> untyped
22
-
23
- def self.relative?: () -> bool
24
-
25
- def self.relative_pos: () -> [Integer, Integer]
26
-
27
- def self.relative_state: () -> [Array[bool], Integer, Integer]
28
-
29
- def self.state: () -> [Array[bool], Integer, Integer]
30
-
31
- private
32
-
33
- def self.button_to_ary: (Integer num) -> ::Array[bool]
34
- end
35
- end
1
+ module SDLRuby
2
+ module Mouse
3
+ include SDL
4
+
5
+ def self.button: () -> Array[bool]
6
+
7
+ def self.capture=: (boolish) -> void
8
+
9
+ def self.global_button: () -> Array[bool]
10
+
11
+ def self.global_pos: () -> [Integer, Integer]
12
+
13
+ def self.global_pos=: ([Integer, Integer] xy) -> void
14
+
15
+ def self.global_state: () -> [Array[bool], Integer, Integer]
16
+
17
+ def self.pos: () -> [Integer, Integer]
18
+
19
+ def self.pos=: ([Integer, Integer] xy) -> void
20
+
21
+ def self.relative=: (boolish) -> untyped
22
+
23
+ def self.relative?: () -> bool
24
+
25
+ def self.relative_pos: () -> [Integer, Integer]
26
+
27
+ def self.relative_state: () -> [Array[bool], Integer, Integer]
28
+
29
+ def self.state: () -> [Array[bool], Integer, Integer]
30
+
31
+ private
32
+
33
+ def self.button_to_ary: (Integer num) -> ::Array[bool]
34
+ end
35
+ end