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,30 +1,30 @@
1
- module SDLRuby::SDL
2
- SDL_BLENDMODE_NONE = 0x00000000
3
- SDL_BLENDMODE_BLEND = 0x00000001
4
- SDL_BLENDMODE_ADD = 0x00000002
5
- SDL_BLENDMODE_MOD = 0x00000004
6
- SDL_BLENDMODE_MUL = 0x00000008
7
- SDL_BLENDMODE_INVALID = 0x7FFFFFFF
8
- typealias "SDL_BlendMode", "int"
9
-
10
- SDL_BLENDOPERATION_ADD = 0x1
11
- SDL_BLENDOPERATION_SUBTRACT = 0x2
12
- SDL_BLENDOPERATION_REV_SUBTRACT = 0x3
13
- SDL_BLENDOPERATION_MINIMUM = 0x4
14
- SDL_BLENDOPERATION_MAXIMUM = 0x5
15
- typealias "SDL_BlendOperation", "int"
16
-
17
- SDL_BLENDFACTOR_ZERO = 0x1
18
- SDL_BLENDFACTOR_ONE = 0x2
19
- SDL_BLENDFACTOR_SRC_COLOR = 0x3
20
- SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4
21
- SDL_BLENDFACTOR_SRC_ALPHA = 0x5
22
- SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6
23
- SDL_BLENDFACTOR_DST_COLOR = 0x7
24
- SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8
25
- SDL_BLENDFACTOR_DST_ALPHA = 0x9
26
- SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA
27
- typealias "SDL_BlendFactor", "int"
28
-
29
- extern "SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)"
30
- end
1
+ module SDLRuby::SDL
2
+ SDL_BLENDMODE_NONE = 0x00000000
3
+ SDL_BLENDMODE_BLEND = 0x00000001
4
+ SDL_BLENDMODE_ADD = 0x00000002
5
+ SDL_BLENDMODE_MOD = 0x00000004
6
+ SDL_BLENDMODE_MUL = 0x00000008
7
+ SDL_BLENDMODE_INVALID = 0x7FFFFFFF
8
+ typealias "SDL_BlendMode", "int"
9
+
10
+ SDL_BLENDOPERATION_ADD = 0x1
11
+ SDL_BLENDOPERATION_SUBTRACT = 0x2
12
+ SDL_BLENDOPERATION_REV_SUBTRACT = 0x3
13
+ SDL_BLENDOPERATION_MINIMUM = 0x4
14
+ SDL_BLENDOPERATION_MAXIMUM = 0x5
15
+ typealias "SDL_BlendOperation", "int"
16
+
17
+ SDL_BLENDFACTOR_ZERO = 0x1
18
+ SDL_BLENDFACTOR_ONE = 0x2
19
+ SDL_BLENDFACTOR_SRC_COLOR = 0x3
20
+ SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4
21
+ SDL_BLENDFACTOR_SRC_ALPHA = 0x5
22
+ SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6
23
+ SDL_BLENDFACTOR_DST_COLOR = 0x7
24
+ SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8
25
+ SDL_BLENDFACTOR_DST_ALPHA = 0x9
26
+ SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA
27
+ typealias "SDL_BlendFactor", "int"
28
+
29
+ extern "SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor, SDL_BlendOperation colorOperation, SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor, SDL_BlendOperation alphaOperation)"
30
+ end
@@ -1,10 +1,10 @@
1
- module SDLRuby::SDL
2
- require_relative 'SDL_stdinc.h.rb'
3
-
4
- extern "int SDL_SetClipboardText(const char *text)"
5
- extern "char * SDL_GetClipboardText(void)"
6
- extern "SDL_bool SDL_HasClipboardText(void)"
7
- extern "int SDL_SetPrimarySelectionText(const char *text)"
8
- extern "char * SDL_GetPrimarySelectionText(void)"
9
- extern "SDL_bool SDL_HasPrimarySelectionText(void)"
10
- end
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+
4
+ extern "int SDL_SetClipboardText(const char *text)"
5
+ extern "char * SDL_GetClipboardText(void)"
6
+ extern "SDL_bool SDL_HasClipboardText(void)"
7
+ extern "int SDL_SetPrimarySelectionText(const char *text)"
8
+ extern "char * SDL_GetPrimarySelectionText(void)"
9
+ extern "SDL_bool SDL_HasPrimarySelectionText(void)"
10
+ end
@@ -1,13 +1,13 @@
1
- module SDLRuby::SDL
2
- require_relative 'SDL_platform.h.rb'
3
- typealias "int8_t", "signed __int8"
4
- typealias "uint8_t", "unsigned __int8"
5
- typealias "int16_t", "signed __int16"
6
- typealias "uint16_t", "unsigned __int16"
7
- typealias "int32_t", "signed __int32"
8
- typealias "uint32_t", "unsigned __int32"
9
- typealias "int64_t", "signed __int64"
10
- typealias "uint64_t", "unsigned __int64"
11
- typealias "uintptr_t", "unsigned __int64"
12
- typealias "uintptr_t", "unsigned int"
13
- end
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_platform.h.rb'
3
+ typealias "int8_t", "signed __int8"
4
+ typealias "uint8_t", "unsigned __int8"
5
+ typealias "int16_t", "signed __int16"
6
+ typealias "uint16_t", "unsigned __int16"
7
+ typealias "int32_t", "signed __int32"
8
+ typealias "uint32_t", "unsigned __int32"
9
+ typealias "int64_t", "signed __int64"
10
+ typealias "uint64_t", "unsigned __int64"
11
+ typealias "uintptr_t", "unsigned __int64"
12
+ typealias "uintptr_t", "unsigned int"
13
+ end
@@ -1,27 +1,27 @@
1
- module SDLRuby::SDL
2
- require_relative 'SDL_stdinc.h.rb'
3
-
4
- extern "int SDL_GetCPUCount(void)"
5
- extern "int SDL_GetCPUCacheLineSize(void)"
6
- extern "SDL_bool SDL_HasRDTSC(void)"
7
- extern "SDL_bool SDL_HasAltiVec(void)"
8
- extern "SDL_bool SDL_HasMMX(void)"
9
- extern "SDL_bool SDL_Has3DNow(void)"
10
- extern "SDL_bool SDL_HasSSE(void)"
11
- extern "SDL_bool SDL_HasSSE2(void)"
12
- extern "SDL_bool SDL_HasSSE3(void)"
13
- extern "SDL_bool SDL_HasSSE41(void)"
14
- extern "SDL_bool SDL_HasSSE42(void)"
15
- extern "SDL_bool SDL_HasAVX(void)"
16
- extern "SDL_bool SDL_HasAVX2(void)"
17
- extern "SDL_bool SDL_HasAVX512F(void)"
18
- extern "SDL_bool SDL_HasARMSIMD(void)"
19
- extern "SDL_bool SDL_HasNEON(void)"
20
- extern "SDL_bool SDL_HasLSX(void)"
21
- extern "SDL_bool SDL_HasLASX(void)"
22
- extern "int SDL_GetSystemRAM(void)"
23
- extern "size_t SDL_SIMDGetAlignment(void)"
24
- extern "void * SDL_SIMDAlloc(const size_t len)"
25
- extern "void * SDL_SIMDRealloc(void *mem, const size_t len)"
26
- extern "void SDL_SIMDFree(void *ptr)"
27
- end
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+
4
+ extern "int SDL_GetCPUCount(void)"
5
+ extern "int SDL_GetCPUCacheLineSize(void)"
6
+ extern "SDL_bool SDL_HasRDTSC(void)"
7
+ extern "SDL_bool SDL_HasAltiVec(void)"
8
+ extern "SDL_bool SDL_HasMMX(void)"
9
+ extern "SDL_bool SDL_Has3DNow(void)"
10
+ extern "SDL_bool SDL_HasSSE(void)"
11
+ extern "SDL_bool SDL_HasSSE2(void)"
12
+ extern "SDL_bool SDL_HasSSE3(void)"
13
+ extern "SDL_bool SDL_HasSSE41(void)"
14
+ extern "SDL_bool SDL_HasSSE42(void)"
15
+ extern "SDL_bool SDL_HasAVX(void)"
16
+ extern "SDL_bool SDL_HasAVX2(void)"
17
+ extern "SDL_bool SDL_HasAVX512F(void)"
18
+ extern "SDL_bool SDL_HasARMSIMD(void)"
19
+ extern "SDL_bool SDL_HasNEON(void)"
20
+ extern "SDL_bool SDL_HasLSX(void)"
21
+ extern "SDL_bool SDL_HasLASX(void)"
22
+ extern "int SDL_GetSystemRAM(void)"
23
+ extern "size_t SDL_SIMDGetAlignment(void)"
24
+ extern "void * SDL_SIMDAlloc(const size_t len)"
25
+ extern "void * SDL_SIMDRealloc(void *mem, const size_t len)"
26
+ extern "void SDL_SIMDFree(void *ptr)"
27
+ end
@@ -1,12 +1,12 @@
1
- module SDLRuby::SDL
2
- require_relative "SDL_stdinc.h"
3
-
4
- SDL_LIL_ENDIAN = 1234
5
- SDL_BIG_ENDIAN = 4321
6
-
7
- if "\x01\x02\x03\x04".unpack("I") == 0x1020304
8
- SDL_BYTEORDER = SDL_BIG_ENDIAN
9
- else
10
- SDL_BYTEORDER = SDL_LIL_ENDIAN
11
- end
12
- end
1
+ module SDLRuby::SDL
2
+ require_relative "SDL_stdinc.h"
3
+
4
+ SDL_LIL_ENDIAN = 1234
5
+ SDL_BIG_ENDIAN = 4321
6
+
7
+ if "\x01\x02\x03\x04".unpack("I") == 0x1020304
8
+ SDL_BYTEORDER = SDL_BIG_ENDIAN
9
+ else
10
+ SDL_BYTEORDER = SDL_LIL_ENDIAN
11
+ end
12
+ end
@@ -1,28 +1,28 @@
1
- module SDLRuby::SDL
2
- require_relative "SDL_stdinc.h"
3
-
4
- extern "int SDL_SetError(const char *fmt, ...)"
5
- extern "const char * SDL_GetError(void)"
6
- extern "char * SDL_GetErrorMsg(char *errstr, int maxlen)"
7
- extern "void SDL_ClearError(void)"
8
-
9
- def self.SDL_OutOfMemory()
10
- SDL_Error(SDL_ENOMEM)
11
- end
12
- def self.SDL_Unsupported()
13
- SDL_Error(SDL_UNSUPPORTED)
14
- end
15
- def self.SDL_InvalidParamError(param)
16
- SDL_SetError("Parameter '%s' is invalid", (param))
17
- end
18
-
19
- SDL_ENOMEM = 0
20
- SDL_EFREAD = 1
21
- SDL_EFWRITE = 2
22
- SDL_EFSEEK = 3
23
- SDL_UNSUPPORTED = 4
24
- SDL_LASTERROR = 5
25
- typealias "SDL_errorcode", "int"
26
-
27
- extern "int SDL_Error(SDL_errorcode code)"
28
- end
1
+ module SDLRuby::SDL
2
+ require_relative "SDL_stdinc.h"
3
+
4
+ extern "int SDL_SetError(const char *fmt, ...)"
5
+ extern "const char * SDL_GetError(void)"
6
+ extern "char * SDL_GetErrorMsg(char *errstr, int maxlen)"
7
+ extern "void SDL_ClearError(void)"
8
+
9
+ def self.SDL_OutOfMemory()
10
+ SDL_Error(SDL_ENOMEM)
11
+ end
12
+ def self.SDL_Unsupported()
13
+ SDL_Error(SDL_UNSUPPORTED)
14
+ end
15
+ def self.SDL_InvalidParamError(param)
16
+ SDL_SetError("Parameter '%s' is invalid", (param))
17
+ end
18
+
19
+ SDL_ENOMEM = 0
20
+ SDL_EFREAD = 1
21
+ SDL_EFWRITE = 2
22
+ SDL_EFSEEK = 3
23
+ SDL_UNSUPPORTED = 4
24
+ SDL_LASTERROR = 5
25
+ typealias "SDL_errorcode", "int"
26
+
27
+ extern "int SDL_Error(SDL_errorcode code)"
28
+ end