SDLRuby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/LICENSE.txt +21 -0
  4. data/README.md +31 -0
  5. data/Rakefile +12 -0
  6. data/lib/SDLRuby/audio.rb +65 -0
  7. data/lib/SDLRuby/cursor.rb +46 -0
  8. data/lib/SDLRuby/display.rb +79 -0
  9. data/lib/SDLRuby/event/accessor.rb +127 -0
  10. data/lib/SDLRuby/event/type.rb +75 -0
  11. data/lib/SDLRuby/event.rb +80 -0
  12. data/lib/SDLRuby/font.rb +227 -0
  13. data/lib/SDLRuby/hint.rb +36 -0
  14. data/lib/SDLRuby/image/image.rb +23 -0
  15. data/lib/SDLRuby/image/include/SDL_image.h.rb +61 -0
  16. data/lib/SDLRuby/image.rb +69 -0
  17. data/lib/SDLRuby/keyboard.rb +58 -0
  18. data/lib/SDLRuby/mixer/channel.rb +43 -0
  19. data/lib/SDLRuby/mixer/chunk.rb +49 -0
  20. data/lib/SDLRuby/mixer/controller.rb +44 -0
  21. data/lib/SDLRuby/mixer/include/SDL_mixer.h.rb +95 -0
  22. data/lib/SDLRuby/mixer/sdl_mixer.rb +60 -0
  23. data/lib/SDLRuby/mixer.rb +87 -0
  24. data/lib/SDLRuby/mouse.rb +52 -0
  25. data/lib/SDLRuby/music.rb +158 -0
  26. data/lib/SDLRuby/palette.rb +49 -0
  27. data/lib/SDLRuby/pixel_formatter.rb +67 -0
  28. data/lib/SDLRuby/rect.rb +11 -0
  29. data/lib/SDLRuby/renderer/accessor.rb +70 -0
  30. data/lib/SDLRuby/renderer/drawer.rb +107 -0
  31. data/lib/SDLRuby/renderer/renderer_info.rb +27 -0
  32. data/lib/SDLRuby/renderer.rb +101 -0
  33. data/lib/SDLRuby/rw_ops/rw_object.rb +128 -0
  34. data/lib/SDLRuby/rw_ops.rb +216 -0
  35. data/lib/SDLRuby/sdl/include/SDL.h.rb +33 -0
  36. data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +49 -0
  37. data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +6 -0
  38. data/lib/SDLRuby/sdl/include/SDL_clipboard.h.rb +10 -0
  39. data/lib/SDLRuby/sdl/include/SDL_config.h.rb +13 -0
  40. data/lib/SDLRuby/sdl/include/SDL_cpuinfo.h.rb +27 -0
  41. data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +3 -0
  42. data/lib/SDLRuby/sdl/include/SDL_error.h.rb +9 -0
  43. data/lib/SDLRuby/sdl/include/SDL_events.h.rb +32 -0
  44. data/lib/SDLRuby/sdl/include/SDL_filesystem.h.rb +6 -0
  45. data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +66 -0
  46. data/lib/SDLRuby/sdl/include/SDL_gesture.h.rb +12 -0
  47. data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +7 -0
  48. data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +14 -0
  49. data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +69 -0
  50. data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +26 -0
  51. data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +7 -0
  52. data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +6 -0
  53. data/lib/SDLRuby/sdl/include/SDL_main.h.rb +3 -0
  54. data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +10 -0
  55. data/lib/SDLRuby/sdl/include/SDL_misc.h.rb +5 -0
  56. data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +26 -0
  57. data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +25 -0
  58. data/lib/SDLRuby/sdl/include/SDL_platform.h.rb +3 -0
  59. data/lib/SDLRuby/sdl/include/SDL_power.h.rb +6 -0
  60. data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +17 -0
  61. data/lib/SDLRuby/sdl/include/SDL_render.h.rb +94 -0
  62. data/lib/SDLRuby/sdl/include/SDL_revision.h.rb +2 -0
  63. data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +34 -0
  64. data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +5 -0
  65. data/lib/SDLRuby/sdl/include/SDL_sensor.h.rb +25 -0
  66. data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +13 -0
  67. data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +24 -0
  68. data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +37 -0
  69. data/lib/SDLRuby/sdl/include/SDL_system.h.rb +6 -0
  70. data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +16 -0
  71. data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +13 -0
  72. data/lib/SDLRuby/sdl/include/SDL_touch.h.rb +15 -0
  73. data/lib/SDLRuby/sdl/include/SDL_types.h.rb +3 -0
  74. data/lib/SDLRuby/sdl/include/SDL_version.h.rb +6 -0
  75. data/lib/SDLRuby/sdl/include/SDL_video.h.rb +117 -0
  76. data/lib/SDLRuby/sdl/sdl.rb +55 -0
  77. data/lib/SDLRuby/sdl/sdl_audio.rb +75 -0
  78. data/lib/SDLRuby/sdl/sdl_blendmode.rb +10 -0
  79. data/lib/SDLRuby/sdl/sdl_error.rb +5 -0
  80. data/lib/SDLRuby/sdl/sdl_events.rb +470 -0
  81. data/lib/SDLRuby/sdl/sdl_hints.rb +9 -0
  82. data/lib/SDLRuby/sdl/sdl_keyboard.rb +12 -0
  83. data/lib/SDLRuby/sdl/sdl_locale.rb +8 -0
  84. data/lib/SDLRuby/sdl/sdl_message_box.rb +7 -0
  85. data/lib/SDLRuby/sdl/sdl_mouse.rb +32 -0
  86. data/lib/SDLRuby/sdl/sdl_palette.rb +12 -0
  87. data/lib/SDLRuby/sdl/sdl_pixels.rb +138 -0
  88. data/lib/SDLRuby/sdl/sdl_rect.rb +11 -0
  89. data/lib/SDLRuby/sdl/sdl_render.rb +35 -0
  90. data/lib/SDLRuby/sdl/sdl_rw_ops.rb +29 -0
  91. data/lib/SDLRuby/sdl/sdl_scancode.rb +255 -0
  92. data/lib/SDLRuby/sdl/sdl_surface.rb +27 -0
  93. data/lib/SDLRuby/sdl/sdl_version.rb +5 -0
  94. data/lib/SDLRuby/sdl/sdl_video.rb +104 -0
  95. data/lib/SDLRuby/sdl.rb +192 -0
  96. data/lib/SDLRuby/sdl_error.rb +8 -0
  97. data/lib/SDLRuby/surface/pixel_format.rb +51 -0
  98. data/lib/SDLRuby/surface/surface_renderer.rb +26 -0
  99. data/lib/SDLRuby/surface.rb +179 -0
  100. data/lib/SDLRuby/text_input.rb +38 -0
  101. data/lib/SDLRuby/texture.rb +93 -0
  102. data/lib/SDLRuby/ttf/include/SDL_ttf.h.rb +54 -0
  103. data/lib/SDLRuby/ttf/ttf.rb +41 -0
  104. data/lib/SDLRuby/ttf.rb +54 -0
  105. data/lib/SDLRuby/version.rb +5 -0
  106. data/lib/SDLRuby/window/accessor.rb +125 -0
  107. data/lib/SDLRuby/window/controller.rb +53 -0
  108. data/lib/SDLRuby/window/display_info.rb +48 -0
  109. data/lib/SDLRuby/window/flag.rb +42 -0
  110. data/lib/SDLRuby/window/hit_tester.rb +61 -0
  111. data/lib/SDLRuby/window/input.rb +68 -0
  112. data/lib/SDLRuby/window/shaper.rb +68 -0
  113. data/lib/SDLRuby/window/surfacer.rb +37 -0
  114. data/lib/SDLRuby/window/window_renderer.rb +31 -0
  115. data/lib/SDLRuby/window.rb +90 -0
  116. data/lib/SDLRuby.rb +16 -0
  117. data/sig/SDLRuby/event.rbs +104 -0
  118. data/sig/SDLRuby/pixel_formmater.rbs +24 -0
  119. data/sig/SDLRuby/rect.rbs +5 -0
  120. data/sig/SDLRuby/sdl.rbs +606 -0
  121. data/sig/SDLRuby.rbs +4 -0
  122. metadata +168 -0
@@ -0,0 +1,37 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_pixels.h.rb'
4
+ require_relative 'SDL_rect.h.rb'
5
+ require_relative 'SDL_blendmode.h.rb'
6
+ require_relative 'SDL_rwops.h.rb'
7
+
8
+ typealias "SDL_BlitMap", "struct SDL_BlitMap"
9
+ typealias "SDL_YUV_CONVERSION_MODE", "int"
10
+ extern "SDL_Surface * SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)"
11
+ extern "void SDL_FreeSurface(SDL_Surface *surface)"
12
+ extern "int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)"
13
+ extern "int SDL_LockSurface(SDL_Surface *surface)"
14
+ extern "void SDL_UnlockSurface(SDL_Surface *surface)"
15
+ extern "SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, int freesrc)"
16
+ extern "int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)"
17
+ extern "SDL_bool SDL_HasSurfaceRLE(SDL_Surface *surface)"
18
+ extern "int SDL_SetColorKey(SDL_Surface *surface, int flag, Uint32 key)"
19
+ extern "SDL_bool SDL_HasColorKey(SDL_Surface *surface)"
20
+ extern "int SDL_GetColorKey(SDL_Surface *surface, Uint32 *key)"
21
+ extern "int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b)"
22
+ extern "int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b)"
23
+ extern "int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha)"
24
+ extern "int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha)"
25
+ extern "int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode)"
26
+ extern "int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)"
27
+ extern "SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)"
28
+ extern "void SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)"
29
+ extern "SDL_Surface * SDL_DuplicateSurface(SDL_Surface *surface)"
30
+ extern "int SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)"
31
+ extern "int SDL_PremultiplyAlpha(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)"
32
+ extern "int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect)"
33
+ extern "int SDL_SoftStretchLinear(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect)"
34
+ extern "void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)"
35
+ extern "SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void)"
36
+ extern "SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)"
37
+ end
@@ -0,0 +1,6 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_keyboard.h.rb'
4
+ require_relative 'SDL_render.h.rb'
5
+ require_relative 'SDL_video.h.rb'
6
+ end
@@ -0,0 +1,16 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_error.h.rb'
4
+ require_relative 'SDL_video.h.rb'
5
+ require_relative 'SDL_version.h.rb'
6
+
7
+ typealias "NSWindow", "struct _NSWindow"
8
+ typealias "UIWindow", "struct _UIWindow"
9
+ typealias "UIViewController", "struct _UIViewController"
10
+ typealias "GLuint", "Uint32"
11
+ typealias "ANativeWindow", "struct ANativeWindow"
12
+ typealias "EGLSurface", "void*"
13
+ typealias "SDL_SysWMinfo", "struct SDL_SysWMinfo"
14
+ typealias "SDL_SYSWM_TYPE", "int"
15
+ extern "SDL_bool SDL_GetWindowWMInfo(SDL_Window *window, SDL_SysWMinfo *info)"
16
+ end
@@ -0,0 +1,13 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_error.h.rb'
4
+
5
+ typealias "SDL_TimerID", "int"
6
+ extern "Uint32 SDL_GetTicks(void)"
7
+ extern "Uint64 SDL_GetTicks64(void)"
8
+ extern "Uint64 SDL_GetPerformanceCounter(void)"
9
+ extern "Uint64 SDL_GetPerformanceFrequency(void)"
10
+ extern "void SDL_Delay(Uint32 ms)"
11
+ extern "SDL_TimerID SDL_AddTimer(Uint32 interval, SDL_TimerCallback callback, void *param)"
12
+ extern "SDL_bool SDL_RemoveTimer(SDL_TimerID id)"
13
+ end
@@ -0,0 +1,15 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_error.h.rb'
4
+ require_relative 'SDL_video.h.rb'
5
+
6
+ typealias "SDL_TouchID", "Sint64"
7
+ typealias "SDL_FingerID", "Sint64"
8
+ typealias "SDL_TouchDeviceType", "int"
9
+ extern "int SDL_GetNumTouchDevices(void)"
10
+ extern "SDL_TouchID SDL_GetTouchDevice(int index)"
11
+ extern "const char* SDL_GetTouchName(int index)"
12
+ extern "SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID touchID)"
13
+ extern "int SDL_GetNumTouchFingers(SDL_TouchID touchID)"
14
+ extern "SDL_Finger * SDL_GetTouchFinger(SDL_TouchID touchID, int index)"
15
+ end
@@ -0,0 +1,3 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ end
@@ -0,0 +1,6 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+
4
+ extern "void SDL_GetVersion(SDL_version *ver)"
5
+ extern "const char * SDL_GetRevision(void)"
6
+ end
@@ -0,0 +1,117 @@
1
+ module SDLRuby::SDL
2
+ require_relative 'SDL_stdinc.h.rb'
3
+ require_relative 'SDL_pixels.h.rb'
4
+ require_relative 'SDL_rect.h.rb'
5
+ require_relative 'SDL_surface.h.rb'
6
+
7
+ typealias "SDL_Window", "struct SDL_Window"
8
+ typealias "SDL_GLContext", "void*"
9
+ typealias "SDL_WindowFlags", "int"
10
+ typealias "SDL_WindowEventID", "int"
11
+ typealias "SDL_DisplayEventID", "int"
12
+ typealias "SDL_DisplayOrientation", "int"
13
+ typealias "SDL_FlashOperation", "int"
14
+ typealias "SDL_GLattr", "int"
15
+ typealias "SDL_GLprofile", "int"
16
+ typealias "SDL_GLcontextFlag", "int"
17
+ typealias "SDL_GLcontextReleaseFlag", "int"
18
+ typealias "SDL_GLContextResetNotification", "int"
19
+ typealias "SDL_HitTestResult", "int"
20
+ extern "int SDL_GetNumVideoDrivers(void)"
21
+ extern "const char * SDL_GetVideoDriver(int index)"
22
+ extern "int SDL_VideoInit(const char *driver_name)"
23
+ extern "void SDL_VideoQuit(void)"
24
+ extern "const char * SDL_GetCurrentVideoDriver(void)"
25
+ extern "int SDL_GetNumVideoDisplays(void)"
26
+ extern "const char * SDL_GetDisplayName(int displayIndex)"
27
+ extern "int SDL_GetDisplayBounds(int displayIndex, SDL_Rect *rect)"
28
+ extern "int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect *rect)"
29
+ extern "int SDL_GetDisplayDPI(int displayIndex, float *ddpi, float *hdpi, float *vdpi)"
30
+ extern "SDL_DisplayOrientation SDL_GetDisplayOrientation(int displayIndex)"
31
+ extern "int SDL_GetNumDisplayModes(int displayIndex)"
32
+ extern "int SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode *mode)"
33
+ extern "int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode *mode)"
34
+ extern "int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode *mode)"
35
+ extern "SDL_DisplayMode * SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode *mode, SDL_DisplayMode *closest)"
36
+ extern "int SDL_GetPointDisplayIndex(const SDL_Point *point)"
37
+ extern "int SDL_GetRectDisplayIndex(const SDL_Rect *rect)"
38
+ extern "int SDL_GetWindowDisplayIndex(SDL_Window *window)"
39
+ extern "int SDL_SetWindowDisplayMode(SDL_Window *window, const SDL_DisplayMode *mode)"
40
+ extern "int SDL_GetWindowDisplayMode(SDL_Window *window, SDL_DisplayMode *mode)"
41
+ extern "void* SDL_GetWindowICCProfile(SDL_Window *window, size_t*size)"
42
+ extern "Uint32 SDL_GetWindowPixelFormat(SDL_Window *window)"
43
+ extern "SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)"
44
+ extern "SDL_Window * SDL_CreateWindowFrom(const void *data)"
45
+ extern "Uint32 SDL_GetWindowID(SDL_Window *window)"
46
+ extern "SDL_Window * SDL_GetWindowFromID(Uint32 id)"
47
+ extern "Uint32 SDL_GetWindowFlags(SDL_Window *window)"
48
+ extern "void SDL_SetWindowTitle(SDL_Window *window, const char *title)"
49
+ extern "const char * SDL_GetWindowTitle(SDL_Window *window)"
50
+ extern "void SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon)"
51
+ extern "void* SDL_SetWindowData(SDL_Window *window, const char *name, void *userdata)"
52
+ extern "void * SDL_GetWindowData(SDL_Window *window, const char *name)"
53
+ extern "void SDL_SetWindowPosition(SDL_Window *window, int x, int y)"
54
+ extern "void SDL_GetWindowPosition(SDL_Window *window, int *x, int *y)"
55
+ extern "void SDL_SetWindowSize(SDL_Window *window, int w, int h)"
56
+ extern "void SDL_GetWindowSize(SDL_Window *window, int *w, int *h)"
57
+ extern "int SDL_GetWindowBordersSize(SDL_Window *window, int *top, int *left, int *bottom, int *right)"
58
+ extern "void SDL_GetWindowSizeInPixels(SDL_Window *window, int *w, int *h)"
59
+ extern "void SDL_SetWindowMinimumSize(SDL_Window *window, int min_w, int min_h)"
60
+ extern "void SDL_GetWindowMinimumSize(SDL_Window *window, int *w, int *h)"
61
+ extern "void SDL_SetWindowMaximumSize(SDL_Window *window, int max_w, int max_h)"
62
+ extern "void SDL_GetWindowMaximumSize(SDL_Window *window, int *w, int *h)"
63
+ extern "void SDL_SetWindowBordered(SDL_Window *window, SDL_bool bordered)"
64
+ extern "void SDL_SetWindowResizable(SDL_Window *window, SDL_bool resizable)"
65
+ extern "void SDL_SetWindowAlwaysOnTop(SDL_Window *window, SDL_bool on_top)"
66
+ extern "void SDL_ShowWindow(SDL_Window *window)"
67
+ extern "void SDL_HideWindow(SDL_Window *window)"
68
+ extern "void SDL_RaiseWindow(SDL_Window *window)"
69
+ extern "void SDL_MaximizeWindow(SDL_Window *window)"
70
+ extern "void SDL_MinimizeWindow(SDL_Window *window)"
71
+ extern "void SDL_RestoreWindow(SDL_Window *window)"
72
+ extern "int SDL_SetWindowFullscreen(SDL_Window *window, Uint32 flags)"
73
+ extern "SDL_bool SDL_HasWindowSurface(SDL_Window *window)"
74
+ extern "SDL_Surface * SDL_GetWindowSurface(SDL_Window *window)"
75
+ extern "int SDL_UpdateWindowSurface(SDL_Window *window)"
76
+ extern "int SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, int numrects)"
77
+ extern "int SDL_DestroyWindowSurface(SDL_Window *window)"
78
+ extern "void SDL_SetWindowGrab(SDL_Window *window, SDL_bool grabbed)"
79
+ extern "void SDL_SetWindowKeyboardGrab(SDL_Window *window, SDL_bool grabbed)"
80
+ extern "void SDL_SetWindowMouseGrab(SDL_Window *window, SDL_bool grabbed)"
81
+ extern "SDL_bool SDL_GetWindowGrab(SDL_Window *window)"
82
+ extern "SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window *window)"
83
+ extern "SDL_bool SDL_GetWindowMouseGrab(SDL_Window *window)"
84
+ extern "SDL_Window * SDL_GetGrabbedWindow(void)"
85
+ extern "int SDL_SetWindowMouseRect(SDL_Window *window, const SDL_Rect *rect)"
86
+ extern "const SDL_Rect * SDL_GetWindowMouseRect(SDL_Window *window)"
87
+ extern "int SDL_SetWindowBrightness(SDL_Window *window, float brightness)"
88
+ extern "float SDL_GetWindowBrightness(SDL_Window *window)"
89
+ extern "int SDL_SetWindowOpacity(SDL_Window *window, float opacity)"
90
+ extern "int SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity)"
91
+ extern "int SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window)"
92
+ extern "int SDL_SetWindowInputFocus(SDL_Window *window)"
93
+ extern "int SDL_SetWindowGammaRamp(SDL_Window *window, const Uint16 *red, const Uint16 *green, const Uint16 *blue)"
94
+ extern "int SDL_GetWindowGammaRamp(SDL_Window *window, Uint16 *red, Uint16 *green, Uint16 *blue)"
95
+ extern "int SDL_SetWindowHitTest(SDL_Window *window, SDL_HitTest callback, void *callback_data)"
96
+ extern "int SDL_FlashWindow(SDL_Window *window, SDL_FlashOperation operation)"
97
+ extern "void SDL_DestroyWindow(SDL_Window *window)"
98
+ extern "SDL_bool SDL_IsScreenSaverEnabled(void)"
99
+ extern "void SDL_EnableScreenSaver(void)"
100
+ extern "void SDL_DisableScreenSaver(void)"
101
+ extern "int SDL_GL_LoadLibrary(const char *path)"
102
+ extern "void * SDL_GL_GetProcAddress(const char *proc)"
103
+ extern "void SDL_GL_UnloadLibrary(void)"
104
+ extern "SDL_bool SDL_GL_ExtensionSupported(const char *extension)"
105
+ extern "void SDL_GL_ResetAttributes(void)"
106
+ extern "int SDL_GL_SetAttribute(SDL_GLattr attr, int value)"
107
+ extern "int SDL_GL_GetAttribute(SDL_GLattr attr, int *value)"
108
+ extern "SDL_GLContext SDL_GL_CreateContext(SDL_Window *window)"
109
+ extern "int SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context)"
110
+ extern "SDL_Window* SDL_GL_GetCurrentWindow(void)"
111
+ extern "SDL_GLContext SDL_GL_GetCurrentContext(void)"
112
+ extern "void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h)"
113
+ extern "int SDL_GL_SetSwapInterval(int interval)"
114
+ extern "int SDL_GL_GetSwapInterval(void)"
115
+ extern "void SDL_GL_SwapWindow(SDL_Window *window)"
116
+ extern "void SDL_GL_DeleteContext(SDL_GLContext context)"
117
+ end
@@ -0,0 +1,55 @@
1
+ module SDLRuby
2
+ module SDL
3
+ # struct
4
+ #
5
+ typealias "SDL_GUID", "void*"
6
+ typealias "SDL_GameControllerButtonBind", "void*"
7
+
8
+ # function ptr
9
+ #
10
+ typealias "SDL_EventFilter", "void*"
11
+ typealias "SDL_HintCallback", "void*"
12
+ typealias "SDL_HitTest", "void*"
13
+ typealias "SDL_TimerCallback", "void*"
14
+ typealias "SDL_WindowsMessageHook", "void*"
15
+ typealias "SDL_calloc_func", "void*"
16
+ typealias "SDL_free_func", "void*"
17
+ typealias "SDL_joystick_lock", "void*"
18
+ typealias "SDL_main_func", "void*"
19
+ typealias "SDL_malloc_func", "void*"
20
+ typealias "SDL_realloc_func", "void*"
21
+
22
+ require_relative 'include/SDL.h.rb'
23
+
24
+ require_relative 'sdl_audio'
25
+ require_relative 'sdl_blendmode'
26
+ require_relative 'sdl_error'
27
+ require_relative 'sdl_events'
28
+ require_relative 'sdl_hints'
29
+ require_relative 'sdl_keyboard'
30
+ require_relative 'sdl_locale'
31
+ require_relative 'sdl_message_box'
32
+ require_relative 'sdl_mouse'
33
+ require_relative 'sdl_palette'
34
+ require_relative 'sdl_pixels'
35
+ require_relative 'sdl_rect'
36
+ require_relative 'sdl_render'
37
+ require_relative 'sdl_rw_ops'
38
+ require_relative 'sdl_scancode'
39
+ require_relative 'sdl_surface'
40
+ require_relative 'sdl_version'
41
+ require_relative 'sdl_video'
42
+
43
+ SDL_INIT_TIMER = 0x00000001
44
+ SDL_INIT_AUDIO = 0x00000010
45
+ SDL_INIT_VIDEO = 0x00000020
46
+ SDL_INIT_JOYSTICK = 0x00000200
47
+ SDL_INIT_HAPTIC = 0x00001000
48
+ SDL_INIT_GAMEPAD = 0x00002000
49
+ SDL_INIT_EVENTS = 0x00004000
50
+ SDL_INIT_SENSOR = 0x00008000
51
+ SDL_INIT_EVERYTHING =
52
+ SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS |
53
+ SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMEPAD | SDL_INIT_SENSOR
54
+ end
55
+ end
@@ -0,0 +1,75 @@
1
+ module SDLRuby
2
+ module SDL
3
+ # SDL_AUDIO_MASK_BITSIZE = (0xFF)
4
+ # SDL_AUDIO_MASK_DATATYPE = (1<<8)
5
+ # SDL_AUDIO_MASK_ENDIAN = (1<<12)
6
+ # SDL_AUDIO_MASK_SIGNED = (1<<15)
7
+ # SDL_AUDIO_BITSIZE(x) = (x & SDL_AUDIO_MASK_BITSIZE)
8
+ # SDL_AUDIO_ISFLOAT(x) = (x & SDL_AUDIO_MASK_DATATYPE)
9
+ # SDL_AUDIO_ISBIGENDIAN(x) = (x & SDL_AUDIO_MASK_ENDIAN)
10
+ # SDL_AUDIO_ISSIGNED(x) = (x & SDL_AUDIO_MASK_SIGNED)
11
+ # SDL_AUDIO_ISINT(x) = (!SDL_AUDIO_ISFLOAT(x))
12
+ # SDL_AUDIO_ISLITTLEENDIAN(x) = (!SDL_AUDIO_ISBIGENDIAN(x))
13
+ # SDL_AUDIO_ISUNSIGNED(x) = (!SDL_AUDIO_ISSIGNED(x))
14
+
15
+ AUDIO_U8 = 0x0008
16
+ AUDIO_S8 = 0x8008
17
+ AUDIO_U16LSB = 0x0010
18
+ AUDIO_S16LSB = 0x8010
19
+ AUDIO_U16MSB = 0x1010
20
+ AUDIO_S16MSB = 0x9010
21
+ AUDIO_U16 = AUDIO_U16LSB
22
+ AUDIO_S16 = AUDIO_S16LSB
23
+ AUDIO_S32LSB = 0x8020
24
+ AUDIO_S32MSB = 0x9020
25
+ AUDIO_S32 = AUDIO_S32LSB
26
+ AUDIO_F32LSB = 0x8120
27
+ AUDIO_F32MSB = 0x9120
28
+ AUDIO_F32 = AUDIO_F32LSB
29
+
30
+ #if SDL_BYTEORDER == SDL_LIL_ENDIAN
31
+ AUDIO_U16SYS = AUDIO_U16LSB
32
+ AUDIO_S16SYS = AUDIO_S16LSB
33
+ AUDIO_S32SYS = AUDIO_S32LSB
34
+ AUDIO_F32SYS = AUDIO_F32LSB
35
+ #else
36
+ # AUDIO_U16SYS = AUDIO_U16MSB
37
+ # AUDIO_S16SYS = AUDIO_S16MSB
38
+ # AUDIO_S32SYS = AUDIO_S32MSB
39
+ # AUDIO_F32SYS = AUDIO_F32MSB
40
+ #endif
41
+
42
+ SDL_AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
43
+ SDL_AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
44
+ SDL_AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
45
+ SDL_AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
46
+ SDL_AUDIO_ALLOW_ANY_CHANGE =
47
+ SDL_AUDIO_ALLOW_FREQUENCY_CHANGE |
48
+ SDL_AUDIO_ALLOW_FORMAT_CHANGE |
49
+ SDL_AUDIO_ALLOW_CHANNELS_CHANGE |
50
+ SDL_AUDIO_ALLOW_SAMPLES_CHANGE
51
+
52
+ typealias "SDL_AudioCallback", "void*"
53
+
54
+ SDL_AudioSpec = struct(
55
+ [
56
+ "int freq",
57
+ "SDL_AudioFormat format",
58
+ "Uint8 channels",
59
+ "Uint8 silence",
60
+ "Uint16 samples",
61
+ "Uint16 padding",
62
+ "Uint32 size",
63
+ "SDL_AudioCallback callback",
64
+ "void *userdata"
65
+ ]
66
+ )
67
+
68
+ SDL_AUDIO_STOPPED = 0
69
+ SDL_AUDIO_PLAYING = 1
70
+ SDL_AUDIO_PAUSED = 2
71
+ typealias "SDL_AudioStatus", "int"
72
+
73
+ SDL_MIX_MAXVOLUME = 128
74
+ end
75
+ end
@@ -0,0 +1,10 @@
1
+ module SDLRuby
2
+ module SDL
3
+ SDL_BLENDMODE_NONE = 0x00000000
4
+ SDL_BLENDMODE_BLEND = 0x00000001
5
+ SDL_BLENDMODE_ADD = 0x00000002
6
+ SDL_BLENDMODE_MOD = 0x00000004
7
+ SDL_BLENDMODE_MUL = 0x00000008
8
+ SDL_BLENDMODE_INVALID = 0x7FFFFFFF
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module SDLRuby
2
+ module SDL
3
+ extern "int SDL_SetError(const char* fmt, ...)"
4
+ end
5
+ end