1from ctypes import Structure, POINTER, c_int, c_void_p, c_char_p, c_float, \
2    py_object, CFUNCTYPE
3from .dll import _bind
4from .stdinc import Uint16, Uint32, SDL_bool
5from .rect import SDL_Point, SDL_Rect
6from .surface import SDL_Surface
7
8__all__ = [
9    # Structs & Opaque Types
10    "SDL_DisplayMode", "SDL_Window", "SDL_GLContext",
11
12    # Enums
13    "SDL_WindowFlags",
14    "SDL_WINDOW_FULLSCREEN", "SDL_WINDOW_OPENGL", "SDL_WINDOW_SHOWN",
15    "SDL_WINDOW_HIDDEN", "SDL_WINDOW_BORDERLESS",
16    "SDL_WINDOW_RESIZABLE", "SDL_WINDOW_MINIMIZED",
17    "SDL_WINDOW_MAXIMIZED", "SDL_WINDOW_MOUSE_GRABBED",
18    "SDL_WINDOW_INPUT_FOCUS", "SDL_WINDOW_MOUSE_FOCUS",
19    "SDL_WINDOW_FULLSCREEN_DESKTOP", "SDL_WINDOW_FOREIGN",
20    "SDL_WINDOW_ALLOW_HIGHDPI", "SDL_WINDOW_MOUSE_CAPTURE",
21    "SDL_WINDOW_ALWAYS_ON_TOP", "SDL_WINDOW_SKIP_TASKBAR",
22    "SDL_WINDOW_UTILITY", "SDL_WINDOW_TOOLTIP",
23    "SDL_WINDOW_POPUP_MENU", "SDL_WINDOW_KEYBOARD_GRABBED",
24    "SDL_WINDOW_VULKAN", "SDL_WINDOW_METAL",
25    "SDL_WINDOW_INPUT_FOCUS",
26
27    "SDL_WindowEventID",
28    "SDL_WINDOWEVENT_NONE",
29    "SDL_WINDOWEVENT_SHOWN", "SDL_WINDOWEVENT_HIDDEN",
30    "SDL_WINDOWEVENT_EXPOSED", "SDL_WINDOWEVENT_MOVED",
31    "SDL_WINDOWEVENT_RESIZED", "SDL_WINDOWEVENT_SIZE_CHANGED",
32    "SDL_WINDOWEVENT_MINIMIZED", "SDL_WINDOWEVENT_MAXIMIZED",
33    "SDL_WINDOWEVENT_RESTORED", "SDL_WINDOWEVENT_ENTER",
34    "SDL_WINDOWEVENT_LEAVE", "SDL_WINDOWEVENT_FOCUS_GAINED",
35    "SDL_WINDOWEVENT_FOCUS_LOST", "SDL_WINDOWEVENT_CLOSE",
36    "SDL_WINDOWEVENT_TAKE_FOCUS", "SDL_WINDOWEVENT_HIT_TEST",
37
38    "SDL_DisplayEventID",
39    "SDL_DISPLAYEVENT_NONE", "SDL_DISPLAYEVENT_ORIENTATION",
40    "SDL_DISPLAYEVENT_CONNECTED", "SDL_DISPLAYEVENT_DISCONNECTED",
41
42    "SDL_DisplayOrientation",
43    "SDL_ORIENTATION_UNKNOWN", "SDL_ORIENTATION_LANDSCAPE",
44    "SDL_ORIENTATION_LANDSCAPE_FLIPPED", "SDL_ORIENTATION_PORTRAIT",
45    "SDL_ORIENTATION_PORTRAIT_FLIPPED",
46
47    "SDL_FlashOperation",
48    "SDL_FLASH_CANCEL", "SDL_FLASH_BRIEFLY", "SDL_FLASH_UNTIL_FOCUSED",
49
50    "SDL_GLattr",
51    "SDL_GL_RED_SIZE",
52    "SDL_GL_GREEN_SIZE", "SDL_GL_BLUE_SIZE", "SDL_GL_ALPHA_SIZE",
53    "SDL_GL_BUFFER_SIZE", "SDL_GL_DOUBLEBUFFER", "SDL_GL_DEPTH_SIZE",
54    "SDL_GL_STENCIL_SIZE", "SDL_GL_ACCUM_RED_SIZE",
55    "SDL_GL_ACCUM_GREEN_SIZE", "SDL_GL_ACCUM_BLUE_SIZE",
56    "SDL_GL_ACCUM_ALPHA_SIZE", "SDL_GL_STEREO",
57    "SDL_GL_MULTISAMPLEBUFFERS", "SDL_GL_MULTISAMPLESAMPLES",
58    "SDL_GL_ACCELERATED_VISUAL", "SDL_GL_RETAINED_BACKING",
59    "SDL_GL_CONTEXT_MAJOR_VERSION", "SDL_GL_CONTEXT_MINOR_VERSION",
60    "SDL_GL_CONTEXT_EGL", "SDL_GL_CONTEXT_FLAGS",
61    "SDL_GL_CONTEXT_PROFILE_MASK", "SDL_GL_SHARE_WITH_CURRENT_CONTEXT",
62    "SDL_GL_FRAMEBUFFER_SRGB_CAPABLE", "SDL_GL_CONTEXT_RELEASE_BEHAVIOR",
63    "SDL_GL_CONTEXT_RESET_NOTIFICATION", "SDL_GL_CONTEXT_NO_ERROR",
64
65    "SDL_GLprofile",
66    "SDL_GL_CONTEXT_PROFILE_CORE",
67    "SDL_GL_CONTEXT_PROFILE_COMPATIBILITY",
68    "SDL_GL_CONTEXT_PROFILE_ES",
69
70    "SDL_GLcontextFlag",
71    "SDL_GL_CONTEXT_DEBUG_FLAG",
72    "SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG",
73    "SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG",
74    "SDL_GL_CONTEXT_RESET_ISOLATION_FLAG",
75
76    "SDL_GLcontextReleaseFlag",
77    "SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE",
78    "SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH",
79
80    "SDL_GLContextResetNotification",
81    "SDL_GL_CONTEXT_RESET_NO_NOTIFICATION",
82    "SDL_GL_CONTEXT_RESET_LOSE_CONTEXT",
83
84    "SDL_HitTestResult",
85    "SDL_HITTEST_NORMAL", "SDL_HITTEST_DRAGGABLE",
86    "SDL_HITTEST_RESIZE_TOPLEFT", "SDL_HITTEST_RESIZE_TOP",
87    "SDL_HITTEST_RESIZE_TOPRIGHT", "SDL_HITTEST_RESIZE_RIGHT",
88    "SDL_HITTEST_RESIZE_BOTTOMRIGHT", "SDL_HITTEST_RESIZE_BOTTOM",
89    "SDL_HITTEST_RESIZE_BOTTOMLEFT", "SDL_HITTEST_RESIZE_LEFT",
90
91    # Macro Functions
92    "SDL_WINDOWPOS_UNDEFINED_MASK", "SDL_WINDOWPOS_UNDEFINED_DISPLAY",
93    "SDL_WINDOWPOS_UNDEFINED", "SDL_WINDOWPOS_ISUNDEFINED",
94    "SDL_WINDOWPOS_CENTERED_MASK", "SDL_WINDOWPOS_CENTERED_DISPLAY",
95    "SDL_WINDOWPOS_CENTERED", "SDL_WINDOWPOS_ISCENTERED",
96
97    # Functions
98    "SDL_GetNumVideoDrivers", "SDL_GetVideoDriver",
99    "SDL_VideoInit", "SDL_VideoQuit",
100    "SDL_GetCurrentVideoDriver", "SDL_GetNumVideoDisplays",
101    "SDL_GetDisplayName", "SDL_GetDisplayBounds",
102    "SDL_GetDisplayOrientation", "SDL_GetNumDisplayModes",
103    "SDL_GetDisplayMode",
104    "SDL_GetDesktopDisplayMode", "SDL_GetCurrentDisplayMode",
105    "SDL_GetClosestDisplayMode", "SDL_GetWindowDisplayIndex",
106    "SDL_SetWindowDisplayMode", "SDL_GetWindowDisplayMode",
107    "SDL_GetWindowPixelFormat", "SDL_CreateWindow",
108    "SDL_CreateWindowFrom", "SDL_GetWindowID", "SDL_GetWindowFromID",
109    "SDL_GetWindowFlags", "SDL_SetWindowTitle", "SDL_GetWindowTitle",
110    "SDL_SetWindowIcon", "SDL_SetWindowData", "SDL_GetWindowData",
111    "SDL_SetWindowPosition", "SDL_GetWindowPosition",
112    "SDL_SetWindowSize", "SDL_GetWindowSize",
113    "SDL_SetWindowMinimumSize", "SDL_GetWindowMinimumSize",
114    "SDL_SetWindowMaximumSize", "SDL_GetWindowMaximumSize",
115    "SDL_SetWindowBordered", "SDL_ShowWindow", "SDL_HideWindow",
116    "SDL_RaiseWindow", "SDL_MaximizeWindow", "SDL_MinimizeWindow",
117    "SDL_RestoreWindow", "SDL_SetWindowFullscreen",
118    "SDL_GetWindowSurface", "SDL_UpdateWindowSurface",
119    "SDL_UpdateWindowSurfaceRects", "SDL_SetWindowGrab",
120    "SDL_SetWindowKeyboardGrab", "SDL_SetWindowMouseGrab",
121    "SDL_GetWindowGrab", "SDL_GetWindowKeyboardGrab",
122    "SDL_GetWindowMouseGrab", "SDL_GetGrabbedWindow",
123    "SDL_SetWindowBrightness", "SDL_GetWindowBrightness",
124    "SDL_SetWindowGammaRamp", "SDL_GetWindowGammaRamp",
125    "SDL_FlashWindow", "SDL_DestroyWindow",
126    "SDL_DisableScreenSaver", "SDL_IsScreenSaverEnabled",
127    "SDL_EnableScreenSaver",
128    "SDL_SetWindowHitTest", "SDL_GL_LoadLibrary",
129    "SDL_GL_GetProcAddress", "SDL_GL_UnloadLibrary",
130    "SDL_GL_ExtensionSupported", "SDL_GL_SetAttribute",
131    "SDL_GL_GetAttribute", "SDL_GL_CreateContext",
132    "SDL_GL_MakeCurrent", "SDL_GL_SetSwapInterval",
133    "SDL_GL_GetSwapInterval", "SDL_GL_SwapWindow",
134    "SDL_GL_GetDrawableSize", "SDL_GL_GetCurrentWindow",
135    "SDL_GL_GetCurrentContext", "SDL_GL_DeleteContext",
136    "SDL_GL_ResetAttributes",
137    "SDL_GetDisplayDPI", "SDL_GetDisplayUsableBounds",
138    "SDL_GetWindowBordersSize", "SDL_GetWindowOpacity",
139    "SDL_SetWindowOpacity", "SDL_SetWindowInputFocus",
140    "SDL_SetWindowModalFor", "SDL_SetWindowResizable",
141    "SDL_SetWindowAlwaysOnTop",
142
143    # Callback Functions
144    "SDL_HitTest"
145]
146
147
148class SDL_DisplayMode(Structure):
149    _fields_ = [("format", Uint32),
150                ("w", c_int),
151                ("h", c_int),
152                ("refresh_rate", c_int),
153                ("driverdata", c_void_p)
154               ]
155
156    def __init__(self, format_=0, w=0, h=0, refresh_rate=0):
157        super(SDL_DisplayMode, self).__init__()
158        self.format = format_
159        self.w = w
160        self.h = h
161        self.refresh_rate = refresh_rate
162
163    def __repr__(self):
164        return "SDL_DisplayMode(format=%d, w=%d, h=%d, refresh_rate=%d)" % \
165            (self.format, self.w, self.h, self.refresh_rate)
166
167    def __eq__(self, mode):
168        return self.format == mode.format and self.w == mode.w and \
169            self.h == mode.h and self.refresh_rate == mode.refresh_rate
170
171    def __ne__(self, mode):
172        return self.format != mode.format or self.w != mode.w or \
173            self.h != mode.h or self.refresh_rate != mode.refresh_rate
174
175
176class SDL_Window(c_void_p):
177    pass
178
179
180SDL_WindowFlags = c_int
181
182SDL_WINDOW_FULLSCREEN = 0x00000001
183SDL_WINDOW_OPENGL = 0x00000002
184SDL_WINDOW_SHOWN = 0x00000004
185SDL_WINDOW_HIDDEN = 0x00000008
186SDL_WINDOW_BORDERLESS = 0x00000010
187SDL_WINDOW_RESIZABLE = 0x00000020
188SDL_WINDOW_MINIMIZED = 0x00000040
189SDL_WINDOW_MAXIMIZED = 0x00000080
190SDL_WINDOW_MOUSE_GRABBED = 0x00000100
191SDL_WINDOW_INPUT_GRABBED = SDL_WINDOW_MOUSE_GRABBED  # for < 2.0.16
192SDL_WINDOW_INPUT_FOCUS = 0x00000200
193SDL_WINDOW_MOUSE_FOCUS = 0x00000400
194SDL_WINDOW_FULLSCREEN_DESKTOP = (SDL_WINDOW_FULLSCREEN | 0x00001000)
195SDL_WINDOW_FOREIGN = 0x00000800
196SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000
197SDL_WINDOW_MOUSE_CAPTURE = 0x00004000
198SDL_WINDOW_ALWAYS_ON_TOP = 0x00008000
199SDL_WINDOW_SKIP_TASKBAR  = 0x00010000
200SDL_WINDOW_UTILITY = 0x00020000
201SDL_WINDOW_TOOLTIP = 0x00040000
202SDL_WINDOW_POPUP_MENU = 0x00080000
203SDL_WINDOW_KEYBOARD_GRABBED = 0x00100000
204SDL_WINDOW_VULKAN = 0x10000000
205SDL_WINDOW_METAL = 0x20000000
206
207SDL_WINDOWPOS_UNDEFINED_MASK = 0x1FFF0000
208SDL_WINDOWPOS_UNDEFINED_DISPLAY = lambda x: (SDL_WINDOWPOS_UNDEFINED_MASK | x)
209SDL_WINDOWPOS_UNDEFINED = SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
210SDL_WINDOWPOS_ISUNDEFINED = lambda x: ((x & 0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
211
212SDL_WINDOWPOS_CENTERED_MASK = 0x2FFF0000
213SDL_WINDOWPOS_CENTERED_DISPLAY = lambda x: (SDL_WINDOWPOS_CENTERED_MASK | x)
214SDL_WINDOWPOS_CENTERED = SDL_WINDOWPOS_CENTERED_DISPLAY(0)
215SDL_WINDOWPOS_ISCENTERED = lambda x: ((x & 0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
216
217
218SDL_WindowEventID = c_int
219
220SDL_WINDOWEVENT_NONE = 0
221SDL_WINDOWEVENT_SHOWN = 1
222SDL_WINDOWEVENT_HIDDEN = 2
223SDL_WINDOWEVENT_EXPOSED = 3
224SDL_WINDOWEVENT_MOVED = 4
225SDL_WINDOWEVENT_RESIZED = 5
226SDL_WINDOWEVENT_SIZE_CHANGED = 6
227SDL_WINDOWEVENT_MINIMIZED = 7
228SDL_WINDOWEVENT_MAXIMIZED = 8
229SDL_WINDOWEVENT_RESTORED = 9
230SDL_WINDOWEVENT_ENTER = 10
231SDL_WINDOWEVENT_LEAVE = 11
232SDL_WINDOWEVENT_FOCUS_GAINED = 12
233SDL_WINDOWEVENT_FOCUS_LOST = 13
234SDL_WINDOWEVENT_CLOSE = 14
235SDL_WINDOWEVENT_TAKE_FOCUS = 15
236SDL_WINDOWEVENT_HIT_TEST = 16
237
238
239SDL_DisplayEventID = c_int
240
241SDL_DISPLAYEVENT_NONE = 0
242SDL_DISPLAYEVENT_ORIENTATION = 1
243SDL_DISPLAYEVENT_CONNECTED = 2
244SDL_DISPLAYEVENT_DISCONNECTED = 3
245
246
247SDL_DisplayOrientation = c_int
248
249SDL_ORIENTATION_UNKNOWN = 0
250SDL_ORIENTATION_LANDSCAPE = 1
251SDL_ORIENTATION_LANDSCAPE_FLIPPED = 2
252SDL_ORIENTATION_PORTRAIT = 3
253SDL_ORIENTATION_PORTRAIT_FLIPPED = 4
254
255
256SDL_FlashOperation = c_int
257
258SDL_FLASH_CANCEL = 0
259SDL_FLASH_BRIEFLY = 1
260SDL_FLASH_UNTIL_FOCUSED = 2
261
262
263SDL_GLContext = c_void_p
264
265
266SDL_GLattr = c_int
267
268SDL_GL_RED_SIZE = 0
269SDL_GL_GREEN_SIZE = 1
270SDL_GL_BLUE_SIZE = 2
271SDL_GL_ALPHA_SIZE = 3
272SDL_GL_BUFFER_SIZE = 4
273SDL_GL_DOUBLEBUFFER = 5
274SDL_GL_DEPTH_SIZE = 6
275SDL_GL_STENCIL_SIZE = 7
276SDL_GL_ACCUM_RED_SIZE = 8
277SDL_GL_ACCUM_GREEN_SIZE = 9
278SDL_GL_ACCUM_BLUE_SIZE = 10
279SDL_GL_ACCUM_ALPHA_SIZE = 11
280SDL_GL_STEREO = 12
281SDL_GL_MULTISAMPLEBUFFERS = 13
282SDL_GL_MULTISAMPLESAMPLES = 14
283SDL_GL_ACCELERATED_VISUAL = 15
284SDL_GL_RETAINED_BACKING = 16
285SDL_GL_CONTEXT_MAJOR_VERSION = 17
286SDL_GL_CONTEXT_MINOR_VERSION = 18
287SDL_GL_CONTEXT_EGL = 19
288SDL_GL_CONTEXT_FLAGS = 20
289SDL_GL_CONTEXT_PROFILE_MASK = 21
290SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22
291SDL_GL_FRAMEBUFFER_SRGB_CAPABLE = 23
292SDL_GL_CONTEXT_RELEASE_BEHAVIOR = 24
293SDL_GL_CONTEXT_RESET_NOTIFICATION = 25
294SDL_GL_CONTEXT_NO_ERROR = 26
295
296
297SDL_GLprofile = c_int
298
299SDL_GL_CONTEXT_PROFILE_CORE = 0x0001
300SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002
301SDL_GL_CONTEXT_PROFILE_ES = 0x0004
302
303
304SDL_GLcontextFlag = c_int
305
306SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001
307SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002
308SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004
309SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008
310
311
312SDL_GLcontextReleaseFlag = c_int
313
314SDL_GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0x0000
315SDL_GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x0001
316
317
318SDL_GLContextResetNotification = c_int
319
320SDL_GL_CONTEXT_RESET_NO_NOTIFICATION = 0x0000
321SDL_GL_CONTEXT_RESET_LOSE_CONTEXT = 0x0001
322
323
324SDL_HitTestResult = c_int
325
326SDL_HITTEST_NORMAL = 0
327SDL_HITTEST_DRAGGABLE = 1
328SDL_HITTEST_RESIZE_TOPLEFT = 2
329SDL_HITTEST_RESIZE_TOP = 3
330SDL_HITTEST_RESIZE_TOPRIGHT = 4
331SDL_HITTEST_RESIZE_RIGHT = 5
332SDL_HITTEST_RESIZE_BOTTOMRIGHT = 6
333SDL_HITTEST_RESIZE_BOTTOM = 7
334SDL_HITTEST_RESIZE_BOTTOMLEFT = 8
335SDL_HITTEST_RESIZE_LEFT = 9
336
337
338SDL_HitTest = CFUNCTYPE(SDL_HitTestResult, POINTER(SDL_Window), POINTER(SDL_Point), c_void_p)
339
340SDL_GetNumVideoDrivers = _bind("SDL_GetNumVideoDrivers", None, c_int)
341SDL_GetVideoDriver = _bind("SDL_GetVideoDriver", [c_int], c_char_p)
342SDL_VideoInit = _bind("SDL_VideoInit", [c_char_p], c_int)
343SDL_VideoQuit = _bind("SDL_VideoQuit")
344SDL_GetCurrentVideoDriver = _bind("SDL_GetCurrentVideoDriver", None, c_char_p)
345SDL_GetNumVideoDisplays = _bind("SDL_GetNumVideoDisplays", None, c_int)
346SDL_GetDisplayName = _bind("SDL_GetDisplayName", [c_int], c_char_p)
347SDL_GetDisplayBounds = _bind("SDL_GetDisplayBounds", [c_int, POINTER(SDL_Rect)], c_int)
348SDL_GetDisplayOrientation = _bind("SDL_GetDisplayOrientation", [c_int], SDL_DisplayOrientation, added='2.0.9')
349SDL_GetNumDisplayModes = _bind("SDL_GetNumDisplayModes", [c_int], c_int)
350SDL_GetDisplayMode = _bind("SDL_GetDisplayMode", [c_int, c_int, POINTER(SDL_DisplayMode)], c_int)
351SDL_GetDesktopDisplayMode = _bind("SDL_GetDesktopDisplayMode", [c_int, POINTER(SDL_DisplayMode)], c_int)
352SDL_GetCurrentDisplayMode = _bind("SDL_GetCurrentDisplayMode", [c_int, POINTER(SDL_DisplayMode)], c_int)
353SDL_GetClosestDisplayMode = _bind("SDL_GetClosestDisplayMode", [c_int, POINTER(SDL_DisplayMode), POINTER(SDL_DisplayMode)], POINTER(SDL_DisplayMode))
354SDL_GetWindowDisplayIndex = _bind("SDL_GetWindowDisplayIndex", [POINTER(SDL_Window)], c_int)
355SDL_SetWindowDisplayMode = _bind("SDL_SetWindowDisplayMode", [POINTER(SDL_Window), POINTER(SDL_DisplayMode)], c_int)
356SDL_GetWindowDisplayMode = _bind("SDL_GetWindowDisplayMode", [POINTER(SDL_Window), POINTER(SDL_DisplayMode)], c_int)
357SDL_GetWindowPixelFormat = _bind("SDL_GetWindowPixelFormat", [POINTER(SDL_Window)], Uint32)
358SDL_CreateWindow = _bind("SDL_CreateWindow", [c_char_p, c_int, c_int, c_int, c_int, Uint32], POINTER(SDL_Window))
359SDL_CreateWindowFrom = _bind("SDL_CreateWindowFrom", [c_void_p], POINTER(SDL_Window))
360SDL_GetWindowID = _bind("SDL_GetWindowID", [POINTER(SDL_Window)], Uint32)
361SDL_GetWindowFromID = _bind("SDL_GetWindowFromID", [Uint32], POINTER(SDL_Window))
362SDL_GetWindowFlags = _bind("SDL_GetWindowFlags", [POINTER(SDL_Window)], Uint32)
363SDL_SetWindowTitle = _bind("SDL_SetWindowTitle", [POINTER(SDL_Window), c_char_p])
364SDL_GetWindowTitle = _bind("SDL_GetWindowTitle", [POINTER(SDL_Window)], c_char_p)
365SDL_SetWindowIcon = _bind("SDL_SetWindowIcon", [POINTER(SDL_Window), POINTER(SDL_Surface)])
366SDL_SetWindowData = _bind("SDL_SetWindowData", [POINTER(SDL_Window), c_char_p, POINTER(py_object)], POINTER(py_object))
367SDL_GetWindowData = _bind("SDL_GetWindowData", [POINTER(SDL_Window), c_char_p], POINTER(py_object))
368SDL_SetWindowPosition = _bind("SDL_SetWindowPosition", [POINTER(SDL_Window), c_int, c_int])
369SDL_GetWindowPosition = _bind("SDL_GetWindowPosition", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int)])
370SDL_SetWindowSize = _bind("SDL_SetWindowSize", [POINTER(SDL_Window), c_int, c_int])
371SDL_GetWindowSize = _bind("SDL_GetWindowSize", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int)])
372SDL_SetWindowMinimumSize = _bind("SDL_SetWindowMinimumSize", [POINTER(SDL_Window), c_int, c_int])
373SDL_GetWindowMinimumSize = _bind("SDL_GetWindowMinimumSize", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int)])
374SDL_SetWindowMaximumSize = _bind("SDL_SetWindowMaximumSize", [POINTER(SDL_Window), c_int, c_int])
375SDL_GetWindowMaximumSize = _bind("SDL_GetWindowMaximumSize", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int)])
376SDL_SetWindowBordered = _bind("SDL_SetWindowBordered", [POINTER(SDL_Window), SDL_bool])
377SDL_ShowWindow = _bind("SDL_ShowWindow", [POINTER(SDL_Window)])
378SDL_HideWindow = _bind("SDL_HideWindow", [POINTER(SDL_Window)])
379SDL_RaiseWindow = _bind("SDL_RaiseWindow", [POINTER(SDL_Window)])
380SDL_MaximizeWindow = _bind("SDL_MaximizeWindow", [POINTER(SDL_Window)])
381SDL_MinimizeWindow = _bind("SDL_MinimizeWindow", [POINTER(SDL_Window)])
382SDL_RestoreWindow = _bind("SDL_RestoreWindow", [POINTER(SDL_Window)])
383SDL_SetWindowFullscreen = _bind("SDL_SetWindowFullscreen", [POINTER(SDL_Window), Uint32], c_int)
384SDL_GetWindowSurface = _bind("SDL_GetWindowSurface", [POINTER(SDL_Window)], POINTER(SDL_Surface))
385SDL_UpdateWindowSurface = _bind("SDL_UpdateWindowSurface", [POINTER(SDL_Window)], c_int)
386SDL_UpdateWindowSurfaceRects = _bind("SDL_UpdateWindowSurfaceRects", [POINTER(SDL_Window), POINTER(SDL_Rect), c_int], c_int)
387SDL_SetWindowGrab = _bind("SDL_SetWindowGrab", [POINTER(SDL_Window), SDL_bool])
388SDL_SetWindowKeyboardGrab = _bind("SDL_SetWindowKeyboardGrab", [POINTER(SDL_Window), SDL_bool], added='2.0.16')
389SDL_SetWindowMouseGrab = _bind("SDL_SetWindowMouseGrab", [POINTER(SDL_Window), SDL_bool], added='2.0.16')
390SDL_GetWindowGrab = _bind("SDL_GetWindowGrab", [POINTER(SDL_Window)], SDL_bool)
391SDL_GetWindowKeyboardGrab = _bind("SDL_GetWindowKeyboardGrab", [POINTER(SDL_Window)], SDL_bool, added='2.0.16')
392SDL_GetWindowMouseGrab = _bind("SDL_GetWindowMouseGrab", [POINTER(SDL_Window)], SDL_bool, added='2.0.16')
393SDL_GetGrabbedWindow = _bind("SDL_GetGrabbedWindow", None, POINTER(SDL_Window))
394SDL_SetWindowBrightness = _bind("SDL_SetWindowBrightness", [POINTER(SDL_Window), c_float], c_int)
395SDL_GetWindowBrightness = _bind("SDL_GetWindowBrightness", [POINTER(SDL_Window)], c_float)
396SDL_SetWindowGammaRamp = _bind("SDL_SetWindowGammaRamp", [POINTER(SDL_Window), POINTER(Uint16), POINTER(Uint16), POINTER(Uint16)], c_int)
397SDL_GetWindowGammaRamp = _bind("SDL_GetWindowGammaRamp", [POINTER(SDL_Window), POINTER(Uint16), POINTER(Uint16), POINTER(Uint16)], c_int)
398SDL_FlashWindow = _bind("SDL_FlashWindow", [POINTER(SDL_Window), SDL_FlashOperation], c_int, added='2.0.16')
399SDL_DestroyWindow = _bind("SDL_DestroyWindow", [POINTER(SDL_Window)])
400SDL_IsScreenSaverEnabled = _bind("SDL_IsScreenSaverEnabled", None, SDL_bool)
401SDL_EnableScreenSaver = _bind("SDL_EnableScreenSaver")
402SDL_DisableScreenSaver = _bind("SDL_DisableScreenSaver")
403SDL_SetWindowHitTest = _bind("SDL_SetWindowHitTest", [POINTER(SDL_Window), SDL_HitTest, c_void_p], c_int)
404SDL_GetDisplayDPI = _bind("SDL_GetDisplayDPI", [c_int, POINTER(c_float), POINTER(c_float), POINTER(c_float)], c_int)
405SDL_GetDisplayUsableBounds = _bind("SDL_GetDisplayUsableBounds", [c_int, POINTER(SDL_Rect)], c_int)
406SDL_GetWindowBordersSize = _bind("SDL_GetWindowBordersSize", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int), POINTER(c_int), POINTER(c_int)], c_int)
407SDL_GetWindowOpacity = _bind("SDL_GetWindowOpacity", [POINTER(SDL_Window), POINTER(c_float)], c_int)
408SDL_SetWindowOpacity = _bind("SDL_SetWindowOpacity", [POINTER(SDL_Window), c_float], c_int)
409SDL_SetWindowInputFocus = _bind("SDL_SetWindowInputFocus", [POINTER(SDL_Window)], c_int)
410SDL_SetWindowModalFor = _bind("SDL_SetWindowModalFor", [POINTER(SDL_Window), POINTER(SDL_Window)], c_int)
411SDL_SetWindowResizable = _bind("SDL_SetWindowResizable", [POINTER(SDL_Window), SDL_bool])
412SDL_SetWindowAlwaysOnTop = _bind("SDL_SetWindowAlwaysOnTop", [POINTER(SDL_Window), SDL_bool], added='2.0.16')
413
414SDL_GL_LoadLibrary = _bind("SDL_GL_LoadLibrary", [c_char_p], c_int)
415SDL_GL_GetProcAddress = _bind("SDL_GL_GetProcAddress", [c_char_p], c_void_p)
416SDL_GL_UnloadLibrary = _bind("SDL_GL_UnloadLibrary")
417SDL_GL_ExtensionSupported = _bind("SDL_GL_ExtensionSupported", [c_char_p], SDL_bool)
418SDL_GL_SetAttribute = _bind("SDL_GL_SetAttribute", [SDL_GLattr, c_int], c_int)
419SDL_GL_GetAttribute = _bind("SDL_GL_GetAttribute", [SDL_GLattr, POINTER(c_int)], c_int)
420SDL_GL_CreateContext = _bind("SDL_GL_CreateContext", [POINTER(SDL_Window)], SDL_GLContext)
421SDL_GL_GetCurrentWindow = _bind("SDL_GL_GetCurrentWindow", None, POINTER(SDL_Window))
422SDL_GL_MakeCurrent = _bind("SDL_GL_MakeCurrent", [POINTER(SDL_Window), SDL_GLContext], c_int)
423SDL_GL_GetCurrentContext = _bind("SDL_GL_GetCurrentContext", None, SDL_GLContext)
424SDL_GL_SetSwapInterval = _bind("SDL_GL_SetSwapInterval", [c_int], c_int)
425SDL_GL_GetSwapInterval = _bind("SDL_GL_GetSwapInterval", None, c_int)
426SDL_GL_SwapWindow = _bind("SDL_GL_SwapWindow", [POINTER(SDL_Window)])
427SDL_GL_DeleteContext = _bind("SDL_GL_DeleteContext", [SDL_GLContext])
428SDL_GL_GetDrawableSize = _bind("SDL_GL_GetDrawableSize", [POINTER(SDL_Window), POINTER(c_int), POINTER(c_int)])
429SDL_GL_ResetAttributes = _bind("SDL_GL_ResetAttributes")
430