SDLRuby 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +31 -0
- data/Rakefile +12 -0
- data/lib/SDLRuby/audio.rb +65 -0
- data/lib/SDLRuby/cursor.rb +46 -0
- data/lib/SDLRuby/display.rb +79 -0
- data/lib/SDLRuby/event/accessor.rb +127 -0
- data/lib/SDLRuby/event/type.rb +75 -0
- data/lib/SDLRuby/event.rb +80 -0
- data/lib/SDLRuby/font.rb +227 -0
- data/lib/SDLRuby/hint.rb +36 -0
- data/lib/SDLRuby/image/image.rb +23 -0
- data/lib/SDLRuby/image/include/SDL_image.h.rb +61 -0
- data/lib/SDLRuby/image.rb +69 -0
- data/lib/SDLRuby/keyboard.rb +58 -0
- data/lib/SDLRuby/mixer/channel.rb +43 -0
- data/lib/SDLRuby/mixer/chunk.rb +49 -0
- data/lib/SDLRuby/mixer/controller.rb +44 -0
- data/lib/SDLRuby/mixer/include/SDL_mixer.h.rb +95 -0
- data/lib/SDLRuby/mixer/sdl_mixer.rb +60 -0
- data/lib/SDLRuby/mixer.rb +87 -0
- data/lib/SDLRuby/mouse.rb +52 -0
- data/lib/SDLRuby/music.rb +158 -0
- data/lib/SDLRuby/palette.rb +49 -0
- data/lib/SDLRuby/pixel_formatter.rb +67 -0
- data/lib/SDLRuby/rect.rb +11 -0
- data/lib/SDLRuby/renderer/accessor.rb +70 -0
- data/lib/SDLRuby/renderer/drawer.rb +107 -0
- data/lib/SDLRuby/renderer/renderer_info.rb +27 -0
- data/lib/SDLRuby/renderer.rb +101 -0
- data/lib/SDLRuby/rw_ops/rw_object.rb +128 -0
- data/lib/SDLRuby/rw_ops.rb +216 -0
- data/lib/SDLRuby/sdl/include/SDL.h.rb +33 -0
- data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +49 -0
- data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_clipboard.h.rb +10 -0
- data/lib/SDLRuby/sdl/include/SDL_config.h.rb +13 -0
- data/lib/SDLRuby/sdl/include/SDL_cpuinfo.h.rb +27 -0
- data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +3 -0
- data/lib/SDLRuby/sdl/include/SDL_error.h.rb +9 -0
- data/lib/SDLRuby/sdl/include/SDL_events.h.rb +32 -0
- data/lib/SDLRuby/sdl/include/SDL_filesystem.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +66 -0
- data/lib/SDLRuby/sdl/include/SDL_gesture.h.rb +12 -0
- data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +7 -0
- data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +14 -0
- data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +69 -0
- data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +26 -0
- data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +7 -0
- data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_main.h.rb +3 -0
- data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +10 -0
- data/lib/SDLRuby/sdl/include/SDL_misc.h.rb +5 -0
- data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +26 -0
- data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +25 -0
- data/lib/SDLRuby/sdl/include/SDL_platform.h.rb +3 -0
- data/lib/SDLRuby/sdl/include/SDL_power.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +17 -0
- data/lib/SDLRuby/sdl/include/SDL_render.h.rb +94 -0
- data/lib/SDLRuby/sdl/include/SDL_revision.h.rb +2 -0
- data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +34 -0
- data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +5 -0
- data/lib/SDLRuby/sdl/include/SDL_sensor.h.rb +25 -0
- data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +13 -0
- data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +24 -0
- data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +37 -0
- data/lib/SDLRuby/sdl/include/SDL_system.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +16 -0
- data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +13 -0
- data/lib/SDLRuby/sdl/include/SDL_touch.h.rb +15 -0
- data/lib/SDLRuby/sdl/include/SDL_types.h.rb +3 -0
- data/lib/SDLRuby/sdl/include/SDL_version.h.rb +6 -0
- data/lib/SDLRuby/sdl/include/SDL_video.h.rb +117 -0
- data/lib/SDLRuby/sdl/sdl.rb +55 -0
- data/lib/SDLRuby/sdl/sdl_audio.rb +75 -0
- data/lib/SDLRuby/sdl/sdl_blendmode.rb +10 -0
- data/lib/SDLRuby/sdl/sdl_error.rb +5 -0
- data/lib/SDLRuby/sdl/sdl_events.rb +470 -0
- data/lib/SDLRuby/sdl/sdl_hints.rb +9 -0
- data/lib/SDLRuby/sdl/sdl_keyboard.rb +12 -0
- data/lib/SDLRuby/sdl/sdl_locale.rb +8 -0
- data/lib/SDLRuby/sdl/sdl_message_box.rb +7 -0
- data/lib/SDLRuby/sdl/sdl_mouse.rb +32 -0
- data/lib/SDLRuby/sdl/sdl_palette.rb +12 -0
- data/lib/SDLRuby/sdl/sdl_pixels.rb +138 -0
- data/lib/SDLRuby/sdl/sdl_rect.rb +11 -0
- data/lib/SDLRuby/sdl/sdl_render.rb +35 -0
- data/lib/SDLRuby/sdl/sdl_rw_ops.rb +29 -0
- data/lib/SDLRuby/sdl/sdl_scancode.rb +255 -0
- data/lib/SDLRuby/sdl/sdl_surface.rb +27 -0
- data/lib/SDLRuby/sdl/sdl_version.rb +5 -0
- data/lib/SDLRuby/sdl/sdl_video.rb +104 -0
- data/lib/SDLRuby/sdl.rb +192 -0
- data/lib/SDLRuby/sdl_error.rb +8 -0
- data/lib/SDLRuby/surface/pixel_format.rb +51 -0
- data/lib/SDLRuby/surface/surface_renderer.rb +26 -0
- data/lib/SDLRuby/surface.rb +179 -0
- data/lib/SDLRuby/text_input.rb +38 -0
- data/lib/SDLRuby/texture.rb +93 -0
- data/lib/SDLRuby/ttf/include/SDL_ttf.h.rb +54 -0
- data/lib/SDLRuby/ttf/ttf.rb +41 -0
- data/lib/SDLRuby/ttf.rb +54 -0
- data/lib/SDLRuby/version.rb +5 -0
- data/lib/SDLRuby/window/accessor.rb +125 -0
- data/lib/SDLRuby/window/controller.rb +53 -0
- data/lib/SDLRuby/window/display_info.rb +48 -0
- data/lib/SDLRuby/window/flag.rb +42 -0
- data/lib/SDLRuby/window/hit_tester.rb +61 -0
- data/lib/SDLRuby/window/input.rb +68 -0
- data/lib/SDLRuby/window/shaper.rb +68 -0
- data/lib/SDLRuby/window/surfacer.rb +37 -0
- data/lib/SDLRuby/window/window_renderer.rb +31 -0
- data/lib/SDLRuby/window.rb +90 -0
- data/lib/SDLRuby.rb +16 -0
- data/sig/SDLRuby/event.rbs +104 -0
- data/sig/SDLRuby/pixel_formmater.rbs +24 -0
- data/sig/SDLRuby/rect.rbs +5 -0
- data/sig/SDLRuby/sdl.rbs +606 -0
- data/sig/SDLRuby.rbs +4 -0
- 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,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,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
|