SDLRuby 0.3.0 → 0.4.0

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 (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,58 +1,58 @@
1
- module SDLRuby::SDL
2
- require_relative "SDL_stdinc.h"
3
- require_relative "SDL_video.h"
4
-
5
- SDL_MESSAGEBOX_ERROR = 0x00000010
6
- SDL_MESSAGEBOX_WARNING = 0x00000020
7
- SDL_MESSAGEBOX_INFORMATION = 0x00000040
8
- SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080
9
- SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100
10
- typealias "SDL_MessageBoxFlags", "int"
11
-
12
- SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001
13
- SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002
14
- typealias "SDL_MessageBoxButtonFlags", "int"
15
-
16
- SDL_MessageBoxButtonData = struct(
17
- [
18
- "Uint32 flags",
19
- "int buttonid",
20
- "const char * text",
21
- ]
22
- )
23
- SDL_MessageBoxColor = struct(
24
- [
25
- "Uint8 r",
26
- "Uint8 g",
27
- "Uint8 b",
28
- ]
29
- )
30
-
31
- SDL_MESSAGEBOX_COLOR_BACKGROUND = 0
32
- SDL_MESSAGEBOX_COLOR_TEXT = 1
33
- SDL_MESSAGEBOX_COLOR_BUTTON_BORDER = 2
34
- SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND = 3
35
- SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED = 4
36
- SDL_MESSAGEBOX_COLOR_MAX = 5
37
- typealias "SDL_MessageBoxColorType", "int"
38
-
39
- SDL_MessageBoxColorScheme = struct(
40
- [
41
- "colors[#{SDL_MESSAGEBOX_COLOR_MAX}]": SDL_MessageBoxColor
42
- ]
43
- )
44
- SDL_MessageBoxData = struct(
45
- [
46
- "Uint32 flags",
47
- "SDL_Window *window",
48
- "const char *title",
49
- "const char *message",
50
- "int numbuttons",
51
- "const SDL_MessageBoxButtonData *buttons",
52
- "const SDL_MessageBoxColorScheme *colorScheme",
53
- ]
54
- )
55
-
56
- extern "int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)"
57
- extern "int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window)"
58
- end
1
+ module SDLRuby::SDL
2
+ require_relative "SDL_stdinc.h"
3
+ require_relative "SDL_video.h"
4
+
5
+ SDL_MESSAGEBOX_ERROR = 0x00000010
6
+ SDL_MESSAGEBOX_WARNING = 0x00000020
7
+ SDL_MESSAGEBOX_INFORMATION = 0x00000040
8
+ SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080
9
+ SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100
10
+ typealias "SDL_MessageBoxFlags", "int"
11
+
12
+ SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001
13
+ SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002
14
+ typealias "SDL_MessageBoxButtonFlags", "int"
15
+
16
+ SDL_MessageBoxButtonData = struct(
17
+ [
18
+ "Uint32 flags",
19
+ "int buttonid",
20
+ "const char * text",
21
+ ]
22
+ )
23
+ SDL_MessageBoxColor = struct(
24
+ [
25
+ "Uint8 r",
26
+ "Uint8 g",
27
+ "Uint8 b",
28
+ ]
29
+ )
30
+
31
+ SDL_MESSAGEBOX_COLOR_BACKGROUND = 0
32
+ SDL_MESSAGEBOX_COLOR_TEXT = 1
33
+ SDL_MESSAGEBOX_COLOR_BUTTON_BORDER = 2
34
+ SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND = 3
35
+ SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED = 4
36
+ SDL_MESSAGEBOX_COLOR_MAX = 5
37
+ typealias "SDL_MessageBoxColorType", "int"
38
+
39
+ SDL_MessageBoxColorScheme = struct(
40
+ [
41
+ "colors[#{SDL_MESSAGEBOX_COLOR_MAX}]": SDL_MessageBoxColor
42
+ ]
43
+ )
44
+ SDL_MessageBoxData = struct(
45
+ [
46
+ "Uint32 flags",
47
+ "SDL_Window *window",
48
+ "const char *title",
49
+ "const char *message",
50
+ "int numbuttons",
51
+ "const SDL_MessageBoxButtonData *buttons",
52
+ "const SDL_MessageBoxColorScheme *colorScheme",
53
+ ]
54
+ )
55
+
56
+ extern "int SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)"
57
+ extern "int SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window)"
58
+ end
@@ -1,5 +1,5 @@
1
- module SDLRuby::SDL
2
- require_relative 'SDL_stdinc.h.rb'
3
-
4
- extern "int SDL_OpenURL(const char *url)"
5
- end
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+
4
+ extern "int SDL_OpenURL(const char *url)"
5
+ end
@@ -1,57 +1,57 @@
1
- module SDLRuby::SDL
2
- require_relative "SDL_stdinc.h"
3
- require_relative "SDL_error.h"
4
- require_relative "SDL_video.h"
5
-
6
- SDL_SYSTEM_CURSOR_ARROW = 0
7
- SDL_SYSTEM_CURSOR_IBEAM = 1
8
- SDL_SYSTEM_CURSOR_WAIT = 2
9
- SDL_SYSTEM_CURSOR_CROSSHAIR = 3
10
- SDL_SYSTEM_CURSOR_WAITARROW = 4
11
- SDL_SYSTEM_CURSOR_SIZENWSE = 5
12
- SDL_SYSTEM_CURSOR_SIZENESW = 6
13
- SDL_SYSTEM_CURSOR_SIZEWE = 7
14
- SDL_SYSTEM_CURSOR_SIZENS = 8
15
- SDL_SYSTEM_CURSOR_SIZEALL = 9
16
- SDL_SYSTEM_CURSOR_NO = 10
17
- SDL_SYSTEM_CURSOR_HAND = 11
18
- SDL_NUM_SYSTEM_CURSORS = 12
19
- typealias "SDL_SystemCursor", "int"
20
-
21
- SDL_MOUSEWHEEL_NORMAL = 0
22
- SDL_MOUSEWHEEL_FLIPPED = 1
23
- typealias "SDL_MouseWheelDirection", "int"
24
-
25
- extern "SDL_Window * SDL_GetMouseFocus(void)"
26
- extern "Uint32 SDL_GetMouseState(int *x, int *y)"
27
- extern "Uint32 SDL_GetGlobalMouseState(int *x, int *y)"
28
- extern "Uint32 SDL_GetRelativeMouseState(int *x, int *y)"
29
- extern "void SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)"
30
- extern "int SDL_WarpMouseGlobal(int x, int y)"
31
- extern "int SDL_SetRelativeMouseMode(SDL_bool enabled)"
32
- extern "int SDL_CaptureMouse(SDL_bool enabled)"
33
- extern "SDL_bool SDL_GetRelativeMouseMode(void)"
34
- extern "SDL_Cursor * SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y)"
35
- extern "SDL_Cursor * SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)"
36
- extern "SDL_Cursor * SDL_CreateSystemCursor(SDL_SystemCursor id)"
37
- extern "void SDL_SetCursor(SDL_Cursor * cursor)"
38
- extern "SDL_Cursor * SDL_GetCursor(void)"
39
- extern "SDL_Cursor * SDL_GetDefaultCursor(void)"
40
- extern "void SDL_FreeCursor(SDL_Cursor * cursor)"
41
- extern "int SDL_ShowCursor(int toggle)"
42
-
43
- def self.SDL_BUTTON(x)
44
- (1 << ((x)-1))
45
- end
46
-
47
- SDL_BUTTON_LEFT = 1
48
- SDL_BUTTON_MIDDLE = 2
49
- SDL_BUTTON_RIGHT = 3
50
- SDL_BUTTON_X1 = 4
51
- SDL_BUTTON_X2 = 5
52
- SDL_BUTTON_LMASK = SDL_BUTTON(SDL_BUTTON_LEFT)
53
- SDL_BUTTON_MMASK = SDL_BUTTON(SDL_BUTTON_MIDDLE)
54
- SDL_BUTTON_RMASK = SDL_BUTTON(SDL_BUTTON_RIGHT)
55
- SDL_BUTTON_X1MASK = SDL_BUTTON(SDL_BUTTON_X1)
56
- SDL_BUTTON_X2MASK = SDL_BUTTON(SDL_BUTTON_X2)
57
- end
1
+ module SDLRuby::SDL
2
+ require_relative "SDL_stdinc.h"
3
+ require_relative "SDL_error.h"
4
+ require_relative "SDL_video.h"
5
+
6
+ SDL_SYSTEM_CURSOR_ARROW = 0
7
+ SDL_SYSTEM_CURSOR_IBEAM = 1
8
+ SDL_SYSTEM_CURSOR_WAIT = 2
9
+ SDL_SYSTEM_CURSOR_CROSSHAIR = 3
10
+ SDL_SYSTEM_CURSOR_WAITARROW = 4
11
+ SDL_SYSTEM_CURSOR_SIZENWSE = 5
12
+ SDL_SYSTEM_CURSOR_SIZENESW = 6
13
+ SDL_SYSTEM_CURSOR_SIZEWE = 7
14
+ SDL_SYSTEM_CURSOR_SIZENS = 8
15
+ SDL_SYSTEM_CURSOR_SIZEALL = 9
16
+ SDL_SYSTEM_CURSOR_NO = 10
17
+ SDL_SYSTEM_CURSOR_HAND = 11
18
+ SDL_NUM_SYSTEM_CURSORS = 12
19
+ typealias "SDL_SystemCursor", "int"
20
+
21
+ SDL_MOUSEWHEEL_NORMAL = 0
22
+ SDL_MOUSEWHEEL_FLIPPED = 1
23
+ typealias "SDL_MouseWheelDirection", "int"
24
+
25
+ extern "SDL_Window * SDL_GetMouseFocus(void)"
26
+ extern "Uint32 SDL_GetMouseState(int *x, int *y)"
27
+ extern "Uint32 SDL_GetGlobalMouseState(int *x, int *y)"
28
+ extern "Uint32 SDL_GetRelativeMouseState(int *x, int *y)"
29
+ extern "void SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)"
30
+ extern "int SDL_WarpMouseGlobal(int x, int y)"
31
+ extern "int SDL_SetRelativeMouseMode(SDL_bool enabled)"
32
+ extern "int SDL_CaptureMouse(SDL_bool enabled)"
33
+ extern "SDL_bool SDL_GetRelativeMouseMode(void)"
34
+ extern "SDL_Cursor * SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y)"
35
+ extern "SDL_Cursor * SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)"
36
+ extern "SDL_Cursor * SDL_CreateSystemCursor(SDL_SystemCursor id)"
37
+ extern "void SDL_SetCursor(SDL_Cursor * cursor)"
38
+ extern "SDL_Cursor * SDL_GetCursor(void)"
39
+ extern "SDL_Cursor * SDL_GetDefaultCursor(void)"
40
+ extern "void SDL_FreeCursor(SDL_Cursor * cursor)"
41
+ extern "int SDL_ShowCursor(int toggle)"
42
+
43
+ def self.SDL_BUTTON(x)
44
+ (1 << ((x)-1))
45
+ end
46
+
47
+ SDL_BUTTON_LEFT = 1
48
+ SDL_BUTTON_MIDDLE = 2
49
+ SDL_BUTTON_RIGHT = 3
50
+ SDL_BUTTON_X1 = 4
51
+ SDL_BUTTON_X2 = 5
52
+ SDL_BUTTON_LMASK = SDL_BUTTON(SDL_BUTTON_LEFT)
53
+ SDL_BUTTON_MMASK = SDL_BUTTON(SDL_BUTTON_MIDDLE)
54
+ SDL_BUTTON_RMASK = SDL_BUTTON(SDL_BUTTON_RIGHT)
55
+ SDL_BUTTON_X1MASK = SDL_BUTTON(SDL_BUTTON_X1)
56
+ SDL_BUTTON_X2MASK = SDL_BUTTON(SDL_BUTTON_X2)
57
+ end