SDLRuby 0.3.1 → 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 (69) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -22
  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_ops/rw_object.rb +34 -34
  14. data/lib/SDLRuby/rw_ops.rb +91 -91
  15. data/lib/SDLRuby/sdl/include/SDL.h.rb +44 -44
  16. data/lib/SDLRuby/sdl/include/SDL_audio.h.rb +160 -160
  17. data/lib/SDLRuby/sdl/include/SDL_blendmode.h.rb +30 -30
  18. data/lib/SDLRuby/sdl/include/SDL_clipboard.h.rb +10 -10
  19. data/lib/SDLRuby/sdl/include/SDL_config.h.rb +13 -13
  20. data/lib/SDLRuby/sdl/include/SDL_cpuinfo.h.rb +27 -27
  21. data/lib/SDLRuby/sdl/include/SDL_endian.h.rb +12 -12
  22. data/lib/SDLRuby/sdl/include/SDL_error.h.rb +28 -28
  23. data/lib/SDLRuby/sdl/include/SDL_events.h.rb +472 -472
  24. data/lib/SDLRuby/sdl/include/SDL_filesystem.h.rb +6 -6
  25. data/lib/SDLRuby/sdl/include/SDL_gamecontroller.h.rb +147 -147
  26. data/lib/SDLRuby/sdl/include/SDL_gesture.h.rb +12 -12
  27. data/lib/SDLRuby/sdl/include/SDL_guid.h.rb +13 -13
  28. data/lib/SDLRuby/sdl/include/SDL_hints.h.rb +199 -199
  29. data/lib/SDLRuby/sdl/include/SDL_joystick.h.rb +131 -131
  30. data/lib/SDLRuby/sdl/include/SDL_keyboard.h.rb +35 -35
  31. data/lib/SDLRuby/sdl/include/SDL_keycode.h.rb +292 -292
  32. data/lib/SDLRuby/sdl/include/SDL_locale.h.rb +13 -13
  33. data/lib/SDLRuby/sdl/include/SDL_main.h.rb +3 -3
  34. data/lib/SDLRuby/sdl/include/SDL_messagebox.h.rb +58 -58
  35. data/lib/SDLRuby/sdl/include/SDL_misc.h.rb +5 -5
  36. data/lib/SDLRuby/sdl/include/SDL_mouse.h.rb +57 -57
  37. data/lib/SDLRuby/sdl/include/SDL_pixels.h.rb +285 -285
  38. data/lib/SDLRuby/sdl/include/SDL_platform.h.rb +3 -3
  39. data/lib/SDLRuby/sdl/include/SDL_power.h.rb +6 -6
  40. data/lib/SDLRuby/sdl/include/SDL_rect.h.rb +46 -46
  41. data/lib/SDLRuby/sdl/include/SDL_render.h.rb +131 -131
  42. data/lib/SDLRuby/sdl/include/SDL_revision.h.rb +2 -2
  43. data/lib/SDLRuby/sdl/include/SDL_rwops.h.rb +78 -78
  44. data/lib/SDLRuby/sdl/include/SDL_scancode.h.rb +252 -252
  45. data/lib/SDLRuby/sdl/include/SDL_sensor.h.rb +25 -25
  46. data/lib/SDLRuby/sdl/include/SDL_shape.h.rb +40 -40
  47. data/lib/SDLRuby/sdl/include/SDL_stdinc.h.rb +62 -62
  48. data/lib/SDLRuby/sdl/include/SDL_surface.h.rb +100 -100
  49. data/lib/SDLRuby/sdl/include/SDL_system.h.rb +6 -6
  50. data/lib/SDLRuby/sdl/include/SDL_syswm.h.rb +10 -10
  51. data/lib/SDLRuby/sdl/include/SDL_timer.h.rb +21 -21
  52. data/lib/SDLRuby/sdl/include/SDL_touch.h.rb +15 -15
  53. data/lib/SDLRuby/sdl/include/SDL_types.h.rb +3 -3
  54. data/lib/SDLRuby/sdl/include/SDL_version.h.rb +14 -14
  55. data/lib/SDLRuby/sdl/include/SDL_video.h.rb +264 -264
  56. data/lib/SDLRuby/sdl.rb +218 -218
  57. data/lib/SDLRuby/ttf/include/SDL_ttf.h.rb +54 -54
  58. data/lib/SDLRuby/version.rb +5 -5
  59. data/lib/SDLRuby/window/surfacer.rb +37 -37
  60. data/lib/SDLRuby.rb +32 -16
  61. data/sig/SDLRuby.rbs +4 -4
  62. data/sig/lib/SDLRuby/event/accessor.rbs +157 -157
  63. data/sig/lib/SDLRuby/event/type.rbs +67 -67
  64. data/sig/lib/SDLRuby/event.rbs +47 -47
  65. data/sig/lib/SDLRuby/keyboard.rbs +25 -25
  66. data/sig/lib/SDLRuby/mouse.rbs +35 -35
  67. data/sig/lib/SDLRuby/sdl.rbs +655 -655
  68. data/sig/lib/SDLRuby/timer.rbs +7 -7
  69. metadata +6 -3
@@ -1,264 +1,264 @@
1
- module SDLRuby::SDL
2
- require_relative "SDL_stdinc.h"
3
- require_relative "SDL_pixels.h"
4
- require_relative "SDL_rect.h"
5
- require_relative "SDL_surface.h"
6
-
7
- SDL_DisplayMode = struct(
8
- [
9
- "Uint32 format",
10
- "int w",
11
- "int h",
12
- "int refresh_rate",
13
- "void *driverdata",
14
- ]
15
- )
16
-
17
- SDL_WINDOW_FULLSCREEN = 0x00000001
18
- SDL_WINDOW_OPENGL = 0x00000002
19
- SDL_WINDOW_SHOWN = 0x00000004
20
- SDL_WINDOW_HIDDEN = 0x00000008
21
- SDL_WINDOW_BORDERLESS = 0x00000010
22
- SDL_WINDOW_RESIZABLE = 0x00000020
23
- SDL_WINDOW_MINIMIZED = 0x00000040
24
- SDL_WINDOW_MAXIMIZED = 0x00000080
25
- SDL_WINDOW_MOUSE_GRABBED = 0x00000100
26
- SDL_WINDOW_INPUT_FOCUS = 0x00000200
27
- SDL_WINDOW_MOUSE_FOCUS = 0x00000400
28
- SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 )
29
- SDL_WINDOW_FOREIGN = 0x00000800
30
- SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000
31
- SDL_WINDOW_MOUSE_CAPTURE = 0x00004000
32
- SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000
33
- SDL_WINDOW_SKIP_TASKBAR = 0x00010000
34
- SDL_WINDOW_UTILITY = 0x00020000
35
- SDL_WINDOW_TOOLTIP = 0x00040000
36
- SDL_WINDOW_POPUP_MENU = 0x00080000
37
- SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000
38
- SDL_WINDOW_VULKAN = 0x10000000
39
- SDL_WINDOW_METAL = 0x20000000
40
- SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED
41
- typealias "SDL_WindowFlags", "int"
42
-
43
- SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000
44
- def self.SDL_WINDOWPOS_UNDEFINED_DISPLAY(x)
45
- (SDL_WINDOWPOS_UNDEFINED_MASK|(x))
46
- end
47
- SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
48
- def self.SDL_WINDOWPOS_ISUNDEFINED(x)
49
- (((x)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
50
- end
51
-
52
- SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000
53
- def self.SDL_WINDOWPOS_CENTERED_DISPLAY(x)
54
- (SDL_WINDOWPOS_CENTERED_MASK|(x))
55
- end
56
- SDL_WINDOWPOS_CENTERED = self.SDL_WINDOWPOS_CENTERED_DISPLAY(0)
57
- def self.SDL_WINDOWPOS_ISCENTERED(x)
58
- (((x)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
59
- end
60
-
61
- SDL_WINDOWEVENT_NONE = 0
62
- SDL_WINDOWEVENT_SHOWN = 1
63
- SDL_WINDOWEVENT_HIDDEN = 2
64
- SDL_WINDOWEVENT_EXPOSED = 3
65
- SDL_WINDOWEVENT_MOVED = 4
66
- SDL_WINDOWEVENT_RESIZED = 5
67
- SDL_WINDOWEVENT_SIZE_CHANGED = 6
68
- SDL_WINDOWEVENT_MINIMIZED = 7
69
- SDL_WINDOWEVENT_MAXIMIZED = 8
70
- SDL_WINDOWEVENT_RESTORED = 9
71
- SDL_WINDOWEVENT_ENTER = 10
72
- SDL_WINDOWEVENT_LEAVE = 11
73
- SDL_WINDOWEVENT_FOCUS_GAINED = 12
74
- SDL_WINDOWEVENT_FOCUS_LOST = 13
75
- SDL_WINDOWEVENT_CLOSE = 14
76
- SDL_WINDOWEVENT_TAKE_FOCUS = 15
77
- SDL_WINDOWEVENT_HIT_TEST = 16
78
- SDL_WINDOWEVENT_ICCPROF_CHANGED = 17
79
- SDL_WINDOWEVENT_DISPLAY_CHANGED = 18
80
- typealias "SDL_WindowEventID", "int"
81
-
82
- SDL_DISPLAYEVENT_NONE = 0
83
- SDL_DISPLAYEVENT_ORIENTATION = 1
84
- SDL_DISPLAYEVENT_CONNECTED = 2
85
- SDL_DISPLAYEVENT_DISCONNECTED = 3
86
- SDL_DISPLAYEVENT_MOVED = 4
87
- typealias "SDL_DisplayEventID", "int"
88
-
89
- SDL_ORIENTATION_UNKNOWN = 0
90
- SDL_ORIENTATION_LANDSCAPE = 1
91
- SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2
92
- SDL_ORIENTATION_PORTRAIT = 3
93
- SDL_ORIENTATION_PORTRAIT_FLIPPED = 4
94
- typealias "SDL_DisplayOrientation", "int"
95
-
96
- SDL_FLASH_CANCEL = 0
97
- SDL_FLASH_BRIEFLY = 1
98
- SDL_FLASH_UNTIL_FOCUSED = 2
99
- typealias "SDL_FlashOperation", "int"
100
-
101
- typealias "SDL_GLContext", "void*"
102
-
103
- SDL_GL_RED_SIZE = 0
104
- SDL_GL_GREEN_SIZE = 1
105
- SDL_GL_BLUE_SIZE = 2
106
- SDL_GL_ALPHA_SIZE = 3
107
- SDL_GL_BUFFER_SIZE = 4
108
- SDL_GL_DOUBLEBUFFER = 5
109
- SDL_GL_DEPTH_SIZE = 6
110
- SDL_GL_STENCIL_SIZE = 7
111
- SDL_GL_ACCUM_RED_SIZE = 8
112
- SDL_GL_ACCUM_GREEN_SIZE = 9
113
- SDL_GL_ACCUM_BLUE_SIZE = 10
114
- SDL_GL_ACCUM_ALPHA_SIZE = 11
115
- SDL_GL_STEREO = 12
116
- SDL_GL_MULTISAMPLEBUFFERS = 13
117
- SDL_GL_MULTISAMPLESAMPLES = 14
118
- SDL_GL_ACCELERATED_VISUAL = 15
119
- SDL_GL_RETAINED_BACKING = 16
120
- SDL_GL_CONTEXT_MAJOR_VERSION = 17
121
- SDL_GL_CONTEXT_MINOR_VERSION = 18
122
- SDL_GL_CONTEXT_EGL = 19
123
- SDL_GL_CONTEXT_FLAGS = 20
124
- SDL_GL_CONTEXT_PROFILE_MASK = 21
125
- SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22
126
- SDL_GL_FRAMEBUFFER_SRGB_CAPABLE = 23
127
- SDL_GL_CONTEXT_RELEASE_BEHAVIOR = 24
128
- SDL_GL_CONTEXT_RESET_NOTIFICATION = 25
129
- SDL_GL_CONTEXT_NO_ERROR = 26
130
- SDL_GL_FLOATBUFFERS = 27
131
- typealias "SDL_GLattr", "int"
132
-
133
- SDL_GL_CONTEXT_PROFILE_CORE = 0x0001
134
- SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002
135
- SDL_GL_CONTEXT_PROFILE_ES = 0x0004
136
- typealias "SDL_GLprofile", "int"
137
-
138
- SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001
139
- SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002
140
- SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004
141
- SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
142
- typealias "SDL_GLcontextFlag", "int"
143
-
144
- SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000
145
- SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
146
- typealias "SDL_GLcontextReleaseFlag", "int"
147
-
148
- SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000
149
- SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
150
- typealias "SDL_GLContextResetNotification", "int"
151
-
152
- extern "int SDL_GetNumVideoDrivers(void)"
153
- extern "const char * SDL_GetVideoDriver(int index)"
154
- extern "int SDL_VideoInit(const char *driver_name)"
155
- extern "void SDL_VideoQuit(void)"
156
- extern "const char * SDL_GetCurrentVideoDriver(void)"
157
- extern "int SDL_GetNumVideoDisplays(void)"
158
- extern "const char * SDL_GetDisplayName(int displayIndex)"
159
- extern "int SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)"
160
- extern "int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect)"
161
- extern "int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi)"
162
- extern "SDL_DisplayOrientation SDL_GetDisplayOrientation(int displayIndex)"
163
- extern "int SDL_GetNumDisplayModes(int displayIndex)"
164
- extern "int SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode * mode)"
165
- extern "int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode)"
166
- extern "int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode)"
167
- extern "SDL_DisplayMode * SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest)"
168
- extern "int SDL_GetPointDisplayIndex(const SDL_Point * point)"
169
- extern "int SDL_GetRectDisplayIndex(const SDL_Rect * rect)"
170
- extern "int SDL_GetWindowDisplayIndex(SDL_Window * window)"
171
- extern "int SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)"
172
- extern "int SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)"
173
- extern "void* SDL_GetWindowICCProfile(SDL_Window * window, size_t* size)"
174
- extern "Uint32 SDL_GetWindowPixelFormat(SDL_Window * window)"
175
- extern "SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)"
176
- extern "SDL_Window * SDL_CreateWindowFrom(const void *data)"
177
- extern "Uint32 SDL_GetWindowID(SDL_Window * window)"
178
- extern "SDL_Window * SDL_GetWindowFromID(Uint32 id)"
179
- extern "Uint32 SDL_GetWindowFlags(SDL_Window * window)"
180
- extern "void SDL_SetWindowTitle(SDL_Window * window, const char *title)"
181
- extern "const char * SDL_GetWindowTitle(SDL_Window * window)"
182
- extern "void SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon)"
183
- extern "void* SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata)"
184
- extern "void * SDL_GetWindowData(SDL_Window * window, const char *name)"
185
- extern "void SDL_SetWindowPosition(SDL_Window * window, int x, int y)"
186
- extern "void SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)"
187
- extern "void SDL_SetWindowSize(SDL_Window * window, int w, int h)"
188
- extern "void SDL_GetWindowSize(SDL_Window * window, int *w, int *h)"
189
- extern "int SDL_GetWindowBordersSize(SDL_Window * window, int *top, int *left, int *bottom, int *right)"
190
- extern "void SDL_GetWindowSizeInPixels(SDL_Window * window, int *w, int *h)"
191
- extern "void SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h)"
192
- extern "void SDL_GetWindowMinimumSize(SDL_Window * window, int *w, int *h)"
193
- extern "void SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)"
194
- extern "void SDL_GetWindowMaximumSize(SDL_Window * window, int *w, int *h)"
195
- extern "void SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered)"
196
- extern "void SDL_SetWindowResizable(SDL_Window * window, SDL_bool resizable)"
197
- extern "void SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top)"
198
- extern "void SDL_ShowWindow(SDL_Window * window)"
199
- extern "void SDL_HideWindow(SDL_Window * window)"
200
- extern "void SDL_RaiseWindow(SDL_Window * window)"
201
- extern "void SDL_MaximizeWindow(SDL_Window * window)"
202
- extern "void SDL_MinimizeWindow(SDL_Window * window)"
203
- extern "void SDL_RestoreWindow(SDL_Window * window)"
204
- extern "int SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags)"
205
- extern "SDL_bool SDL_HasWindowSurface(SDL_Window *window)"
206
- extern "SDL_Surface * SDL_GetWindowSurface(SDL_Window * window)"
207
- extern "int SDL_UpdateWindowSurface(SDL_Window * window)"
208
- extern "int SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, int numrects)"
209
- extern "int SDL_DestroyWindowSurface(SDL_Window *window)"
210
- extern "void SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed)"
211
- extern "void SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed)"
212
- extern "void SDL_SetWindowMouseGrab(SDL_Window * window, SDL_bool grabbed)"
213
- extern "SDL_bool SDL_GetWindowGrab(SDL_Window * window)"
214
- extern "SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window * window)"
215
- extern "SDL_bool SDL_GetWindowMouseGrab(SDL_Window * window)"
216
- extern "SDL_Window * SDL_GetGrabbedWindow(void)"
217
- extern "int SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect)"
218
- extern "const SDL_Rect * SDL_GetWindowMouseRect(SDL_Window * window)"
219
- extern "int SDL_SetWindowBrightness(SDL_Window * window, float brightness)"
220
- extern "float SDL_GetWindowBrightness(SDL_Window * window)"
221
- extern "int SDL_SetWindowOpacity(SDL_Window * window, float opacity)"
222
- extern "int SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity)"
223
- extern "int SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window)"
224
- extern "int SDL_SetWindowInputFocus(SDL_Window * window)"
225
- extern "int SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, const Uint16 * green, const Uint16 * blue)"
226
- extern "int SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, Uint16 * green, Uint16 * blue)"
227
-
228
- SDL_HITTEST_NORMAL = 0
229
- SDL_HITTEST_DRAGGABLE = 1
230
- SDL_HITTEST_RESIZE_TOPLEFT = 2
231
- SDL_HITTEST_RESIZE_TOP = 3
232
- SDL_HITTEST_RESIZE_TOPRIGHT = 4
233
- SDL_HITTEST_RESIZE_RIGHT = 5
234
- SDL_HITTEST_RESIZE_BOTTOMRIGHT = 6
235
- SDL_HITTEST_RESIZE_BOTTOM = 7
236
- SDL_HITTEST_RESIZE_BOTTOMLEFT = 8
237
- SDL_HITTEST_RESIZE_LEFT = 9
238
- typealias "SDL_HitTestResult", "int"
239
-
240
- typealias "SDL_HitTest", "void*"
241
-
242
- extern "int SDL_SetWindowHitTest(SDL_Window * window, SDL_HitTest callback, void *callback_data)"
243
- extern "int SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation)"
244
- extern "void SDL_DestroyWindow(SDL_Window * window)"
245
- extern "SDL_bool SDL_IsScreenSaverEnabled(void)"
246
- extern "void SDL_EnableScreenSaver(void)"
247
- extern "void SDL_DisableScreenSaver(void)"
248
- extern "int SDL_GL_LoadLibrary(const char *path)"
249
- extern "void * SDL_GL_GetProcAddress(const char *proc)"
250
- extern "void SDL_GL_UnloadLibrary(void)"
251
- extern "SDL_bool SDL_GL_ExtensionSupported(const char *extension)"
252
- extern "void SDL_GL_ResetAttributes(void)"
253
- extern "int SDL_GL_SetAttribute(SDL_GLattr attr, int value)"
254
- extern "int SDL_GL_GetAttribute(SDL_GLattr attr, int *value)"
255
- extern "SDL_GLContext SDL_GL_CreateContext(SDL_Window * window)"
256
- extern "int SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext context)"
257
- extern "SDL_Window* SDL_GL_GetCurrentWindow(void)"
258
- extern "SDL_GLContext SDL_GL_GetCurrentContext(void)"
259
- extern "void SDL_GL_GetDrawableSize(SDL_Window * window, int *w, int *h)"
260
- extern "int SDL_GL_SetSwapInterval(int interval)"
261
- extern "int SDL_GL_GetSwapInterval(void)"
262
- extern "void SDL_GL_SwapWindow(SDL_Window * window)"
263
- extern "void SDL_GL_DeleteContext(SDL_GLContext context)"
264
- end
1
+ module SDLRuby::SDL
2
+ require_relative "SDL_stdinc.h"
3
+ require_relative "SDL_pixels.h"
4
+ require_relative "SDL_rect.h"
5
+ require_relative "SDL_surface.h"
6
+
7
+ SDL_DisplayMode = struct(
8
+ [
9
+ "Uint32 format",
10
+ "int w",
11
+ "int h",
12
+ "int refresh_rate",
13
+ "void *driverdata",
14
+ ]
15
+ )
16
+
17
+ SDL_WINDOW_FULLSCREEN = 0x00000001
18
+ SDL_WINDOW_OPENGL = 0x00000002
19
+ SDL_WINDOW_SHOWN = 0x00000004
20
+ SDL_WINDOW_HIDDEN = 0x00000008
21
+ SDL_WINDOW_BORDERLESS = 0x00000010
22
+ SDL_WINDOW_RESIZABLE = 0x00000020
23
+ SDL_WINDOW_MINIMIZED = 0x00000040
24
+ SDL_WINDOW_MAXIMIZED = 0x00000080
25
+ SDL_WINDOW_MOUSE_GRABBED = 0x00000100
26
+ SDL_WINDOW_INPUT_FOCUS = 0x00000200
27
+ SDL_WINDOW_MOUSE_FOCUS = 0x00000400
28
+ SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 )
29
+ SDL_WINDOW_FOREIGN = 0x00000800
30
+ SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000
31
+ SDL_WINDOW_MOUSE_CAPTURE = 0x00004000
32
+ SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000
33
+ SDL_WINDOW_SKIP_TASKBAR = 0x00010000
34
+ SDL_WINDOW_UTILITY = 0x00020000
35
+ SDL_WINDOW_TOOLTIP = 0x00040000
36
+ SDL_WINDOW_POPUP_MENU = 0x00080000
37
+ SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000
38
+ SDL_WINDOW_VULKAN = 0x10000000
39
+ SDL_WINDOW_METAL = 0x20000000
40
+ SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED
41
+ typealias "SDL_WindowFlags", "int"
42
+
43
+ SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000
44
+ def self.SDL_WINDOWPOS_UNDEFINED_DISPLAY(x)
45
+ (SDL_WINDOWPOS_UNDEFINED_MASK|(x))
46
+ end
47
+ SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
48
+ def self.SDL_WINDOWPOS_ISUNDEFINED(x)
49
+ (((x)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
50
+ end
51
+
52
+ SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000
53
+ def self.SDL_WINDOWPOS_CENTERED_DISPLAY(x)
54
+ (SDL_WINDOWPOS_CENTERED_MASK|(x))
55
+ end
56
+ SDL_WINDOWPOS_CENTERED = self.SDL_WINDOWPOS_CENTERED_DISPLAY(0)
57
+ def self.SDL_WINDOWPOS_ISCENTERED(x)
58
+ (((x)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
59
+ end
60
+
61
+ SDL_WINDOWEVENT_NONE = 0
62
+ SDL_WINDOWEVENT_SHOWN = 1
63
+ SDL_WINDOWEVENT_HIDDEN = 2
64
+ SDL_WINDOWEVENT_EXPOSED = 3
65
+ SDL_WINDOWEVENT_MOVED = 4
66
+ SDL_WINDOWEVENT_RESIZED = 5
67
+ SDL_WINDOWEVENT_SIZE_CHANGED = 6
68
+ SDL_WINDOWEVENT_MINIMIZED = 7
69
+ SDL_WINDOWEVENT_MAXIMIZED = 8
70
+ SDL_WINDOWEVENT_RESTORED = 9
71
+ SDL_WINDOWEVENT_ENTER = 10
72
+ SDL_WINDOWEVENT_LEAVE = 11
73
+ SDL_WINDOWEVENT_FOCUS_GAINED = 12
74
+ SDL_WINDOWEVENT_FOCUS_LOST = 13
75
+ SDL_WINDOWEVENT_CLOSE = 14
76
+ SDL_WINDOWEVENT_TAKE_FOCUS = 15
77
+ SDL_WINDOWEVENT_HIT_TEST = 16
78
+ SDL_WINDOWEVENT_ICCPROF_CHANGED = 17
79
+ SDL_WINDOWEVENT_DISPLAY_CHANGED = 18
80
+ typealias "SDL_WindowEventID", "int"
81
+
82
+ SDL_DISPLAYEVENT_NONE = 0
83
+ SDL_DISPLAYEVENT_ORIENTATION = 1
84
+ SDL_DISPLAYEVENT_CONNECTED = 2
85
+ SDL_DISPLAYEVENT_DISCONNECTED = 3
86
+ SDL_DISPLAYEVENT_MOVED = 4
87
+ typealias "SDL_DisplayEventID", "int"
88
+
89
+ SDL_ORIENTATION_UNKNOWN = 0
90
+ SDL_ORIENTATION_LANDSCAPE = 1
91
+ SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2
92
+ SDL_ORIENTATION_PORTRAIT = 3
93
+ SDL_ORIENTATION_PORTRAIT_FLIPPED = 4
94
+ typealias "SDL_DisplayOrientation", "int"
95
+
96
+ SDL_FLASH_CANCEL = 0
97
+ SDL_FLASH_BRIEFLY = 1
98
+ SDL_FLASH_UNTIL_FOCUSED = 2
99
+ typealias "SDL_FlashOperation", "int"
100
+
101
+ typealias "SDL_GLContext", "void*"
102
+
103
+ SDL_GL_RED_SIZE = 0
104
+ SDL_GL_GREEN_SIZE = 1
105
+ SDL_GL_BLUE_SIZE = 2
106
+ SDL_GL_ALPHA_SIZE = 3
107
+ SDL_GL_BUFFER_SIZE = 4
108
+ SDL_GL_DOUBLEBUFFER = 5
109
+ SDL_GL_DEPTH_SIZE = 6
110
+ SDL_GL_STENCIL_SIZE = 7
111
+ SDL_GL_ACCUM_RED_SIZE = 8
112
+ SDL_GL_ACCUM_GREEN_SIZE = 9
113
+ SDL_GL_ACCUM_BLUE_SIZE = 10
114
+ SDL_GL_ACCUM_ALPHA_SIZE = 11
115
+ SDL_GL_STEREO = 12
116
+ SDL_GL_MULTISAMPLEBUFFERS = 13
117
+ SDL_GL_MULTISAMPLESAMPLES = 14
118
+ SDL_GL_ACCELERATED_VISUAL = 15
119
+ SDL_GL_RETAINED_BACKING = 16
120
+ SDL_GL_CONTEXT_MAJOR_VERSION = 17
121
+ SDL_GL_CONTEXT_MINOR_VERSION = 18
122
+ SDL_GL_CONTEXT_EGL = 19
123
+ SDL_GL_CONTEXT_FLAGS = 20
124
+ SDL_GL_CONTEXT_PROFILE_MASK = 21
125
+ SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22
126
+ SDL_GL_FRAMEBUFFER_SRGB_CAPABLE = 23
127
+ SDL_GL_CONTEXT_RELEASE_BEHAVIOR = 24
128
+ SDL_GL_CONTEXT_RESET_NOTIFICATION = 25
129
+ SDL_GL_CONTEXT_NO_ERROR = 26
130
+ SDL_GL_FLOATBUFFERS = 27
131
+ typealias "SDL_GLattr", "int"
132
+
133
+ SDL_GL_CONTEXT_PROFILE_CORE = 0x0001
134
+ SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002
135
+ SDL_GL_CONTEXT_PROFILE_ES = 0x0004
136
+ typealias "SDL_GLprofile", "int"
137
+
138
+ SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001
139
+ SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002
140
+ SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004
141
+ SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
142
+ typealias "SDL_GLcontextFlag", "int"
143
+
144
+ SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000
145
+ SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
146
+ typealias "SDL_GLcontextReleaseFlag", "int"
147
+
148
+ SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000
149
+ SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
150
+ typealias "SDL_GLContextResetNotification", "int"
151
+
152
+ extern "int SDL_GetNumVideoDrivers(void)"
153
+ extern "const char * SDL_GetVideoDriver(int index)"
154
+ extern "int SDL_VideoInit(const char *driver_name)"
155
+ extern "void SDL_VideoQuit(void)"
156
+ extern "const char * SDL_GetCurrentVideoDriver(void)"
157
+ extern "int SDL_GetNumVideoDisplays(void)"
158
+ extern "const char * SDL_GetDisplayName(int displayIndex)"
159
+ extern "int SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect)"
160
+ extern "int SDL_GetDisplayUsableBounds(int displayIndex, SDL_Rect * rect)"
161
+ extern "int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi)"
162
+ extern "SDL_DisplayOrientation SDL_GetDisplayOrientation(int displayIndex)"
163
+ extern "int SDL_GetNumDisplayModes(int displayIndex)"
164
+ extern "int SDL_GetDisplayMode(int displayIndex, int modeIndex, SDL_DisplayMode * mode)"
165
+ extern "int SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode)"
166
+ extern "int SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode)"
167
+ extern "SDL_DisplayMode * SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest)"
168
+ extern "int SDL_GetPointDisplayIndex(const SDL_Point * point)"
169
+ extern "int SDL_GetRectDisplayIndex(const SDL_Rect * rect)"
170
+ extern "int SDL_GetWindowDisplayIndex(SDL_Window * window)"
171
+ extern "int SDL_SetWindowDisplayMode(SDL_Window * window, const SDL_DisplayMode * mode)"
172
+ extern "int SDL_GetWindowDisplayMode(SDL_Window * window, SDL_DisplayMode * mode)"
173
+ extern "void* SDL_GetWindowICCProfile(SDL_Window * window, size_t* size)"
174
+ extern "Uint32 SDL_GetWindowPixelFormat(SDL_Window * window)"
175
+ extern "SDL_Window * SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)"
176
+ extern "SDL_Window * SDL_CreateWindowFrom(const void *data)"
177
+ extern "Uint32 SDL_GetWindowID(SDL_Window * window)"
178
+ extern "SDL_Window * SDL_GetWindowFromID(Uint32 id)"
179
+ extern "Uint32 SDL_GetWindowFlags(SDL_Window * window)"
180
+ extern "void SDL_SetWindowTitle(SDL_Window * window, const char *title)"
181
+ extern "const char * SDL_GetWindowTitle(SDL_Window * window)"
182
+ extern "void SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon)"
183
+ extern "void* SDL_SetWindowData(SDL_Window * window, const char *name, void *userdata)"
184
+ extern "void * SDL_GetWindowData(SDL_Window * window, const char *name)"
185
+ extern "void SDL_SetWindowPosition(SDL_Window * window, int x, int y)"
186
+ extern "void SDL_GetWindowPosition(SDL_Window * window, int *x, int *y)"
187
+ extern "void SDL_SetWindowSize(SDL_Window * window, int w, int h)"
188
+ extern "void SDL_GetWindowSize(SDL_Window * window, int *w, int *h)"
189
+ extern "int SDL_GetWindowBordersSize(SDL_Window * window, int *top, int *left, int *bottom, int *right)"
190
+ extern "void SDL_GetWindowSizeInPixels(SDL_Window * window, int *w, int *h)"
191
+ extern "void SDL_SetWindowMinimumSize(SDL_Window * window, int min_w, int min_h)"
192
+ extern "void SDL_GetWindowMinimumSize(SDL_Window * window, int *w, int *h)"
193
+ extern "void SDL_SetWindowMaximumSize(SDL_Window * window, int max_w, int max_h)"
194
+ extern "void SDL_GetWindowMaximumSize(SDL_Window * window, int *w, int *h)"
195
+ extern "void SDL_SetWindowBordered(SDL_Window * window, SDL_bool bordered)"
196
+ extern "void SDL_SetWindowResizable(SDL_Window * window, SDL_bool resizable)"
197
+ extern "void SDL_SetWindowAlwaysOnTop(SDL_Window * window, SDL_bool on_top)"
198
+ extern "void SDL_ShowWindow(SDL_Window * window)"
199
+ extern "void SDL_HideWindow(SDL_Window * window)"
200
+ extern "void SDL_RaiseWindow(SDL_Window * window)"
201
+ extern "void SDL_MaximizeWindow(SDL_Window * window)"
202
+ extern "void SDL_MinimizeWindow(SDL_Window * window)"
203
+ extern "void SDL_RestoreWindow(SDL_Window * window)"
204
+ extern "int SDL_SetWindowFullscreen(SDL_Window * window, Uint32 flags)"
205
+ extern "SDL_bool SDL_HasWindowSurface(SDL_Window *window)"
206
+ extern "SDL_Surface * SDL_GetWindowSurface(SDL_Window * window)"
207
+ extern "int SDL_UpdateWindowSurface(SDL_Window * window)"
208
+ extern "int SDL_UpdateWindowSurfaceRects(SDL_Window * window, const SDL_Rect * rects, int numrects)"
209
+ extern "int SDL_DestroyWindowSurface(SDL_Window *window)"
210
+ extern "void SDL_SetWindowGrab(SDL_Window * window, SDL_bool grabbed)"
211
+ extern "void SDL_SetWindowKeyboardGrab(SDL_Window * window, SDL_bool grabbed)"
212
+ extern "void SDL_SetWindowMouseGrab(SDL_Window * window, SDL_bool grabbed)"
213
+ extern "SDL_bool SDL_GetWindowGrab(SDL_Window * window)"
214
+ extern "SDL_bool SDL_GetWindowKeyboardGrab(SDL_Window * window)"
215
+ extern "SDL_bool SDL_GetWindowMouseGrab(SDL_Window * window)"
216
+ extern "SDL_Window * SDL_GetGrabbedWindow(void)"
217
+ extern "int SDL_SetWindowMouseRect(SDL_Window * window, const SDL_Rect * rect)"
218
+ extern "const SDL_Rect * SDL_GetWindowMouseRect(SDL_Window * window)"
219
+ extern "int SDL_SetWindowBrightness(SDL_Window * window, float brightness)"
220
+ extern "float SDL_GetWindowBrightness(SDL_Window * window)"
221
+ extern "int SDL_SetWindowOpacity(SDL_Window * window, float opacity)"
222
+ extern "int SDL_GetWindowOpacity(SDL_Window * window, float * out_opacity)"
223
+ extern "int SDL_SetWindowModalFor(SDL_Window * modal_window, SDL_Window * parent_window)"
224
+ extern "int SDL_SetWindowInputFocus(SDL_Window * window)"
225
+ extern "int SDL_SetWindowGammaRamp(SDL_Window * window, const Uint16 * red, const Uint16 * green, const Uint16 * blue)"
226
+ extern "int SDL_GetWindowGammaRamp(SDL_Window * window, Uint16 * red, Uint16 * green, Uint16 * blue)"
227
+
228
+ SDL_HITTEST_NORMAL = 0
229
+ SDL_HITTEST_DRAGGABLE = 1
230
+ SDL_HITTEST_RESIZE_TOPLEFT = 2
231
+ SDL_HITTEST_RESIZE_TOP = 3
232
+ SDL_HITTEST_RESIZE_TOPRIGHT = 4
233
+ SDL_HITTEST_RESIZE_RIGHT = 5
234
+ SDL_HITTEST_RESIZE_BOTTOMRIGHT = 6
235
+ SDL_HITTEST_RESIZE_BOTTOM = 7
236
+ SDL_HITTEST_RESIZE_BOTTOMLEFT = 8
237
+ SDL_HITTEST_RESIZE_LEFT = 9
238
+ typealias "SDL_HitTestResult", "int"
239
+
240
+ typealias "SDL_HitTest", "void*"
241
+
242
+ extern "int SDL_SetWindowHitTest(SDL_Window * window, SDL_HitTest callback, void *callback_data)"
243
+ extern "int SDL_FlashWindow(SDL_Window * window, SDL_FlashOperation operation)"
244
+ extern "void SDL_DestroyWindow(SDL_Window * window)"
245
+ extern "SDL_bool SDL_IsScreenSaverEnabled(void)"
246
+ extern "void SDL_EnableScreenSaver(void)"
247
+ extern "void SDL_DisableScreenSaver(void)"
248
+ extern "int SDL_GL_LoadLibrary(const char *path)"
249
+ extern "void * SDL_GL_GetProcAddress(const char *proc)"
250
+ extern "void SDL_GL_UnloadLibrary(void)"
251
+ extern "SDL_bool SDL_GL_ExtensionSupported(const char *extension)"
252
+ extern "void SDL_GL_ResetAttributes(void)"
253
+ extern "int SDL_GL_SetAttribute(SDL_GLattr attr, int value)"
254
+ extern "int SDL_GL_GetAttribute(SDL_GLattr attr, int *value)"
255
+ extern "SDL_GLContext SDL_GL_CreateContext(SDL_Window * window)"
256
+ extern "int SDL_GL_MakeCurrent(SDL_Window * window, SDL_GLContext context)"
257
+ extern "SDL_Window* SDL_GL_GetCurrentWindow(void)"
258
+ extern "SDL_GLContext SDL_GL_GetCurrentContext(void)"
259
+ extern "void SDL_GL_GetDrawableSize(SDL_Window * window, int *w, int *h)"
260
+ extern "int SDL_GL_SetSwapInterval(int interval)"
261
+ extern "int SDL_GL_GetSwapInterval(void)"
262
+ extern "void SDL_GL_SwapWindow(SDL_Window * window)"
263
+ extern "void SDL_GL_DeleteContext(SDL_GLContext context)"
264
+ end