Commits

Leonard Ritter committed f9e58ba

- refactored internals into separate module
- builder broken at the moment, waiting for cffi fixes

  • Participants
  • Parent commits 60fb5c7

Comments (0)

Files changed (7)

File predefs/sdl.pypredef

-def SDL_ReadLE16(*argv):
-    """SDL_ReadLE16"""
+def SDL_HideWindow(*argv):
+    """SDL_HideWindow"""
+
+def SDL_LowerBlitScaled(*argv):
+    """SDL_LowerBlitScaled"""
+
+def SDL_SetWindowTitle(*argv):
+    """SDL_SetWindowTitle"""
+
+def SDL_SetSurfaceRLE(*argv):
+    """SDL_SetSurfaceRLE"""
+
+SDL_WINDOWEVENT_NONE = int
+def SDL_ReadBE32(*argv):
+    """SDL_ReadBE32"""
+
+SDL_GL_ACCELERATED_VISUAL = int
+def SDL_GetNumVideoDrivers(*argv):
+    """SDL_GetNumVideoDrivers"""
+
+def SDL_RWFromFP(*argv):
+    """SDL_RWFromFP"""
+
+def SDL_UnionRect(*argv):
+    """SDL_UnionRect"""
+
+def SDL_MasksToPixelFormatEnum(*argv):
+    """SDL_MasksToPixelFormatEnum"""
+
+def SDL_GetNumVideoDisplays(*argv):
+    """SDL_GetNumVideoDisplays"""
+
+def SDL_SetWindowBrightness(*argv):
+    """SDL_SetWindowBrightness"""
+
+def SDL_GL_UnloadLibrary(*argv):
+    """SDL_GL_UnloadLibrary"""
+
+SDL_WINDOWEVENT_MOVED = int
+SDL_GL_DOUBLEBUFFER = int
+def SDL_GL_GetProcAddress(*argv):
+    """SDL_GL_GetProcAddress"""
+
+def SDL_UpdateWindowSurface(*argv):
+    """SDL_UpdateWindowSurface"""
+
+SDL_GL_SHARE_WITH_CURRENT_CONTEXT = int
+def SDL_ClearError(*argv):
+    """SDL_ClearError"""
+
+def SDL_GetWindowData(*argv):
+    """SDL_GetWindowData"""
+
+def SDL_GL_GetSwapInterval(*argv):
+    """SDL_GL_GetSwapInterval"""
+
+SDL_WINDOW_INPUT_FOCUS = int
+def SDL_SetWindowGrab(*argv):
+    """SDL_SetWindowGrab"""
+
+def SDL_SetSurfaceColorMod(*argv):
+    """SDL_SetSurfaceColorMod"""
+
+def SDL_GetCurrentVideoDriver(*argv):
+    """SDL_GetCurrentVideoDriver"""
+
+SDL_WINDOW_BORDERLESS = int
+SDL_GL_BLUE_SIZE = int
+def SDL_SetWindowData(*argv):
+    """SDL_SetWindowData"""
+
+def SDL_WasInit(*argv):
+    """SDL_WasInit"""
+
+def SDL_ReadLE64(*argv):
+    """SDL_ReadLE64"""
+
+SDL_WINDOWEVENT_HIDDEN = int
+SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = int
+SDL_WINDOWEVENT_SIZE_CHANGED = int
+SDL_EFREAD = int
+SDL_INIT_VIDEO = int
+SDL_BLENDMODE_ADD = int
+SDL_INIT_HAPTIC = int
+def SDL_SetClipRect(*argv):
+    """SDL_SetClipRect"""
+
+def SDL_AllocFormat(*argv):
+    """SDL_AllocFormat"""
+
+def SDL_HasIntersection(*argv):
+    """SDL_HasIntersection"""
+
+SDL_DONTFREE = int
+def SDL_SetError(*argv):
+    """SDL_SetError"""
+
+def SDL_SetSurfaceBlendMode(*argv):
+    """SDL_SetSurfaceBlendMode"""
+
+def SDL_IsScreenSaverEnabled(*argv):
+    """SDL_IsScreenSaverEnabled"""
+
+def SDL_GetWindowPixelFormat(*argv):
+    """SDL_GetWindowPixelFormat"""
+
+SDL_WINDOWEVENT_MAXIMIZED = int
+def SDL_RaiseWindow(*argv):
+    """SDL_RaiseWindow"""
+
+SDL_BLENDMODE_MOD = int
+SDL_WINDOWEVENT_RESIZED = int
+def SDL_RWFromConstMem(*argv):
+    """SDL_RWFromConstMem"""
+
+SDL_INIT_AUDIO = int
+SDL_UNSUPPORTED = int
+def SDL_SetColorKey(*argv):
+    """SDL_SetColorKey"""
+
+SDL_GL_ACCUM_ALPHA_SIZE = int
+def SDL_GetWindowSurface(*argv):
+    """SDL_GetWindowSurface"""
+
+def SDL_SetWindowSize(*argv):
+    """SDL_SetWindowSize"""
+
+def SDL_SetWindowPosition(*argv):
+    """SDL_SetWindowPosition"""
+
+SDL_GL_ACCUM_RED_SIZE = int
+def SDL_GetWindowTitle(*argv):
+    """SDL_GetWindowTitle"""
+
+SDL_GL_CONTEXT_FLAGS = int
+def SDL_DestroyWindow(*argv):
+    """SDL_DestroyWindow"""
+
+def SDL_FillRect(*argv):
+    """SDL_FillRect"""
+
+def SDL_GetWindowID(*argv):
+    """SDL_GetWindowID"""
+
+def SDL_LockSurface(*argv):
+    """SDL_LockSurface"""
+
+SDL_WINDOWEVENT_ENTER = int
+def SDL_GetWindowFlags(*argv):
+    """SDL_GetWindowFlags"""
+
+SDL_GL_CONTEXT_MAJOR_VERSION = int
+def SDL_GL_CreateContext(*argv):
+    """SDL_GL_CreateContext"""
+
+SDL_INIT_JOYSTICK = int
+SDL_WINDOWEVENT_RESTORED = int
+def SDL_VideoQuit(*argv):
+    """SDL_VideoQuit"""
+
+SDL_GL_MULTISAMPLEBUFFERS = int
+SDL_BlitScaled = long
+SDL_GL_CONTEXT_MINOR_VERSION = int
+SDL_GL_ACCUM_GREEN_SIZE = int
+def SDL_WriteLE32(*argv):
+    """SDL_WriteLE32"""
+
+SDL_EFSEEK = int
+def SDL_GetWindowGammaRamp(*argv):
+    """SDL_GetWindowGammaRamp"""
 
 def SDL_LowerBlit(*argv):
     """SDL_LowerBlit"""
 
+SDL_WINDOW_MOUSE_FOCUS = int
+SDL_WINDOWPOS_UNDEFINED_MASK = int
+def SDL_SetWindowDisplayMode(*argv):
+    """SDL_SetWindowDisplayMode"""
+
+SDL_GL_CONTEXT_PROFILE_MASK = int
+SDL_SWSURFACE = int
+def SDL_GetColorKey(*argv):
+    """SDL_GetColorKey"""
+
+def SDL_GetWindowPosition(*argv):
+    """SDL_GetWindowPosition"""
+
+SDL_LASTERROR = int
+SDL_GL_RED_SIZE = int
+SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = int
+SDL_GL_GREEN_SIZE = int
+SDL_WINDOWEVENT_CLOSE = int
+def SDL_ShowWindow(*argv):
+    """SDL_ShowWindow"""
+
+SDL_GL_CONTEXT_EGL = int
+SDL_WINDOW_OPENGL = int
+SDL_WINDOW_FOREIGN = int
+def SDL_GL_ExtensionSupported(*argv):
+    """SDL_GL_ExtensionSupported"""
+
+def SDL_GetClipRect(*argv):
+    """SDL_GetClipRect"""
+
+def SDL_Error(*argv):
+    """SDL_Error"""
+
+def SDL_WriteBE16(*argv):
+    """SDL_WriteBE16"""
+
+def SDL_GetWindowDisplayMode(*argv):
+    """SDL_GetWindowDisplayMode"""
+
+SDL_GL_RETAINED_BACKING = int
+SDL_INIT_TIMER = int
+def SDL_ReadBE16(*argv):
+    """SDL_ReadBE16"""
+
+def SDL_ConvertSurface(*argv):
+    """SDL_ConvertSurface"""
+
+def SDL_WriteBE64(*argv):
+    """SDL_WriteBE64"""
+
+def SDL_ReadLE32(*argv):
+    """SDL_ReadLE32"""
+
+SDL_WINDOW_INPUT_GRABBED = int
 def SDL_GetPixelFormatName(*argv):
     """SDL_GetPixelFormatName"""
 
-def SDL_UnionRect(*argv):
-    """SDL_UnionRect"""
+def SDL_SetSurfacePalette(*argv):
+    """SDL_SetSurfacePalette"""
+
+SDL_WINDOWEVENT_FOCUS_LOST = int
+def SDL_GetWindowBrightness(*argv):
+    """SDL_GetWindowBrightness"""
+
+def SDL_SetPaletteColors(*argv):
+    """SDL_SetPaletteColors"""
+
+def SDL_CreateRGBSurfaceFrom(*argv):
+    """SDL_CreateRGBSurfaceFrom"""
+
+SDL_PREALLOC = int
+def SDL_GL_GetAttribute(*argv):
+    """SDL_GL_GetAttribute"""
+
+def SDL_GetNumDisplayModes(*argv):
+    """SDL_GetNumDisplayModes"""
+
+def SDL_SetWindowGammaRamp(*argv):
+    """SDL_SetWindowGammaRamp"""
+
+def SDL_EnclosePoints(*argv):
+    """SDL_EnclosePoints"""
+
+def SDL_RestoreWindow(*argv):
+    """SDL_RestoreWindow"""
+
+def SDL_SetWindowIcon(*argv):
+    """SDL_SetWindowIcon"""
+
+def SDL_GL_SetAttribute(*argv):
+    """SDL_GL_SetAttribute"""
+
+def SDL_GetRGBA(*argv):
+    """SDL_GetRGBA"""
+
+def SDL_GL_LoadLibrary(*argv):
+    """SDL_GL_LoadLibrary"""
+
+def SDL_UnlockSurface(*argv):
+    """SDL_UnlockSurface"""
+
+def SDL_RWFromFile(*argv):
+    """SDL_RWFromFile"""
+
+SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = int
+SDL_ENOMEM = int
+SDL_BLENDMODE_NONE = int
+def SDL_SetWindowFullscreen(*argv):
+    """SDL_SetWindowFullscreen"""
+
+def SDL_InitSubSystem(*argv):
+    """SDL_InitSubSystem"""
+
+def SDL_FillRects(*argv):
+    """SDL_FillRects"""
+
+def SDL_GetError(*argv):
+    """SDL_GetError"""
+
+def SDL_UpperBlitScaled(*argv):
+    """SDL_UpperBlitScaled"""
+
+SDL_INIT_NOPARACHUTE = int
+def SDL_GetWindowSize(*argv):
+    """SDL_GetWindowSize"""
+
+SDL_ALPHA_OPAQUE = int
+def SDL_GetSurfaceBlendMode(*argv):
+    """SDL_GetSurfaceBlendMode"""
+
+def SDL_MinimizeWindow(*argv):
+    """SDL_MinimizeWindow"""
+
+SDL_WINDOWEVENT_SHOWN = int
+def SDL_ReadBE64(*argv):
+    """SDL_ReadBE64"""
+
+def SDL_ReadLE16(*argv):
+    """SDL_ReadLE16"""
+
+def SDL_GL_SetSwapInterval(*argv):
+    """SDL_GL_SetSwapInterval"""
+
+def SDL_EnableScreenSaver(*argv):
+    """SDL_EnableScreenSaver"""
+
+def SDL_GetCurrentDisplayMode(*argv):
+    """SDL_GetCurrentDisplayMode"""
+
+SDL_WINDOW_FULLSCREEN = int
+SDL_WINDOWEVENT_MINIMIZED = int
+SDL_WINDOW_RESIZABLE = int
+def SDL_GetSurfaceColorMod(*argv):
+    """SDL_GetSurfaceColorMod"""
+
+def SDL_CreateWindow(*argv):
+    """SDL_CreateWindow"""
+
+SDL_WINDOWPOS_CENTERED = int
+def SDL_SaveBMP_RW(*argv):
+    """SDL_SaveBMP_RW"""
+
+SDL_WINDOW_HIDDEN = int
+SDL_GL_ALPHA_SIZE = int
+def SDL_Init(*argv):
+    """SDL_Init"""
+
+def SDL_Quit(*argv):
+    """SDL_Quit"""
+
+def SDL_CreateWindowFrom(*argv):
+    """SDL_CreateWindowFrom"""
+
+def SDL_WriteBE32(*argv):
+    """SDL_WriteBE32"""
+
+def SDL_GetRGB(*argv):
+    """SDL_GetRGB"""
+
+def SDL_UpdateWindowSurfaceRects(*argv):
+    """SDL_UpdateWindowSurfaceRects"""
+
+SDL_INIT_EVERYTHING = int
+SDL_WINDOWEVENT_EXPOSED = int
+def SDL_LoadBMP_RW(*argv):
+    """SDL_LoadBMP_RW"""
+
+def SDL_CalculateGammaRamp(*argv):
+    """SDL_CalculateGammaRamp"""
+
+def SDL_QuitSubSystem(*argv):
+    """SDL_QuitSubSystem"""
+
+SDL_WINDOWPOS_UNDEFINED = int
+def SDL_IntersectRect(*argv):
+    """SDL_IntersectRect"""
+
+def SDL_GL_SwapWindow(*argv):
+    """SDL_GL_SwapWindow"""
+
+SDL_BlitSurface = long
+def SDL_VideoInit(*argv):
+    """SDL_VideoInit"""
+
+def SDL_GetWindowGrab(*argv):
+    """SDL_GetWindowGrab"""
+
+def SDL_IntersectRectAndLine(*argv):
+    """SDL_IntersectRectAndLine"""
+
+SDL_GL_STENCIL_SIZE = int
+def SDL_GetDisplayBounds(*argv):
+    """SDL_GetDisplayBounds"""
+
+SDL_WINDOWEVENT_FOCUS_GAINED = int
+def SDL_GetWindowDisplay(*argv):
+    """SDL_GetWindowDisplay"""
+
+SDL_GL_CONTEXT_PROFILE_CORE = int
+SDL_WINDOW_MINIMIZED = int
+SDL_WINDOW_MAXIMIZED = int
+def SDL_GL_MakeCurrent(*argv):
+    """SDL_GL_MakeCurrent"""
+
+SDL_GL_MULTISAMPLESAMPLES = int
+SDL_FALSE = int
+SDL_WINDOWEVENT_LEAVE = int
+def SDL_SoftStretch(*argv):
+    """SDL_SoftStretch"""
+
+def SDL_ConvertSurfaceFormat(*argv):
+    """SDL_ConvertSurfaceFormat"""
+
+def SDL_MapRGBA(*argv):
+    """SDL_MapRGBA"""
+
+def SDL_DisableScreenSaver(*argv):
+    """SDL_DisableScreenSaver"""
+
+def SDL_SetPixelFormatPalette(*argv):
+    """SDL_SetPixelFormatPalette"""
+
+def SDL_UpperBlit(*argv):
+    """SDL_UpperBlit"""
+
+SDL_GL_STEREO = int
+def SDL_MapRGB(*argv):
+    """SDL_MapRGB"""
+
+SDL_BLENDMODE_BLEND = int
+def SDL_WriteLE16(*argv):
+    """SDL_WriteLE16"""
+
+SDL_RLEACCEL = int
+def SDL_CreateRGBSurface(*argv):
+    """SDL_CreateRGBSurface"""
+
+def SDL_FreeFormat(*argv):
+    """SDL_FreeFormat"""
+
+def SDL_GL_DeleteContext(*argv):
+    """SDL_GL_DeleteContext"""
 
 def SDL_GetClosestDisplayMode(*argv):
     """SDL_GetClosestDisplayMode"""
 
-def SDL_SetSurfaceAlphaMod(*argv):
-    """SDL_SetSurfaceAlphaMod"""
+SDL_GL_BUFFER_SIZE = int
+SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = int
+SDL_WINDOWPOS_CENTERED_MASK = int
+def SDL_AllocRW(*argv):
+    """SDL_AllocRW"""
 
-def SDL_RaiseWindow(*argv):
-    """SDL_RaiseWindow"""
+SDL_ALPHA_TRANSPARENT = int
+SDL_WINDOW_SHOWN = int
+def SDL_ConvertPixels(*argv):
+    """SDL_ConvertPixels"""
 
-def SDL_MapRGB(*argv):
-    """SDL_MapRGB"""
+def SDL_PixelFormatEnumToMasks(*argv):
+    """SDL_PixelFormatEnumToMasks"""
 
-def SDL_GetRGBA(*argv):
-    """SDL_GetRGBA"""
+def SDL_GetVideoDriver(*argv):
+    """SDL_GetVideoDriver"""
 
-SDL_INIT_AUDIO = int
-def SDL_SetSurfaceBlendMode(*argv):
-    """SDL_SetSurfaceBlendMode"""
+SDL_GL_CONTEXT_PROFILE_ES = int
+def SDL_FreePalette(*argv):
+    """SDL_FreePalette"""
 
-def SDL_SetWindowPosition(*argv):
-    """SDL_SetWindowPosition"""
+def SDL_MaximizeWindow(*argv):
+    """SDL_MaximizeWindow"""
+
+def SDL_FreeRW(*argv):
+    """SDL_FreeRW"""
+
+def SDL_GetSurfaceAlphaMod(*argv):
+    """SDL_GetSurfaceAlphaMod"""
 
 def SDL_AllocPalette(*argv):
     """SDL_AllocPalette"""
 
-def SDL_RWFromFile(*argv):
-    """SDL_RWFromFile"""
+SDL_GL_CONTEXT_DEBUG_FLAG = int
+def SDL_SetSurfaceAlphaMod(*argv):
+    """SDL_SetSurfaceAlphaMod"""
 
-def SDL_FillRect(*argv):
-    """SDL_FillRect"""
+SDL_TRUE = int
+def SDL_GetDesktopDisplayMode(*argv):
+    """SDL_GetDesktopDisplayMode"""
 
-def SDL_GL_DeleteContext(*argv):
-    """SDL_GL_DeleteContext"""
+def SDL_GetWindowFromID(*argv):
+    """SDL_GetWindowFromID"""
 
-def SDL_SetPaletteColors(*argv):
-    """SDL_SetPaletteColors"""
+SDL_GL_DEPTH_SIZE = int
+SDL_EFWRITE = int
+def SDL_FreeSurface(*argv):
+    """SDL_FreeSurface"""
+
+def SDL_RWFromMem(*argv):
+    """SDL_RWFromMem"""
+
+SDL_GL_ACCUM_BLUE_SIZE = int
+def SDL_WriteLE64(*argv):
+    """SDL_WriteLE64"""
 
 def SDL_GetDisplayMode(*argv):
     """SDL_GetDisplayMode"""
 
-SDL_WINDOWPOS_CENTERED_MASK = int
-def SDL_SetSurfacePalette(*argv):
-    """SDL_SetSurfacePalette"""
-
-def SDL_CreateWindowFrom(*argv):
-    """SDL_CreateWindowFrom"""
-
-def SDL_GL_GetAttribute(*argv):
-    """SDL_GL_GetAttribute"""
-
-def SDL_DisableScreenSaver(*argv):
-    """SDL_DisableScreenSaver"""
-
-SDL_INIT_EVERYTHING = int
-def SDL_AllocFormat(*argv):
-    """SDL_AllocFormat"""
-
-def SDL_GL_SetAttribute(*argv):
-    """SDL_GL_SetAttribute"""
-
-def SDL_GetWindowDisplay(*argv):
-    """SDL_GetWindowDisplay"""
-
-def SDL_FillRects(*argv):
-    """SDL_FillRects"""
-
-SDL_INIT_TIMER = int
-def SDL_PixelFormatEnumToMasks(*argv):
-    """SDL_PixelFormatEnumToMasks"""
-
-SDL_BlitScaled = int
-def SDL_SetWindowSize(*argv):
-    """SDL_SetWindowSize"""
-
-def SDL_GL_UnloadLibrary(*argv):
-    """SDL_GL_UnloadLibrary"""
-
-def SDL_SetSurfaceColorMod(*argv):
-    """SDL_SetSurfaceColorMod"""
-
-def SDL_QuitSubSystem(*argv):
-    """SDL_QuitSubSystem"""
-
-SDL_TRUE = int
-SDL_FALSE = int
-def SDL_IsScreenSaverEnabled(*argv):
-    """SDL_IsScreenSaverEnabled"""
-
-def SDL_GetError(*argv):
-    """SDL_GetError"""
-
-def SDL_GetWindowData(*argv):
-    """SDL_GetWindowData"""
-
-def SDL_ReadBE32(*argv):
-    """SDL_ReadBE32"""
-
-def SDL_UpdateWindowSurfaceRects(*argv):
-    """SDL_UpdateWindowSurfaceRects"""
-
-def SDL_GetSurfaceAlphaMod(*argv):
-    """SDL_GetSurfaceAlphaMod"""
-
-def SDL_GL_CreateContext(*argv):
-    """SDL_GL_CreateContext"""
-
-def SDL_CreateRGBSurface(*argv):
-    """SDL_CreateRGBSurface"""
-
-def SDL_WriteLE16(*argv):
-    """SDL_WriteLE16"""
-
-def SDL_Error(*argv):
-    """SDL_Error"""
-
-def SDL_GetDisplayBounds(*argv):
-    """SDL_GetDisplayBounds"""
-
-def SDL_UpdateWindowSurface(*argv):
-    """SDL_UpdateWindowSurface"""
-
-def SDL_EnclosePoints(*argv):
-    """SDL_EnclosePoints"""
-
-SDL_RLEACCEL = int
-SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = int
-SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = int
-SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = int
-SDL_GL_CONTEXT_DEBUG_FLAG = int
-def SDL_ConvertPixels(*argv):
-    """SDL_ConvertPixels"""
-
-def SDL_ShowWindow(*argv):
-    """SDL_ShowWindow"""
-
-def SDL_GL_LoadLibrary(*argv):
-    """SDL_GL_LoadLibrary"""
-
-def SDL_Init(*argv):
-    """SDL_Init"""
-
-def SDL_FreePalette(*argv):
-    """SDL_FreePalette"""
-
-def SDL_UpperBlit(*argv):
-    """SDL_UpperBlit"""
-
-SDL_DONTFREE = int
-def SDL_VideoInit(*argv):
-    """SDL_VideoInit"""
-
-def SDL_MapRGBA(*argv):
-    """SDL_MapRGBA"""
-
-def SDL_MasksToPixelFormatEnum(*argv):
-    """SDL_MasksToPixelFormatEnum"""
-
-def SDL_GetWindowPixelFormat(*argv):
-    """SDL_GetWindowPixelFormat"""
-
-def SDL_ReadLE32(*argv):
-    """SDL_ReadLE32"""
-
-def SDL_EnableScreenSaver(*argv):
-    """SDL_EnableScreenSaver"""
-
-SDL_INIT_JOYSTICK = int
-def SDL_GetCurrentDisplayMode(*argv):
-    """SDL_GetCurrentDisplayMode"""
-
-def SDL_GetClipRect(*argv):
-    """SDL_GetClipRect"""
-
-def SDL_SetError(*argv):
-    """SDL_SetError"""
-
-def SDL_IntersectRect(*argv):
-    """SDL_IntersectRect"""
-
-def SDL_GetWindowFlags(*argv):
-    """SDL_GetWindowFlags"""
-
-def SDL_WriteLE64(*argv):
-    """SDL_WriteLE64"""
-
-def SDL_SetWindowFullscreen(*argv):
-    """SDL_SetWindowFullscreen"""
-
-def SDL_ConvertSurfaceFormat(*argv):
-    """SDL_ConvertSurfaceFormat"""
-
-def SDL_GetSurfaceBlendMode(*argv):
-    """SDL_GetSurfaceBlendMode"""
-
-def SDL_FreeFormat(*argv):
-    """SDL_FreeFormat"""
-
-SDL_WINDOWPOS_UNDEFINED = int
-def SDL_InitSubSystem(*argv):
-    """SDL_InitSubSystem"""
-
-def SDL_SetWindowIcon(*argv):
-    """SDL_SetWindowIcon"""
-
-def SDL_SetClipRect(*argv):
-    """SDL_SetClipRect"""
-
-def SDL_RestoreWindow(*argv):
-    """SDL_RestoreWindow"""
-
-SDL_PREALLOC = int
-def SDL_RWFromConstMem(*argv):
-    """SDL_RWFromConstMem"""
-
-def SDL_SetWindowGammaRamp(*argv):
-    """SDL_SetWindowGammaRamp"""
-
-def SDL_AllocRW(*argv):
-    """SDL_AllocRW"""
-
-SDL_INIT_HAPTIC = int
-def SDL_HideWindow(*argv):
-    """SDL_HideWindow"""
-
-def SDL_GetRGB(*argv):
-    """SDL_GetRGB"""
-
-def SDL_GetNumVideoDisplays(*argv):
-    """SDL_GetNumVideoDisplays"""
-
-SDL_INIT_NOPARACHUTE = int
-def SDL_LoadBMP_RW(*argv):
-    """SDL_LoadBMP_RW"""
-
-def SDL_FreeSurface(*argv):
-    """SDL_FreeSurface"""
-
-def SDL_GL_SetSwapInterval(*argv):
-    """SDL_GL_SetSwapInterval"""
-
-def SDL_GetWindowGammaRamp(*argv):
-    """SDL_GetWindowGammaRamp"""
-
-def SDL_GetWindowSize(*argv):
-    """SDL_GetWindowSize"""
-
-def SDL_Quit(*argv):
-    """SDL_Quit"""
-
-def SDL_GL_GetProcAddress(*argv):
-    """SDL_GL_GetProcAddress"""
-
-def SDL_IntersectRectAndLine(*argv):
-    """SDL_IntersectRectAndLine"""
-
-def SDL_RWFromMem(*argv):
-    """SDL_RWFromMem"""
-
-SDL_WINDOWPOS_CENTERED = int
-def SDL_GetWindowGrab(*argv):
-    """SDL_GetWindowGrab"""
-
-def SDL_GL_ExtensionSupported(*argv):
-    """SDL_GL_ExtensionSupported"""
-
-def SDL_GetCurrentVideoDriver(*argv):
-    """SDL_GetCurrentVideoDriver"""
-
-SDL_BLENDMODE_MOD = int
-SDL_BLENDMODE_ADD = int
-SDL_BLENDMODE_BLEND = int
-SDL_BLENDMODE_NONE = int
-def SDL_FreeRW(*argv):
-    """SDL_FreeRW"""
-
-def SDL_ReadLE64(*argv):
-    """SDL_ReadLE64"""
-
-def SDL_GetNumDisplayModes(*argv):
-    """SDL_GetNumDisplayModes"""
-
-def SDL_CreateWindow(*argv):
-    """SDL_CreateWindow"""
-
-def SDL_UnlockSurface(*argv):
-    """SDL_UnlockSurface"""
-
-def SDL_SetColorKey(*argv):
-    """SDL_SetColorKey"""
-
-def SDL_WriteBE16(*argv):
-    """SDL_WriteBE16"""
-
-def SDL_SetWindowBrightness(*argv):
-    """SDL_SetWindowBrightness"""
-
-def SDL_GL_SwapWindow(*argv):
-    """SDL_GL_SwapWindow"""
-
-def SDL_GetSurfaceColorMod(*argv):
-    """SDL_GetSurfaceColorMod"""
-
-def SDL_GetWindowTitle(*argv):
-    """SDL_GetWindowTitle"""
-
-SDL_WINDOWPOS_UNDEFINED_MASK = int
-def SDL_ReadBE64(*argv):
-    """SDL_ReadBE64"""
-
-def SDL_RWFromFP(*argv):
-    """SDL_RWFromFP"""
-
-SDL_GL_CONTEXT_PROFILE_ES = int
-SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = int
-SDL_GL_CONTEXT_PROFILE_CORE = int
-def SDL_MinimizeWindow(*argv):
-    """SDL_MinimizeWindow"""
-
-def SDL_GetWindowSurface(*argv):
-    """SDL_GetWindowSurface"""
-
-def SDL_SetWindowTitle(*argv):
-    """SDL_SetWindowTitle"""
-
-def SDL_LockSurface(*argv):
-    """SDL_LockSurface"""
-
-def SDL_LowerBlitScaled(*argv):
-    """SDL_LowerBlitScaled"""
-
-def SDL_GetWindowFromID(*argv):
-    """SDL_GetWindowFromID"""
-
-def SDL_CreateRGBSurfaceFrom(*argv):
-    """SDL_CreateRGBSurfaceFrom"""
-
-def SDL_GL_GetSwapInterval(*argv):
-    """SDL_GL_GetSwapInterval"""
-
-def SDL_GetWindowID(*argv):
-    """SDL_GetWindowID"""
-
-def SDL_WriteLE32(*argv):
-    """SDL_WriteLE32"""
-
-SDL_INIT_VIDEO = int
-def SDL_GetColorKey(*argv):
-    """SDL_GetColorKey"""
-
-def SDL_WriteBE32(*argv):
-    """SDL_WriteBE32"""
-
-def SDL_DestroyWindow(*argv):
-    """SDL_DestroyWindow"""
-
-SDL_WINDOW_FOREIGN = int
-SDL_WINDOW_MOUSE_FOCUS = int
-SDL_WINDOW_INPUT_FOCUS = int
-SDL_WINDOW_INPUT_GRABBED = int
-SDL_WINDOW_MAXIMIZED = int
-SDL_WINDOW_MINIMIZED = int
-SDL_WINDOW_RESIZABLE = int
-SDL_WINDOW_BORDERLESS = int
-SDL_WINDOW_HIDDEN = int
-SDL_WINDOW_SHOWN = int
-SDL_WINDOW_OPENGL = int
-SDL_WINDOW_FULLSCREEN = int
-def SDL_SaveBMP_RW(*argv):
-    """SDL_SaveBMP_RW"""
-
-def SDL_GetVideoDriver(*argv):
-    """SDL_GetVideoDriver"""
-
-def SDL_GL_MakeCurrent(*argv):
-    """SDL_GL_MakeCurrent"""
-
-def SDL_GetWindowBrightness(*argv):
-    """SDL_GetWindowBrightness"""
-
-def SDL_VideoQuit(*argv):
-    """SDL_VideoQuit"""
-
-SDL_ALPHA_OPAQUE = int
-def SDL_GetWindowPosition(*argv):
-    """SDL_GetWindowPosition"""
-
-def SDL_SetWindowDisplayMode(*argv):
-    """SDL_SetWindowDisplayMode"""
-
-def SDL_SetWindowData(*argv):
-    """SDL_SetWindowData"""
-
-SDL_GL_SHARE_WITH_CURRENT_CONTEXT = int
-SDL_GL_CONTEXT_PROFILE_MASK = int
-SDL_GL_CONTEXT_FLAGS = int
-SDL_GL_CONTEXT_EGL = int
-SDL_GL_CONTEXT_MINOR_VERSION = int
-SDL_GL_CONTEXT_MAJOR_VERSION = int
-SDL_GL_RETAINED_BACKING = int
-SDL_GL_ACCELERATED_VISUAL = int
-SDL_GL_MULTISAMPLESAMPLES = int
-SDL_GL_MULTISAMPLEBUFFERS = int
-SDL_GL_STEREO = int
-SDL_GL_ACCUM_ALPHA_SIZE = int
-SDL_GL_ACCUM_BLUE_SIZE = int
-SDL_GL_ACCUM_GREEN_SIZE = int
-SDL_GL_ACCUM_RED_SIZE = int
-SDL_GL_STENCIL_SIZE = int
-SDL_GL_DEPTH_SIZE = int
-SDL_GL_DOUBLEBUFFER = int
-SDL_GL_BUFFER_SIZE = int
-SDL_GL_ALPHA_SIZE = int
-SDL_GL_BLUE_SIZE = int
-SDL_GL_GREEN_SIZE = int
-SDL_GL_RED_SIZE = int
-def SDL_ClearError(*argv):
-    """SDL_ClearError"""
-
-def SDL_ConvertSurface(*argv):
-    """SDL_ConvertSurface"""
-
-def SDL_GetDesktopDisplayMode(*argv):
-    """SDL_GetDesktopDisplayMode"""
-
-def SDL_MaximizeWindow(*argv):
-    """SDL_MaximizeWindow"""
-
-SDL_SWSURFACE = int
-def SDL_SoftStretch(*argv):
-    """SDL_SoftStretch"""
-
-def SDL_WriteBE64(*argv):
-    """SDL_WriteBE64"""
-
-def SDL_GetNumVideoDrivers(*argv):
-    """SDL_GetNumVideoDrivers"""
-
-def SDL_SetWindowGrab(*argv):
-    """SDL_SetWindowGrab"""
-
-SDL_WINDOWEVENT_CLOSE = int
-SDL_WINDOWEVENT_FOCUS_LOST = int
-SDL_WINDOWEVENT_FOCUS_GAINED = int
-SDL_WINDOWEVENT_LEAVE = int
-SDL_WINDOWEVENT_ENTER = int
-SDL_WINDOWEVENT_RESTORED = int
-SDL_WINDOWEVENT_MAXIMIZED = int
-SDL_WINDOWEVENT_MINIMIZED = int
-SDL_WINDOWEVENT_SIZE_CHANGED = int
-SDL_WINDOWEVENT_RESIZED = int
-SDL_WINDOWEVENT_MOVED = int
-SDL_WINDOWEVENT_EXPOSED = int
-SDL_WINDOWEVENT_HIDDEN = int
-SDL_WINDOWEVENT_SHOWN = int
-SDL_WINDOWEVENT_NONE = int
-def SDL_UpperBlitScaled(*argv):
-    """SDL_UpperBlitScaled"""
-
-def SDL_GetWindowDisplayMode(*argv):
-    """SDL_GetWindowDisplayMode"""
-
-SDL_ALPHA_TRANSPARENT = int
-def SDL_WasInit(*argv):
-    """SDL_WasInit"""
-
-def SDL_SetPixelFormatPalette(*argv):
-    """SDL_SetPixelFormatPalette"""
-
-def SDL_ReadBE16(*argv):
-    """SDL_ReadBE16"""
-
-def SDL_SetSurfaceRLE(*argv):
-    """SDL_SetSurfaceRLE"""
-
-def SDL_CalculateGammaRamp(*argv):
-    """SDL_CalculateGammaRamp"""
-
-SDL_LASTERROR = int
-SDL_UNSUPPORTED = int
-SDL_EFSEEK = int
-SDL_EFWRITE = int
-SDL_EFREAD = int
-SDL_ENOMEM = int
-def SDL_HasIntersection(*argv):
-    """SDL_HasIntersection"""
-
-SDL_BlitSurface = int

File sdl/__init__.py

     return _ffi.string(_SDL_GetError()) 
 
 ################################################################################
+
+# add wrapped functions
+_module_names = set(locals().keys())
+def get_mangled_names():
+    for name in SDL_UNMANGLED_EXPORTS:
+        mangled_name = name.lstrip('_')
+        if mangled_name in _module_names:
+            yield mangled_name
+        else:
+            yield name 
+__all__ = SDL_EXPORTS + list(get_mangled_names())
+del _module_names
 # this file is auto-generated by sdl.builder. do not edit.
 from cffi import FFI
 
-__all__ = [
-'SDLError',
-'_ffi',
-"SDL_ReadLE16",
-"SDL_LowerBlit",
-"SDL_GetPixelFormatName",
-"SDL_UnionRect",
-"SDL_GetClosestDisplayMode",
-"SDL_SetSurfaceAlphaMod",
-"SDL_RaiseWindow",
-"SDL_MapRGB",
-"SDL_GetRGBA",
-"SDL_INIT_AUDIO",
-"SDL_SetSurfaceBlendMode",
-"SDL_SetWindowPosition",
-"SDL_AllocPalette",
-"SDL_RWFromFile",
-"SDL_FillRect",
-"SDL_GL_DeleteContext",
-"SDL_SetPaletteColors",
-"SDL_GetDisplayMode",
-"SDL_WINDOWPOS_CENTERED_MASK",
-"SDL_SetSurfacePalette",
-"SDL_CreateWindowFrom",
-"SDL_GL_GetAttribute",
-"SDL_DisableScreenSaver",
-"SDL_INIT_EVERYTHING",
-"SDL_AllocFormat",
-"SDL_GL_SetAttribute",
-"SDL_GetWindowDisplay",
-"SDL_FillRects",
-"SDL_INIT_TIMER",
-"SDL_PixelFormatEnumToMasks",
-"SDL_BlitScaled",
-"SDL_SetWindowSize",
-"SDL_GL_UnloadLibrary",
-"SDL_SetSurfaceColorMod",
-"SDL_QuitSubSystem",
-"SDL_TRUE",
-"SDL_FALSE",
-"SDL_IsScreenSaverEnabled",
+SDL_UNMANGLED_EXPORTS = [
 "_SDL_GetError",
-"SDL_GetWindowData",
-"SDL_ReadBE32",
-"SDL_UpdateWindowSurfaceRects",
-"SDL_GetSurfaceAlphaMod",
-"SDL_GL_CreateContext",
-"SDL_CreateRGBSurface",
-"SDL_WriteLE16",
-"SDL_Error",
-"SDL_GetDisplayBounds",
-"SDL_UpdateWindowSurface",
-"SDL_EnclosePoints",
-"SDL_RLEACCEL",
-"SDL_GL_CONTEXT_RESET_ISOLATION_FLAG",
-"SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG",
-"SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG",
-"SDL_GL_CONTEXT_DEBUG_FLAG",
-"SDL_ConvertPixels",
-"SDL_ShowWindow",
-"SDL_GL_LoadLibrary",
 "_SDL_Init",
-"SDL_FreePalette",
-"SDL_UpperBlit",
-"SDL_DONTFREE",
-"SDL_VideoInit",
-"SDL_MapRGBA",
-"SDL_MasksToPixelFormatEnum",
-"SDL_GetWindowPixelFormat",
-"SDL_ReadLE32",
-"SDL_EnableScreenSaver",
-"SDL_INIT_JOYSTICK",
-"SDL_GetCurrentDisplayMode",
-"SDL_GetClipRect",
-"SDL_SetError",
-"SDL_IntersectRect",
-"SDL_GetWindowFlags",
-"SDL_WriteLE64",
-"SDL_SetWindowFullscreen",
-"SDL_ConvertSurfaceFormat",
-"SDL_GetSurfaceBlendMode",
-"SDL_FreeFormat",
-"SDL_WINDOWPOS_UNDEFINED",
-"SDL_InitSubSystem",
-"SDL_SetWindowIcon",
-"SDL_SetClipRect",
-"SDL_RestoreWindow",
-"SDL_PREALLOC",
-"SDL_RWFromConstMem",
-"SDL_SetWindowGammaRamp",
-"SDL_AllocRW",
-"SDL_INIT_HAPTIC",
-"SDL_HideWindow",
-"SDL_GetRGB",
-"SDL_GetNumVideoDisplays",
-"SDL_INIT_NOPARACHUTE",
-"SDL_LoadBMP_RW",
-"SDL_FreeSurface",
-"SDL_GL_SetSwapInterval",
-"SDL_GetWindowGammaRamp",
-"SDL_GetWindowSize",
-"SDL_Quit",
-"SDL_GL_GetProcAddress",
-"SDL_IntersectRectAndLine",
-"SDL_RWFromMem",
-"SDL_WINDOWPOS_CENTERED",
-"SDL_GetWindowGrab",
-"SDL_GL_ExtensionSupported",
-"SDL_GetCurrentVideoDriver",
-"SDL_BLENDMODE_MOD",
-"SDL_BLENDMODE_ADD",
-"SDL_BLENDMODE_BLEND",
-"SDL_BLENDMODE_NONE",
-"SDL_FreeRW",
-"SDL_ReadLE64",
-"SDL_GetNumDisplayModes",
-"SDL_CreateWindow",
-"SDL_UnlockSurface",
-"SDL_SetColorKey",
-"SDL_WriteBE16",
-"SDL_SetWindowBrightness",
-"SDL_GL_SwapWindow",
-"SDL_GetSurfaceColorMod",
-"SDL_GetWindowTitle",
-"SDL_WINDOWPOS_UNDEFINED_MASK",
-"SDL_ReadBE64",
-"SDL_RWFromFP",
-"SDL_GL_CONTEXT_PROFILE_ES",
-"SDL_GL_CONTEXT_PROFILE_COMPATIBILITY",
-"SDL_GL_CONTEXT_PROFILE_CORE",
-"SDL_MinimizeWindow",
-"SDL_GetWindowSurface",
-"SDL_SetWindowTitle",
-"SDL_LockSurface",
-"SDL_LowerBlitScaled",
-"SDL_GetWindowFromID",
-"SDL_CreateRGBSurfaceFrom",
-"SDL_GL_GetSwapInterval",
-"SDL_GetWindowID",
-"SDL_WriteLE32",
-"SDL_INIT_VIDEO",
-"SDL_GetColorKey",
-"SDL_WriteBE32",
-"SDL_DestroyWindow",
-"SDL_WINDOW_FOREIGN",
-"SDL_WINDOW_MOUSE_FOCUS",
-"SDL_WINDOW_INPUT_FOCUS",
-"SDL_WINDOW_INPUT_GRABBED",
-"SDL_WINDOW_MAXIMIZED",
-"SDL_WINDOW_MINIMIZED",
-"SDL_WINDOW_RESIZABLE",
-"SDL_WINDOW_BORDERLESS",
-"SDL_WINDOW_HIDDEN",
-"SDL_WINDOW_SHOWN",
-"SDL_WINDOW_OPENGL",
-"SDL_WINDOW_FULLSCREEN",
-"SDL_SaveBMP_RW",
-"SDL_GetVideoDriver",
-"SDL_GL_MakeCurrent",
-"SDL_GetWindowBrightness",
-"SDL_VideoQuit",
-"SDL_ALPHA_OPAQUE",
-"SDL_GetWindowPosition",
-"SDL_SetWindowDisplayMode",
-"SDL_SetWindowData",
-"SDL_GL_SHARE_WITH_CURRENT_CONTEXT",
-"SDL_GL_CONTEXT_PROFILE_MASK",
-"SDL_GL_CONTEXT_FLAGS",
-"SDL_GL_CONTEXT_EGL",
-"SDL_GL_CONTEXT_MINOR_VERSION",
-"SDL_GL_CONTEXT_MAJOR_VERSION",
-"SDL_GL_RETAINED_BACKING",
-"SDL_GL_ACCELERATED_VISUAL",
-"SDL_GL_MULTISAMPLESAMPLES",
-"SDL_GL_MULTISAMPLEBUFFERS",
-"SDL_GL_STEREO",
-"SDL_GL_ACCUM_ALPHA_SIZE",
-"SDL_GL_ACCUM_BLUE_SIZE",
-"SDL_GL_ACCUM_GREEN_SIZE",
-"SDL_GL_ACCUM_RED_SIZE",
-"SDL_GL_STENCIL_SIZE",
-"SDL_GL_DEPTH_SIZE",
-"SDL_GL_DOUBLEBUFFER",
-"SDL_GL_BUFFER_SIZE",
-"SDL_GL_ALPHA_SIZE",
-"SDL_GL_BLUE_SIZE",
-"SDL_GL_GREEN_SIZE",
-"SDL_GL_RED_SIZE",
-"SDL_ClearError",
-"SDL_ConvertSurface",
-"SDL_GetDesktopDisplayMode",
-"SDL_MaximizeWindow",
-"SDL_SWSURFACE",
-"SDL_SoftStretch",
-"SDL_WriteBE64",
-"SDL_GetNumVideoDrivers",
-"SDL_SetWindowGrab",
-"SDL_WINDOWEVENT_CLOSE",
-"SDL_WINDOWEVENT_FOCUS_LOST",
-"SDL_WINDOWEVENT_FOCUS_GAINED",
-"SDL_WINDOWEVENT_LEAVE",
-"SDL_WINDOWEVENT_ENTER",
-"SDL_WINDOWEVENT_RESTORED",
-"SDL_WINDOWEVENT_MAXIMIZED",
-"SDL_WINDOWEVENT_MINIMIZED",
-"SDL_WINDOWEVENT_SIZE_CHANGED",
-"SDL_WINDOWEVENT_RESIZED",
-"SDL_WINDOWEVENT_MOVED",
-"SDL_WINDOWEVENT_EXPOSED",
-"SDL_WINDOWEVENT_HIDDEN",
-"SDL_WINDOWEVENT_SHOWN",
-"SDL_WINDOWEVENT_NONE",
-"SDL_UpperBlitScaled",
-"SDL_GetWindowDisplayMode",
-"SDL_ALPHA_TRANSPARENT",
-"SDL_WasInit",
-"SDL_SetPixelFormatPalette",
-"SDL_ReadBE16",
-"SDL_SetSurfaceRLE",
-"SDL_CalculateGammaRamp",
-"SDL_LASTERROR",
-"SDL_UNSUPPORTED",
-"SDL_EFSEEK",
-"SDL_EFWRITE",
-"SDL_EFREAD",
-"SDL_ENOMEM",
-"SDL_HasIntersection",
-"SDL_BlitSurface",
 
 ]
 
-class SDLError(Exception):
-    pass
+SDL_EXPORTS = [
+'SDLError',
+"SDL_HideWindow",
+"SDL_LowerBlitScaled",
+"SDL_SetWindowTitle",
+"SDL_SetSurfaceRLE",
+"SDL_WINDOWEVENT_NONE",
+"SDL_ReadBE32",
+"SDL_GL_ACCELERATED_VISUAL",
+"SDL_GetNumVideoDrivers",
+"SDL_RWFromFP",
+"SDL_UnionRect",
+"SDL_MasksToPixelFormatEnum",
+"SDL_GetNumVideoDisplays",
+"SDL_SetWindowBrightness",
+"SDL_GL_UnloadLibrary",
+"SDL_WINDOWEVENT_MOVED",
+"SDL_GL_DOUBLEBUFFER",
+"SDL_GL_GetProcAddress",
+"SDL_UpdateWindowSurface",
+"RW_SEEK_END",
+"SDL_GL_SHARE_WITH_CURRENT_CONTEXT",
+"SDL_ClearError",
+"SDL_GetWindowData",
+"SDL_GL_GetSwapInterval",
+"SDL_WINDOW_INPUT_FOCUS",
+"SDL_SetWindowGrab",
+"SDL_SetSurfaceColorMod",
+"RW_SEEK_CUR",
+"SDL_GetCurrentVideoDriver",
+"SDL_WINDOW_BORDERLESS",
+"SDL_GL_BLUE_SIZE",
+"SDL_SetWindowData",
+"SDL_WasInit",
+"SDL_ReadLE64",
+"SDL_WINDOWEVENT_HIDDEN",
+"SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG",
+"SDL_WINDOWEVENT_SIZE_CHANGED",
+"SDL_EFREAD",
+"SDL_INIT_VIDEO",
+"SDL_BLENDMODE_ADD",
+"SDL_INIT_HAPTIC",
+"SDL_SetClipRect",
+"SDL_AllocFormat",
+"SDL_HasIntersection",
+"SDL_DONTFREE",
+"SDL_SetError",
+"SDL_SetSurfaceBlendMode",
+"SDL_IsScreenSaverEnabled",
+"SDL_GetWindowPixelFormat",
+"SDL_WINDOWEVENT_MAXIMIZED",
+"SDL_RaiseWindow",
+"SDL_BLENDMODE_MOD",
+"SDL_WINDOWEVENT_RESIZED",
+"SDL_RWFromConstMem",
+"SDL_INIT_AUDIO",
+"SDL_UNSUPPORTED",
+"SDL_SetColorKey",
+"SDL_GL_ACCUM_ALPHA_SIZE",
+"SDL_GetWindowSurface",
+"SDL_SetWindowSize",
+"SDL_SetWindowPosition",
+"SDL_GL_ACCUM_RED_SIZE",
+"SDL_GetWindowTitle",
+"SDL_GL_CONTEXT_FLAGS",
+"SDL_DestroyWindow",
+"SDL_FillRect",
+"SDL_GetWindowID",
+"SDL_LockSurface",
+"SDL_WINDOWEVENT_ENTER",
+"SDL_GetWindowFlags",
+"SDL_GL_CONTEXT_MAJOR_VERSION",
+"SDL_GL_CreateContext",
+"SDL_INIT_JOYSTICK",
+"SDL_WINDOWEVENT_RESTORED",
+"SDL_VideoQuit",
+"SDL_GL_MULTISAMPLEBUFFERS",
+"SDL_BlitScaled",
+"SDL_GL_CONTEXT_MINOR_VERSION",
+"SDL_GL_ACCUM_GREEN_SIZE",
+"SDL_WriteLE32",
+"SDL_EFSEEK",
+"SDL_GetWindowGammaRamp",
+"SDL_LowerBlit",
+"SDL_WINDOW_MOUSE_FOCUS",
+"SDL_WINDOWPOS_UNDEFINED_MASK",
+"SDL_SetWindowDisplayMode",
+"SDL_GL_CONTEXT_PROFILE_MASK",
+"SDL_SWSURFACE",
+"SDL_GetColorKey",
+"SDL_GetWindowPosition",
+"SDL_LASTERROR",
+"SDL_GL_RED_SIZE",
+"SDL_GL_CONTEXT_PROFILE_COMPATIBILITY",
+"SDL_GL_GREEN_SIZE",
+"SDL_WINDOWEVENT_CLOSE",
+"SDL_ShowWindow",
+"SDL_GL_CONTEXT_EGL",
+"SDL_WINDOW_OPENGL",
+"SDL_WINDOW_FOREIGN",
+"SDL_GL_ExtensionSupported",
+"SDL_GetClipRect",
+"SDL_Error",
+"SDL_WriteBE16",
+"SDL_GetWindowDisplayMode",
+"SDL_GL_RETAINED_BACKING",
+"RW_SEEK_SET",
+"SDL_INIT_TIMER",
+"SDL_ReadBE16",
+"SDL_ConvertSurface",
+"SDL_WriteBE64",
+"SDL_ReadLE32",
+"SDL_WINDOW_INPUT_GRABBED",
+"SDL_GetPixelFormatName",
+"SDL_SetSurfacePalette",
+"SDL_WINDOWEVENT_FOCUS_LOST",
+"SDL_GetWindowBrightness",
+"SDL_SetPaletteColors",
+"SDL_CreateRGBSurfaceFrom",
+"SDL_PREALLOC",
+"SDL_GL_GetAttribute",
+"SDL_GetNumDisplayModes",
+"SDL_SetWindowGammaRamp",
+"SDL_EnclosePoints",
+"SDL_RestoreWindow",
+"SDL_SetWindowIcon",
+"SDL_GL_SetAttribute",
+"SDL_GetRGBA",
+"SDL_GL_LoadLibrary",
+"SDL_UnlockSurface",
+"SDL_RWFromFile",
+"SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG",
+"SDL_ENOMEM",
+"SDL_BLENDMODE_NONE",
+"SDL_SetWindowFullscreen",
+"SDL_InitSubSystem",
+"SDL_FillRects",
+"SDL_UpperBlitScaled",
+"SDL_INIT_NOPARACHUTE",
+"SDL_GetWindowSize",
+"SDL_ALPHA_OPAQUE",
+"SDL_GetSurfaceBlendMode",
+"SDL_MinimizeWindow",
+"SDL_WINDOWEVENT_SHOWN",
+"SDL_ReadBE64",
+"SDL_ReadLE16",
+"SDL_GL_SetSwapInterval",
+"SDL_EnableScreenSaver",
+"SDL_GetCurrentDisplayMode",
+"SDL_WINDOW_FULLSCREEN",
+"SDL_WINDOWEVENT_MINIMIZED",
+"SDL_WINDOW_RESIZABLE",
+"SDL_GetSurfaceColorMod",
+"SDL_CreateWindow",
+"SDL_WINDOWPOS_CENTERED",
+"SDL_SaveBMP_RW",
+"SDL_WINDOW_HIDDEN",
+"SDL_GL_ALPHA_SIZE",
+"SDL_Quit",
+"SDL_CreateWindowFrom",
+"SDL_WriteBE32",
+"SDL_GetRGB",
+"SDL_UpdateWindowSurfaceRects",
+"SDL_INIT_EVERYTHING",
+"SDL_WINDOWEVENT_EXPOSED",
+"SDL_LoadBMP_RW",
+"SDL_CalculateGammaRamp",
+"SDL_QuitSubSystem",
+"SDL_WINDOWPOS_UNDEFINED",
+"SDL_IntersectRect",
+"SDL_GL_SwapWindow",
+"SDL_BlitSurface",
+"SDL_VideoInit",
+"SDL_GetWindowGrab",
+"SDL_IntersectRectAndLine",
+"SDL_GL_STENCIL_SIZE",
+"SDL_GetDisplayBounds",
+"SDL_WINDOWEVENT_FOCUS_GAINED",
+"SDL_GetWindowDisplay",
+"SDL_GL_CONTEXT_PROFILE_CORE",
+"SDL_WINDOW_MINIMIZED",
+"SDL_WINDOW_MAXIMIZED",
+"SDL_GL_MakeCurrent",
+"SDL_GL_MULTISAMPLESAMPLES",
+"SDL_FALSE",
+"SDL_WINDOWEVENT_LEAVE",
+"SDL_SoftStretch",
+"SDL_ConvertSurfaceFormat",
+"SDL_MapRGBA",
+"SDL_DisableScreenSaver",
+"SDL_SetPixelFormatPalette",
+"SDL_UpperBlit",
+"SDL_GL_STEREO",
+"SDL_MapRGB",
+"SDL_BLENDMODE_BLEND",
+"SDL_WriteLE16",
+"SDL_RLEACCEL",
+"SDL_CreateRGBSurface",
+"SDL_FreeFormat",
+"SDL_GL_DeleteContext",
+"SDL_GetClosestDisplayMode",
+"SDL_GL_BUFFER_SIZE",
+"SDL_GL_CONTEXT_RESET_ISOLATION_FLAG",
+"SDL_WINDOWPOS_CENTERED_MASK",
+"SDL_AllocRW",
+"SDL_ALPHA_TRANSPARENT",
+"SDL_WINDOW_SHOWN",
+"SDL_ConvertPixels",
+"SDL_PixelFormatEnumToMasks",
+"SDL_GetVideoDriver",
+"SDL_GL_CONTEXT_PROFILE_ES",
+"SDL_FreePalette",
+"SDL_MaximizeWindow",
+"SDL_FreeRW",
+"SDL_GetSurfaceAlphaMod",
+"SDL_AllocPalette",
+"SDL_GL_CONTEXT_DEBUG_FLAG",
+"SDL_SetSurfaceAlphaMod",
+"SDL_TRUE",
+"SDL_GetDesktopDisplayMode",
+"SDL_GetWindowFromID",
+"SDL_GL_DEPTH_SIZE",
+"SDL_EFWRITE",
+"SDL_FreeSurface",
+"SDL_RWFromMem",
+"SDL_GL_ACCUM_BLUE_SIZE",
+"SDL_WriteLE64",
+"SDL_GetDisplayMode",
 
-_ffi = FFI()
-_ffi.cdef("""
+]
+
+INTERNAL_EXPORTS = [
+'_ffi',
+'SDL_EXPORTS',
+'SDL_UNMANGLED_EXPORTS',
+]
+
+__all__ = SDL_EXPORTS + SDL_UNMANGLED_EXPORTS + INTERNAL_EXPORTS
+
+from .internal import *
+
+_SDL = load_sdl("""
 /*
 Simple DirectMedia Layer
 Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
 /* vi: set ts=4 sw=4 expandtab: */
 
 
-""")
-_SDL = _ffi.verify("""
-#include <SDL2/SDL.h>
-""", libraries=['SDL2'])
+""")   
 
-def check_error():
-    error = _ffi.string(_SDL.SDL_GetError())
-    if error:
-        _SDL.SDL_ClearError()
-        raise SDLError, error
+SDL_HideWindow = guard(lookup('SDL_HideWindow'))
+SDL_LowerBlitScaled = guard(lookup('SDL_LowerBlitScaled'))
+SDL_SetWindowTitle = guard(lookup('SDL_SetWindowTitle'))
+SDL_SetSurfaceRLE = guard(lookup('SDL_SetSurfaceRLE'))
+SDL_WINDOWEVENT_NONE = 0
+SDL_ReadBE32 = guard(lookup('SDL_ReadBE32'))
+SDL_GL_ACCELERATED_VISUAL = 15
+SDL_GetNumVideoDrivers = guard(lookup('SDL_GetNumVideoDrivers'))
+SDL_RWFromFP = guard(lookup('SDL_RWFromFP'))
+SDL_UnionRect = guard(lookup('SDL_UnionRect'))
+SDL_MasksToPixelFormatEnum = guard(lookup('SDL_MasksToPixelFormatEnum'))
+SDL_GetNumVideoDisplays = guard(lookup('SDL_GetNumVideoDisplays'))
+SDL_SetWindowBrightness = guard(lookup('SDL_SetWindowBrightness'))
+SDL_GL_UnloadLibrary = guard(lookup('SDL_GL_UnloadLibrary'))
+SDL_WINDOWEVENT_MOVED = 4
+SDL_GL_DOUBLEBUFFER = 5
+SDL_GL_GetProcAddress = guard(lookup('SDL_GL_GetProcAddress'))
+SDL_UpdateWindowSurface = guard(lookup('SDL_UpdateWindowSurface'))
+RW_SEEK_END = 2
+SDL_GL_SHARE_WITH_CURRENT_CONTEXT = 22
+SDL_ClearError = lookup('SDL_ClearError')
+SDL_GetWindowData = guard(lookup('SDL_GetWindowData'))
+SDL_GL_GetSwapInterval = guard(lookup('SDL_GL_GetSwapInterval'))
+SDL_WINDOW_INPUT_FOCUS = 512
+SDL_SetWindowGrab = guard(lookup('SDL_SetWindowGrab'))
+SDL_SetSurfaceColorMod = guard(lookup('SDL_SetSurfaceColorMod'))
+RW_SEEK_CUR = 1
+SDL_GetCurrentVideoDriver = guard(lookup('SDL_GetCurrentVideoDriver'))
+SDL_WINDOW_BORDERLESS = 16
+SDL_GL_BLUE_SIZE = 2
+SDL_SetWindowData = guard(lookup('SDL_SetWindowData'))
+SDL_WasInit = guard(lookup('SDL_WasInit'))
+SDL_ReadLE64 = guard(lookup('SDL_ReadLE64'))
+SDL_WINDOWEVENT_HIDDEN = 2
+SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 4
+SDL_WINDOWEVENT_SIZE_CHANGED = 6
+SDL_EFREAD = 1
+SDL_INIT_VIDEO = 32
+SDL_BLENDMODE_ADD = 2
+SDL_INIT_HAPTIC = 4096
+SDL_SetClipRect = guard(lookup('SDL_SetClipRect'))
+SDL_AllocFormat = guard(lookup('SDL_AllocFormat'))
+SDL_HasIntersection = guard(lookup('SDL_HasIntersection'))
+SDL_DONTFREE = 4
+SDL_SetError = guard(lookup('SDL_SetError'))
+SDL_SetSurfaceBlendMode = guard(lookup('SDL_SetSurfaceBlendMode'))
+SDL_IsScreenSaverEnabled = guard(lookup('SDL_IsScreenSaverEnabled'))
+SDL_GetWindowPixelFormat = guard(lookup('SDL_GetWindowPixelFormat'))
+SDL_WINDOWEVENT_MAXIMIZED = 8
+SDL_RaiseWindow = guard(lookup('SDL_RaiseWindow'))
+SDL_BLENDMODE_MOD = 4
+SDL_WINDOWEVENT_RESIZED = 5
+SDL_RWFromConstMem = guard(lookup('SDL_RWFromConstMem'))
+SDL_INIT_AUDIO = 16
+SDL_UNSUPPORTED = 4
+SDL_SetColorKey = guard(lookup('SDL_SetColorKey'))
+SDL_GL_ACCUM_ALPHA_SIZE = 11
+SDL_GetWindowSurface = guard(lookup('SDL_GetWindowSurface'))
+SDL_SetWindowSize = guard(lookup('SDL_SetWindowSize'))
+SDL_SetWindowPosition = guard(lookup('SDL_SetWindowPosition'))
+SDL_GL_ACCUM_RED_SIZE = 8
+SDL_GetWindowTitle = guard(lookup('SDL_GetWindowTitle'))
+SDL_GL_CONTEXT_FLAGS = 20
+SDL_DestroyWindow = guard(lookup('SDL_DestroyWindow'))
+SDL_FillRect = guard(lookup('SDL_FillRect'))
+SDL_GetWindowID = guard(lookup('SDL_GetWindowID'))
+SDL_LockSurface = guard(lookup('SDL_LockSurface'))
+SDL_WINDOWEVENT_ENTER = 10
+SDL_GetWindowFlags = guard(lookup('SDL_GetWindowFlags'))
+SDL_GL_CONTEXT_MAJOR_VERSION = 17
+SDL_GL_CreateContext = guard(lookup('SDL_GL_CreateContext'))
+SDL_INIT_JOYSTICK = 512
+SDL_WINDOWEVENT_RESTORED = 9
+SDL_VideoQuit = guard(lookup('SDL_VideoQuit'))
+SDL_GL_MULTISAMPLEBUFFERS = 13
+SDL_BlitScaled = 139955450300400
+SDL_GL_CONTEXT_MINOR_VERSION = 18
+SDL_GL_ACCUM_GREEN_SIZE = 9
+SDL_WriteLE32 = guard(lookup('SDL_WriteLE32'))
+SDL_EFSEEK = 3
+SDL_GetWindowGammaRamp = guard(lookup('SDL_GetWindowGammaRamp'))
+SDL_LowerBlit = guard(lookup('SDL_LowerBlit'))
+SDL_WINDOW_MOUSE_FOCUS = 1024
+SDL_WINDOWPOS_UNDEFINED_MASK = 536805376
+SDL_SetWindowDisplayMode = guard(lookup('SDL_SetWindowDisplayMode'))
+SDL_GL_CONTEXT_PROFILE_MASK = 21
+SDL_SWSURFACE = 0
+SDL_GetColorKey = guard(lookup('SDL_GetColorKey'))
+SDL_GetWindowPosition = guard(lookup('SDL_GetWindowPosition'))
+SDL_LASTERROR = 5
+SDL_GL_RED_SIZE = 0
+SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 2
+SDL_GL_GREEN_SIZE = 1
+SDL_WINDOWEVENT_CLOSE = 14
+SDL_ShowWindow = guard(lookup('SDL_ShowWindow'))
+SDL_GL_CONTEXT_EGL = 19
+SDL_WINDOW_OPENGL = 2
+SDL_WINDOW_FOREIGN = 2048
+SDL_GL_ExtensionSupported = guard(lookup('SDL_GL_ExtensionSupported'))
+SDL_GetClipRect = guard(lookup('SDL_GetClipRect'))
+SDL_Error = guard(lookup('SDL_Error'))
+SDL_WriteBE16 = guard(lookup('SDL_WriteBE16'))
+SDL_GetWindowDisplayMode = guard(lookup('SDL_GetWindowDisplayMode'))
+SDL_GL_RETAINED_BACKING = 16
+RW_SEEK_SET = 0
+SDL_INIT_TIMER = 1
+SDL_ReadBE16 = guard(lookup('SDL_ReadBE16'))
+SDL_ConvertSurface = guard(lookup('SDL_ConvertSurface'))
+SDL_WriteBE64 = guard(lookup('SDL_WriteBE64'))
+SDL_ReadLE32 = guard(lookup('SDL_ReadLE32'))
+SDL_WINDOW_INPUT_GRABBED = 256
+SDL_GetPixelFormatName = guard(lookup('SDL_GetPixelFormatName'))
+SDL_SetSurfacePalette = guard(lookup('SDL_SetSurfacePalette'))
+SDL_WINDOWEVENT_FOCUS_LOST = 13
+SDL_GetWindowBrightness = guard(lookup('SDL_GetWindowBrightness'))
+SDL_SetPaletteColors = guard(lookup('SDL_SetPaletteColors'))
+SDL_CreateRGBSurfaceFrom = guard(lookup('SDL_CreateRGBSurfaceFrom'))
+SDL_PREALLOC = 1
+SDL_GL_GetAttribute = guard(lookup('SDL_GL_GetAttribute'))
+SDL_GetNumDisplayModes = guard(lookup('SDL_GetNumDisplayModes'))
+SDL_SetWindowGammaRamp = guard(lookup('SDL_SetWindowGammaRamp'))
+SDL_EnclosePoints = guard(lookup('SDL_EnclosePoints'))
+SDL_RestoreWindow = guard(lookup('SDL_RestoreWindow'))
+SDL_SetWindowIcon = guard(lookup('SDL_SetWindowIcon'))
+SDL_GL_SetAttribute = guard(lookup('SDL_GL_SetAttribute'))
+SDL_GetRGBA = guard(lookup('SDL_GetRGBA'))
+SDL_GL_LoadLibrary = guard(lookup('SDL_GL_LoadLibrary'))
+SDL_UnlockSurface = guard(lookup('SDL_UnlockSurface'))
+SDL_RWFromFile = guard(lookup('SDL_RWFromFile'))
+SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 2
+SDL_ENOMEM = 0
+SDL_BLENDMODE_NONE = 0
+SDL_SetWindowFullscreen = guard(lookup('SDL_SetWindowFullscreen'))
+SDL_InitSubSystem = guard(lookup('SDL_InitSubSystem'))
+SDL_FillRects = guard(lookup('SDL_FillRects'))
+_SDL_GetError = lookup('SDL_GetError')
+SDL_UpperBlitScaled = guard(lookup('SDL_UpperBlitScaled'))
+SDL_INIT_NOPARACHUTE = 1048576
+SDL_GetWindowSize = guard(lookup('SDL_GetWindowSize'))
+SDL_ALPHA_OPAQUE = 255
+SDL_GetSurfaceBlendMode = guard(lookup('SDL_GetSurfaceBlendMode'))
+SDL_MinimizeWindow = guard(lookup('SDL_MinimizeWindow'))
+SDL_WINDOWEVENT_SHOWN = 1
+SDL_ReadBE64 = guard(lookup('SDL_ReadBE64'))
+SDL_ReadLE16 = guard(lookup('SDL_ReadLE16'))
+SDL_GL_SetSwapInterval = guard(lookup('SDL_GL_SetSwapInterval'))
+SDL_EnableScreenSaver = guard(lookup('SDL_EnableScreenSaver'))
+SDL_GetCurrentDisplayMode = guard(lookup('SDL_GetCurrentDisplayMode'))
+SDL_WINDOW_FULLSCREEN = 1
+SDL_WINDOWEVENT_MINIMIZED = 7
+SDL_WINDOW_RESIZABLE = 32
+SDL_GetSurfaceColorMod = guard(lookup('SDL_GetSurfaceColorMod'))
+SDL_CreateWindow = guard(lookup('SDL_CreateWindow'))
+SDL_WINDOWPOS_CENTERED = 805240832
+SDL_SaveBMP_RW = guard(lookup('SDL_SaveBMP_RW'))
+SDL_WINDOW_HIDDEN = 8
+SDL_GL_ALPHA_SIZE = 3
+_SDL_Init = lookup('SDL_Init')
+SDL_Quit = lookup('SDL_Quit')
+SDL_CreateWindowFrom = guard(lookup('SDL_CreateWindowFrom'))
+SDL_WriteBE32 = guard(lookup('SDL_WriteBE32'))
+SDL_GetRGB = guard(lookup('SDL_GetRGB'))
+SDL_UpdateWindowSurfaceRects = guard(lookup('SDL_UpdateWindowSurfaceRects'))
+SDL_INIT_EVERYTHING = 65535
+SDL_WINDOWEVENT_EXPOSED = 3
+SDL_LoadBMP_RW = guard(lookup('SDL_LoadBMP_RW'))
+SDL_CalculateGammaRamp = guard(lookup('SDL_CalculateGammaRamp'))
+SDL_QuitSubSystem = guard(lookup('SDL_QuitSubSystem'))
+SDL_WINDOWPOS_UNDEFINED = 536805376
+SDL_IntersectRect = guard(lookup('SDL_IntersectRect'))
+SDL_GL_SwapWindow = guard(lookup('SDL_GL_SwapWindow'))
+SDL_BlitSurface = 139955450299632
+SDL_VideoInit = guard(lookup('SDL_VideoInit'))
+SDL_GetWindowGrab = guard(lookup('SDL_GetWindowGrab'))
+SDL_IntersectRectAndLine = guard(lookup('SDL_IntersectRectAndLine'))
+SDL_GL_STENCIL_SIZE = 7
+SDL_GetDisplayBounds = guard(lookup('SDL_GetDisplayBounds'))
+SDL_WINDOWEVENT_FOCUS_GAINED = 12
+SDL_GetWindowDisplay = guard(lookup('SDL_GetWindowDisplay'))
+SDL_GL_CONTEXT_PROFILE_CORE = 1
+SDL_WINDOW_MINIMIZED = 64
+SDL_WINDOW_MAXIMIZED = 128
+SDL_GL_MakeCurrent = guard(lookup('SDL_GL_MakeCurrent'))
+SDL_GL_MULTISAMPLESAMPLES = 14
+SDL_FALSE = 0
+SDL_WINDOWEVENT_LEAVE = 11
+SDL_SoftStretch = guard(lookup('SDL_SoftStretch'))
+SDL_ConvertSurfaceFormat = guard(lookup('SDL_ConvertSurfaceFormat'))
+SDL_MapRGBA = guard(lookup('SDL_MapRGBA'))
+SDL_DisableScreenSaver = guard(lookup('SDL_DisableScreenSaver'))
+SDL_SetPixelFormatPalette = guard(lookup('SDL_SetPixelFormatPalette'))
+SDL_UpperBlit = guard(lookup('SDL_UpperBlit'))
+SDL_GL_STEREO = 12
+SDL_MapRGB = guard(lookup('SDL_MapRGB'))
+SDL_BLENDMODE_BLEND = 1
+SDL_WriteLE16 = guard(lookup('SDL_WriteLE16'))
+SDL_RLEACCEL = 2
+SDL_CreateRGBSurface = guard(lookup('SDL_CreateRGBSurface'))
+SDL_FreeFormat = guard(lookup('SDL_FreeFormat'))
+SDL_GL_DeleteContext = guard(lookup('SDL_GL_DeleteContext'))
+SDL_GetClosestDisplayMode = guard(lookup('SDL_GetClosestDisplayMode'))
+SDL_GL_BUFFER_SIZE = 4
+SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 8
+SDL_WINDOWPOS_CENTERED_MASK = 805240832
+SDL_AllocRW = guard(lookup('SDL_AllocRW'))
+SDL_ALPHA_TRANSPARENT = 0
+SDL_WINDOW_SHOWN = 4
+SDL_ConvertPixels = guard(lookup('SDL_ConvertPixels'))
+SDL_PixelFormatEnumToMasks = guard(lookup('SDL_PixelFormatEnumToMasks'))
+SDL_GetVideoDriver = guard(lookup('SDL_GetVideoDriver'))
+SDL_GL_CONTEXT_PROFILE_ES = 4
+SDL_FreePalette = guard(lookup('SDL_FreePalette'))
+SDL_MaximizeWindow = guard(lookup('SDL_MaximizeWindow'))
+SDL_FreeRW = guard(lookup('SDL_FreeRW'))
+SDL_GetSurfaceAlphaMod = guard(lookup('SDL_GetSurfaceAlphaMod'))
+SDL_AllocPalette = guard(lookup('SDL_AllocPalette'))
+SDL_GL_CONTEXT_DEBUG_FLAG = 1
+SDL_SetSurfaceAlphaMod = guard(lookup('SDL_SetSurfaceAlphaMod'))
+SDL_TRUE = 1
+SDL_GetDesktopDisplayMode = guard(lookup('SDL_GetDesktopDisplayMode'))
+SDL_GetWindowFromID = guard(lookup('SDL_GetWindowFromID'))
+SDL_GL_DEPTH_SIZE = 6
+SDL_EFWRITE = 2
+SDL_FreeSurface = guard(lookup('SDL_FreeSurface'))
+SDL_RWFromMem = guard(lookup('SDL_RWFromMem'))
+SDL_GL_ACCUM_BLUE_SIZE = 10
+SDL_WriteLE64 = guard(lookup('SDL_WriteLE64'))
+SDL_GetDisplayMode = guard(lookup('SDL_GetDisplayMode'))
 
-def safeguard(func):
-    name = func.__name__
-    def newfunc(*args):
-        result = func(*args)
-        check_error()
-        return result
-    newfunc.func_name = name
-    newfunc.__doc__ = func.__doc__
-    return newfunc
-
-
-@safeguard
-def SDL_ReadLE16(*args):
-    """<cdata 'unsigned short(*)(struct SDL_RWops *)' 0x7ff7d3d7087d>"""
-    return _SDL.SDL_ReadLE16(*args)
-
-@safeguard
-def SDL_LowerBlit(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, struct SDL_Rect *, struct SDL_Surface *, struct SDL_Rect *)' 0x7ff7d3d7084b>"""
-    return _SDL.SDL_LowerBlit(*args)
-
-@safeguard
-def SDL_GetPixelFormatName(*args):
-    """<cdata 'char *(*)(unsigned int)' 0x7ff7d3d70834>"""
-    return _SDL.SDL_GetPixelFormatName(*args)
-
-@safeguard
-def SDL_UnionRect(*args):
-    """<cdata 'void(*)(struct SDL_Rect *, struct SDL_Rect *, struct SDL_Rect *)' 0x7ff7d3d70807>"""
-    return _SDL.SDL_UnionRect(*args)
-
-@safeguard
-def SDL_GetClosestDisplayMode(*args):
-    """<cdata 'struct $SDL_DisplayMode *(*)(int, struct $SDL_DisplayMode *, struct $SDL_DisplayMode *)' 0x7ff7d3d707dd>"""
-    return _SDL.SDL_GetClosestDisplayMode(*args)
-
-@safeguard
-def SDL_SetSurfaceAlphaMod(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, unsigned char)' 0x7ff7d3d707b8>"""
-    return _SDL.SDL_SetSurfaceAlphaMod(*args)
-
-@safeguard
-def SDL_RaiseWindow(*args):
-    """<cdata 'void(*)(struct SDL_Window *)' 0x7ff7d3d7079e>"""
-    return _SDL.SDL_RaiseWindow(*args)
-
-@safeguard
-def SDL_MapRGB(*args):
-    """<cdata 'unsigned int(*)(struct SDL_PixelFormat *, unsigned char, unsigned char, unsigned char)' 0x7ff7d3d7076c>"""
-    return _SDL.SDL_MapRGB(*args)
-
-@safeguard
-def SDL_GetRGBA(*args):
-    """<cdata 'void(*)(unsigned int, struct SDL_PixelFormat *, unsigned char *, unsigned char *, unsigned char *, unsigned char *)' 0x7ff7d3d70727>"""
-    return _SDL.SDL_GetRGBA(*args)
-SDL_INIT_AUDIO = _SDL.SDL_INIT_AUDIO
-
-@safeguard
-def SDL_SetSurfaceBlendMode(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, enum SDL_BlendMode)' 0x7ff7d3d706eb>"""
-    return _SDL.SDL_SetSurfaceBlendMode(*args)
-
-@safeguard
-def SDL_SetWindowPosition(*args):
-    """<cdata 'void(*)(struct SDL_Window *, int, int)' 0x7ff7d3d706c3>"""
-    return _SDL.SDL_SetWindowPosition(*args)
-
-@safeguard
-def SDL_AllocPalette(*args):
-    """<cdata 'struct SDL_Palette *(*)(int)' 0x7ff7d3d706ac>"""
-    return _SDL.SDL_AllocPalette(*args)
-
-@safeguard
-def SDL_RWFromFile(*args):
-    """<cdata 'struct SDL_RWops *(*)(char *, char *)' 0x7ff7d3d70687>"""
-    return _SDL.SDL_RWFromFile(*args)
-
-@safeguard
-def SDL_FillRect(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, struct SDL_Rect *, unsigned int)' 0x7ff7d3d7065c>"""
-    return _SDL.SDL_FillRect(*args)
-
-@safeguard
-def SDL_GL_DeleteContext(*args):
-    """<cdata 'void(*)(void *)' 0x7ff7d3d70642>"""
-    return _SDL.SDL_GL_DeleteContext(*args)
-
-@safeguard
-def SDL_SetPaletteColors(*args):
-    """<cdata 'int(*)(struct SDL_Palette *, struct SDL_Color *, int, int)' 0x7ff7d3d70614>"""
-    return _SDL.SDL_SetPaletteColors(*args)
-
-@safeguard
-def SDL_GetDisplayMode(*args):
-    """<cdata 'int(*)(int, int, struct $SDL_DisplayMode *)' 0x7ff7d3d705ed>"""
-    return _SDL.SDL_GetDisplayMode(*args)
-SDL_WINDOWPOS_CENTERED_MASK = _SDL.SDL_WINDOWPOS_CENTERED_MASK
-
-@safeguard
-def SDL_SetSurfacePalette(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, struct SDL_Palette *)' 0x7ff7d3d705ae>"""
-    return _SDL.SDL_SetSurfacePalette(*args)
-
-@safeguard
-def SDL_CreateWindowFrom(*args):
-    """<cdata 'struct SDL_Window *(*)(void *)' 0x7ff7d3d70594>"""
-    return _SDL.SDL_CreateWindowFrom(*args)
-
-@safeguard
-def SDL_GL_GetAttribute(*args):
-    """<cdata 'int(*)(enum SDL_GLattr, int *)' 0x7ff7d3d70572>"""
-    return _SDL.SDL_GL_GetAttribute(*args)
-
-@safeguard
-def SDL_DisableScreenSaver(*args):
-    """<cdata 'void(*)()' 0x7ff7d3d70567>"""
-    return _SDL.SDL_DisableScreenSaver(*args)
-SDL_INIT_EVERYTHING = _SDL.SDL_INIT_EVERYTHING
-
-@safeguard
-def SDL_AllocFormat(*args):
-    """<cdata 'struct SDL_PixelFormat *(*)(unsigned int)' 0x7ff7d3d70536>"""
-    return _SDL.SDL_AllocFormat(*args)
-
-@safeguard
-def SDL_GL_SetAttribute(*args):
-    """<cdata 'int(*)(enum SDL_GLattr, int)' 0x7ff7d3d70517>"""
-    return _SDL.SDL_GL_SetAttribute(*args)
-
-@safeguard
-def SDL_GetWindowDisplay(*args):
-    """<cdata 'int(*)(struct SDL_Window *)' 0x7ff7d3d704fd>"""
-    return _SDL.SDL_GetWindowDisplay(*args)
-
-@safeguard
-def SDL_FillRects(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, struct SDL_Rect *, int, unsigned int)' 0x7ff7d3d704cf>"""
-    return _SDL.SDL_FillRects(*args)
-SDL_INIT_TIMER = _SDL.SDL_INIT_TIMER
-
-@safeguard
-def SDL_PixelFormatEnumToMasks(*args):
-    """<cdata 'enum $SDL_bool(*)(unsigned int, int *, unsigned int *, unsigned int *, unsigned int *, unsigned int *)' 0x7ff7d3d70470>"""
-    return _SDL.SDL_PixelFormatEnumToMasks(*args)
-SDL_BlitScaled = _SDL.SDL_BlitScaled
-
-@safeguard
-def SDL_SetWindowSize(*args):
-    """<cdata 'void(*)(struct SDL_Window *, int, int)' 0x7ff7d3d70428>"""
-    return _SDL.SDL_SetWindowSize(*args)
-
-@safeguard
-def SDL_GL_UnloadLibrary(*args):
-    """<cdata 'void(*)()' 0x7ff7d3d7041d>"""
-    return _SDL.SDL_GL_UnloadLibrary(*args)
-
-@safeguard
-def SDL_SetSurfaceColorMod(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, unsigned char, unsigned char, unsigned char)' 0x7ff7d3d703eb>"""
-    return _SDL.SDL_SetSurfaceColorMod(*args)
-
-@safeguard
-def SDL_QuitSubSystem(*args):
-    """<cdata 'void(*)(unsigned int)' 0x7ff7d3d703d4>"""
-    return _SDL.SDL_QuitSubSystem(*args)
-SDL_TRUE = _SDL.SDL_TRUE
-SDL_FALSE = _SDL.SDL_FALSE
-
-@safeguard
-def SDL_IsScreenSaverEnabled(*args):
-    """<cdata 'enum $SDL_bool(*)()' 0x7ff7d3d703ba>"""
-    return _SDL.SDL_IsScreenSaverEnabled(*args)
-_SDL_GetError = _SDL.SDL_GetError
-
-@safeguard
-def SDL_GetWindowData(*args):
-    """<cdata 'void *(*)(struct SDL_Window *, char *)' 0x7ff7d3d7038a>"""
-    return _SDL.SDL_GetWindowData(*args)
-
-@safeguard
-def SDL_ReadBE32(*args):
-    """<cdata 'unsigned int(*)(struct SDL_RWops *)' 0x7ff7d3d70370>"""
-    return _SDL.SDL_ReadBE32(*args)
-
-@safeguard
-def SDL_UpdateWindowSurfaceRects(*args):
-    """<cdata 'int(*)(struct SDL_Window *, struct SDL_Rect *, int)' 0x7ff7d3d70345>"""
-    return _SDL.SDL_UpdateWindowSurfaceRects(*args)
-
-@safeguard
-def SDL_GetSurfaceAlphaMod(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, unsigned char *)' 0x7ff7d3d70320>"""
-    return _SDL.SDL_GetSurfaceAlphaMod(*args)
-
-@safeguard
-def SDL_GL_CreateContext(*args):
-    """<cdata 'void *(*)(struct SDL_Window *)' 0x7ff7d3d70306>"""
-    return _SDL.SDL_GL_CreateContext(*args)
-
-@safeguard
-def SDL_CreateRGBSurface(*args):
-    """<cdata 'struct SDL_Surface *(*)(unsigned int, int, int, int, unsigned int, unsigned int, unsigned int, unsigned int)' 0x7ff7d3d702c0>"""
-    return _SDL.SDL_CreateRGBSurface(*args)
-
-@safeguard
-def SDL_WriteLE16(*args):
-    """<cdata 'unsigned long(*)(struct SDL_RWops *, unsigned short)' 0x7ff7d3d7029a>"""
-    return _SDL.SDL_WriteLE16(*args)
-
-@safeguard
-def SDL_Error(*args):
-    """<cdata 'void(*)(enum $SDL_errorcode)' 0x7ff7d3d70283>"""
-    return _SDL.SDL_Error(*args)
-
-@safeguard
-def SDL_GetDisplayBounds(*args):
-    """<cdata 'int(*)(int, struct SDL_Rect *)' 0x7ff7d3d70261>"""
-    return _SDL.SDL_GetDisplayBounds(*args)
-
-@safeguard
-def SDL_UpdateWindowSurface(*args):
-    """<cdata 'int(*)(struct SDL_Window *)' 0x7ff7d3d70247>"""
-    return _SDL.SDL_UpdateWindowSurface(*args)
-
-@safeguard
-def SDL_EnclosePoints(*args):
-    """<cdata 'enum $SDL_bool(*)(struct $SDL_Point *, int, struct SDL_Rect *, struct SDL_Rect *)' 0x7ff7d3d70217>"""
-    return _SDL.SDL_EnclosePoints(*args)
-SDL_RLEACCEL = _SDL.SDL_RLEACCEL
-SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = _SDL.SDL_GL_CONTEXT_RESET_ISOLATION_FLAG
-SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = _SDL.SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG
-SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = _SDL.SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG
-SDL_GL_CONTEXT_DEBUG_FLAG = _SDL.SDL_GL_CONTEXT_DEBUG_FLAG
-
-@safeguard
-def SDL_ConvertPixels(*args):
-    """<cdata 'int(*)(int, int, unsigned int, void *, int, unsigned int, void *, int)' 0x7ff7d3d7018a>"""
-    return _SDL.SDL_ConvertPixels(*args)
-
-@safeguard
-def SDL_ShowWindow(*args):
-    """<cdata 'void(*)(struct SDL_Window *)' 0x7ff7d3d70170>"""
-    return _SDL.SDL_ShowWindow(*args)
-
-@safeguard
-def SDL_GL_LoadLibrary(*args):
-    """<cdata 'int(*)(char *)' 0x7ff7d3d70156>"""
-    return _SDL.SDL_GL_LoadLibrary(*args)
-_SDL_Init = _SDL.SDL_Init
-
-@safeguard
-def SDL_FreePalette(*args):
-    """<cdata 'void(*)(struct SDL_Palette *)' 0x7ff7d3d70125>"""
-    return _SDL.SDL_FreePalette(*args)
-
-@safeguard
-def SDL_UpperBlit(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, struct SDL_Rect *, struct SDL_Surface *, struct SDL_Rect *)' 0x7ff7d3d700ae>"""
-    return _SDL.SDL_UpperBlit(*args)
-SDL_DONTFREE = _SDL.SDL_DONTFREE
-
-@safeguard
-def SDL_VideoInit(*args):
-    """<cdata 'int(*)(char *)' 0x7ff7d3d7007a>"""
-    return _SDL.SDL_VideoInit(*args)
-
-@safeguard
-def SDL_MapRGBA(*args):
-    """<cdata 'unsigned int(*)(struct SDL_PixelFormat *, unsigned char, unsigned char, unsigned char, unsigned char)' 0x7ff7d3d7003b>"""
-    return _SDL.SDL_MapRGBA(*args)
-
-@safeguard
-def SDL_MasksToPixelFormatEnum(*args):
-    """<cdata 'unsigned int(*)(int, unsigned int, unsigned int, unsigned int, unsigned int)' 0x7ff7d3d70008>"""
-    return _SDL.SDL_MasksToPixelFormatEnum(*args)
-
-@safeguard
-def SDL_GetWindowPixelFormat(*args):
-    """<cdata 'unsigned int(*)(struct SDL_Window *)' 0x7ff7d3d6ffee>"""
-    return _SDL.SDL_GetWindowPixelFormat(*args)
-
-@safeguard
-def SDL_ReadLE32(*args):
-    """<cdata 'unsigned int(*)(struct SDL_RWops *)' 0x7ff7d3d6ffd4>"""
-    return _SDL.SDL_ReadLE32(*args)
-
-@safeguard
-def SDL_EnableScreenSaver(*args):
-    """<cdata 'void(*)()' 0x7ff7d3d6ffc9>"""
-    return _SDL.SDL_EnableScreenSaver(*args)
-SDL_INIT_JOYSTICK = _SDL.SDL_INIT_JOYSTICK
-
-@safeguard
-def SDL_GetCurrentDisplayMode(*args):
-    """<cdata 'int(*)(int, struct $SDL_DisplayMode *)' 0x7ff7d3d6ff8d>"""
-    return _SDL.SDL_GetCurrentDisplayMode(*args)
-
-@safeguard
-def SDL_GetClipRect(*args):
-    """<cdata 'void(*)(struct SDL_Surface *, struct SDL_Rect *)' 0x7ff7d3d6ff68>"""
-    return _SDL.SDL_GetClipRect(*args)
-
-@safeguard
-def SDL_SetError(*args):
-    """<cdata 'void(*)(char *, ...)' 0x7ff7d3a98d50>"""
-    return _SDL.SDL_SetError(*args)
-
-@safeguard
-def SDL_IntersectRect(*args):
-    """<cdata 'enum $SDL_bool(*)(struct SDL_Rect *, struct SDL_Rect *, struct SDL_Rect *)' 0x7ff7d3d6ff2e>"""
-    return _SDL.SDL_IntersectRect(*args)
-
-@safeguard
-def SDL_GetWindowFlags(*args):
-    """<cdata 'unsigned int(*)(struct SDL_Window *)' 0x7ff7d3d6ff14>"""
-    return _SDL.SDL_GetWindowFlags(*args)
-
-@safeguard
-def SDL_WriteLE64(*args):
-    """<cdata 'unsigned long(*)(struct SDL_RWops *, unsigned long)' 0x7ff7d3d6feef>"""
-    return _SDL.SDL_WriteLE64(*args)
-
-@safeguard
-def SDL_SetWindowFullscreen(*args):
-    """<cdata 'int(*)(struct SDL_Window *, enum $SDL_bool)' 0x7ff7d3d6fecd>"""
-    return _SDL.SDL_SetWindowFullscreen(*args)
-
-@safeguard
-def SDL_ConvertSurfaceFormat(*args):
-    """<cdata 'struct SDL_Surface *(*)(struct SDL_Surface *, unsigned int, unsigned int)' 0x7ff7d3d6fea5>"""
-    return _SDL.SDL_ConvertSurfaceFormat(*args)
-
-@safeguard
-def SDL_GetSurfaceBlendMode(*args):
-    """<cdata 'int(*)(struct SDL_Surface *, enum SDL_BlendMode *)' 0x7ff7d3d6fe43>"""
-    return _SDL.SDL_GetSurfaceBlendMode(*args)
-
-@safeguard
-def SDL_FreeFormat(*args):
-    """<cdata 'void(*)(struct SDL_PixelFormat *)' 0x7ff7d3d6fe29>"""
-    return _SDL.SDL_FreeFormat(*args)
-SDL_WINDOWPOS_UNDEFINED = _SDL.SDL_WINDOWPOS_UNDEFINED
-
-@safeguard
-def SDL_InitSubSystem(*args):
-    """<cdata 'int(*)(unsigned int)' 0x7ff7d3d6fdf8>"""
-    return _SDL.SDL_InitSubSystem(*args)
-
-@safeguard
-def SDL_SetWindowIcon(*args):
-    """<cdata 'void(*)(struct SDL_Window *, struct SDL_Surface *)' 0x7ff7d3d6fdd3>"""
-    return _SDL.SDL_SetWindowIcon(*args)
-
-@safeguard
-def SDL_SetClipRect(*args):
-    """<cdata 'enum $SDL_bool(*)(struct SDL_Surface *, struct SDL_Rect *)' 0x7ff7d3d6fdae>"""
-    return _SDL.SDL_SetClipRect(*args)
-
-@safeguard
-def SDL_RestoreWindow(*args):
-    """<cdata 'void(*)(struct SDL_Window *)' 0x7ff7d3d6fd94>"""
-    return _SDL.SDL_RestoreWindow(*args)
-SDL_PREALLOC = _SDL.SDL_PREALLOC
-
-@safeguard
-def SDL_RWFromConstMem(*args):
-    """<cdata 'struct SDL_RWops *(*)(void *, int)' 0x7ff7d3d6fd58>"""
-    return _SDL.SDL_RWFromConstMem(*args)
-
-@safeguard
-def SDL_SetWindowGammaRamp(*args):
-    """<cdata 'int(*)(struct SDL_Window *, unsigned short *, unsigned short *, unsigned short *)' 0x7ff7d3d6fd26>"""
-    return _SDL.SDL_SetWindowGammaRamp(*args)
-
-@safeguard
-def SDL_AllocRW(*args):
-    """<cdata 'struct SDL_RWops *(*)()' 0x7ff7d3d6fcf6>"""
-    return _SDL.SDL_AllocRW(*args)
-SDL_INIT_HAPTIC = _SDL.SDL_INIT_HAPTIC
-
-@safeguard
-def SDL_HideWindow(*args):
-    """<cdata 'void(*)(struct SDL_Window *)' 0x7ff7d3d6fcc2>"""
-    return _SDL.SDL_HideWindow(*args)
-
-@safeguard
-def SDL_GetRGB(*args):
-    """<cdata 'void(*)(unsigned int, struct SDL_PixelFormat *, unsigned char *, unsigned char *, unsigned char *)' 0x7ff7d3d6fc88>"""
-    return _SDL.SDL_GetRGB(*args)
-
-@safeguard
-def SDL_GetNumVideoDisplays(*args):
-    """<cdata 'int(*)()' 0x7ff7d3d6fc63>"""
-    return _SDL.SDL_GetNumVideoDisplays(*args)
-SDL_INIT_NOPARACHUTE = _SDL.SDL_INIT_NOPARACHUTE
-
-@safeguard
-def SDL_LoadBMP_RW(*args):
-    """<cdata 'struct SDL_Surface *(*)(struct SDL_RWops *, int)' 0x7ff7d3d6fc27>"""
-    return _SDL.SDL_LoadBMP_RW(*args)
-
-@safeguard
-def SDL_FreeSurface(*args):
-    """<cdata 'void(*)(struct SDL_Surface *)' 0x7ff7d3d6fc0d>"""
-    return _SDL.SDL_FreeSurface(*args)
-
-@safeguard
-def SDL_GL_SetSwapInterval(*args):
-    """<cdata 'int(*)(int)' 0x7ff7d3d6fbf6>"""
-    return _SDL.SDL_GL_SetSwapInterval(*args)
-
-@safeguard
-def SDL_GetWindowGammaRamp(*args):
-    """<cdata 'int(*)(struct SDL_Window *, unsigned short *, unsigned short *, unsigned short *)' 0x7ff7d3d6fbc4>"""
-    return _SDL.SDL_GetWindowGammaRamp(*args)
-
-@safeguard
-def SDL_GetWindowSize(*args):
-    """<cdata 'void(*)(struct SDL_Window *, int *, int *)' 0x7ff7d3d6fb7d>"""
-    return _SDL.SDL_GetWindowSize(*args)
-SDL_Quit = _SDL.SDL_Quit
-
-@safeguard
-def SDL_GL_GetProcAddress(*args):
-    """<cdata 'void *(*)(char *)' 0x7ff7d3d6fb58>"""
-    return _SDL.SDL_GL_GetProcAddress(*args)
-
-@safeguard
-def SDL_IntersectRectAndLine(*args):
-    """<cdata 'enum $SDL_bool(*)(struct SDL_Rect *, int *, int *, int *, int *)' 0x7ff7d3d6fb1b>"""
-    return _SDL.SDL_IntersectRectAndLine(*args)
-
-@safeguard
-def SDL_RWFromMem(*args):
-    """<cdata 'struct SDL_RWops *(*)(void *, int)' 0x7ff7d3d6faf9>"""
-    return _SDL.SDL_RWFromMem(*args)
-SDL_WINDOWPOS_CENTERED = _SDL.SDL_WINDOWPOS_CENTERED
-
-@safeguard
-def SDL_GetWindowGrab(*args):
-    """<cdata 'enum $SDL_bool(*)(struct SDL_Window *)' 0x7ff7d3d6fac5>"""
-    return _SDL.SDL_GetWindowGrab(*args)
-
-@safeguard
-def SDL_GL_ExtensionSupported(*args):
-    """<cdata 'enum $SDL_bool(*)(char *)' 0x7ff7d3d6fa4a>"""
-    return _SDL.SDL_GL_ExtensionSupported(*args)
-
-@safeguard
-def SDL_GetCurrentVideoDriver(*args):
-    """<cdata 'char *(*)()' 0x7ff7d3d6fa3f>"""
-    return _SDL.SDL_GetCurrentVideoDriver(*args)
-SDL_BLENDMODE_MOD = _SDL.SDL_BLENDMODE_MOD
-SDL_BLENDMODE_ADD = _SDL.SDL_BLENDMODE_ADD
-SDL_BLENDMODE_BLEND = _SDL.SDL_BLENDMODE_BLEND
-SDL_BLENDMODE_NONE = _SDL.SDL_BLENDMODE_NONE
-
-@safeguard
-def SDL_FreeRW(*args):
-    """<cdata 'void(*)(struct SDL_RWops *)' 0x7ff7d3d6fa16>"""
-    return _SDL.SDL_FreeRW(*args)
-
-@safeguard
-def SDL_ReadLE64(*args):
-    """<cdata 'unsigned long(*)(struct SDL_RWops *)' 0x7ff7d3d6f9fc>"""
-    return _SDL.SDL_ReadLE64(*args)
-
-@safeguard
-def SDL_GetNumDisplayModes(*args):
-    """<cdata 'int(*)(int)' 0x7ff7d3d6f9e5>"""
-    return _SDL.SDL_GetNumDisplayModes(*args)
-
-@safeguard
-def SDL_CreateWindow(*args):
-    """<cdata 'struct SDL_Window *(*)(char *, int, int, int, int, unsigned int)' 0x7ff7d3d6f9a4>"""
-    return _SDL.SDL_CreateWindow(*args)
-
-@safeguard
-def SDL_UnlockSurface(*args):
-    """<cdata 'void(*)(struct SDL_Surface *)' 0x7ff7d3d6f98a>"""
-    return _SDL.SDL_UnlockSurface(*args)
-
-@safeguard
-def SDL_SetColorKey(*args):