sdl2/sdl2

    Dark Mode
Search:
Group by:

Types

AssertState = distinct cint
errorcode = distinct cint
ThreadPriority = distinct cint
AudioStatus = distinct cint
PixelType = distinct cint
BitmapOrder = distinct cint
PackedOrder = distinct cint
ArrayOrder = distinct cint
PackedLayout = distinct cint
PixelFormatEnum = distinct cint
BlendMode = distinct cint
BlendOperation = distinct cint
BlendFactor = distinct cint
YUV_CONVERSION_MODE = distinct cint
WindowFlags = distinct cint
WindowEventID = distinct cint
DisplayEventID = distinct cint
DisplayOrientation = distinct cint
GLattr = distinct cint
GLprofile = distinct cint
GLcontextFlag = distinct cint
GLcontextReleaseFlag = distinct cint
GLContextResetNotificationEnum = distinct cint
HitTestResult = distinct cint
Scancode = distinct cint
KeyCodeEnum = distinct cint
Keymod = distinct cint
SystemCursor = distinct cint
MouseWheelDirection = distinct cint
JoystickType = distinct cint
JoystickPowerLevel = distinct cint
GameControllerType = distinct cint
GameControllerAxis = distinct cint
GameControllerButton = distinct cint
TouchDeviceType = distinct cint
EventType = distinct cint
eventaction = distinct cint
HintPriority = distinct cint
LogCategory = distinct cint
LogPriority = distinct cint
MessageBoxFlags = distinct cint
MessageBoxButtonFlags = distinct cint
MessageBoxColorType = distinct cint
PowerState = distinct cint
RendererFlags = distinct cint
ScaleMode = distinct cint
TextureAccess = distinct cint
TextureModulate = distinct cint
RendererFlip = distinct cint
SensorType = distinct cint
WindowShapeMode = distinct cint
RWops {...}{.incompleteStruct.} = object
BlitMap {...}{.incompleteStruct.} = object
GameControllerBindType = enum
  CONTROLLER_BINDTYPE_NONE = 0, CONTROLLER_BINDTYPE_BUTTON,
  CONTROLLER_BINDTYPE_AXIS, CONTROLLER_BINDTYPE_HAT
Bool = bool
GameControllerButtonBind = object
  case bindType*: GameControllerBindType
  of CONTROLLER_BINDTYPE_BUTTON:
      button*: cint

  of CONTROLLER_BINDTYPE_AXIS:
      axis*: cint

  of CONTROLLER_BINDTYPE_HAT:
      hat*: ButtonBindHat

  of CONTROLLER_BINDTYPE_NONE:
      nil

  
ButtonBindHat = object
  hat*: int
  hatMask*: int
Sint8 = int8
Uint8 = uint8
Sint16 = int16
Uint16 = uint16
Sint32 = int32
Uint32 = uint32
Sint64 = int64
Uint64 = uint64
malloc_func = proc (size: uint): pointer {...}{.cdecl.}
calloc_func = proc (nmemb: uint; size: uint): pointer {...}{.cdecl.}
realloc_func = proc (mem: pointer; size: uint): pointer {...}{.cdecl.}
free_func = proc (mem: pointer) {...}{.cdecl.}
iconv_t {...}{.incompleteStruct.} = object
main_func = proc (argc: cint; argv: UncheckedArray[cstring]): cint {...}{.cdecl.}
AssertData {...}{.bycopy.} = object
  alwaysIgnore*: cint
  triggerCount*: cuint
  condition*: cstring
  filename*: cstring
  linenum*: cint
  function*: cstring
  next*: ptr AssertData
AssertionHandler = proc (data: ptr AssertData; userdata: pointer): AssertState {...}{.cdecl.}
SpinLock = cint
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\name SDL AtomicLock
 
 The atomic locks are efficient spinlocks using CPU instructions,
 but are vulnerable to starvation and can spin forever if a thread
 holding a lock has been terminated.  For this reason you should
 minimize the code executed inside an atomic lock and never do
 expensive things like API or system calls while holding them.
 
 The atomic locks are not safe to lock recursively.
 
 Porting Note:
 The spin lock functions and type are required and can not be
 emulated because they are used in the atomic emulation code.
@{
atomic_t {...}{.bycopy.} = object
  value*: cint
\brief A type representing an atomic integer value.  It is a struct
        so people don't accidentally use numeric operations on it.
mutex {...}{.incompleteStruct.} = object
semaphore {...}{.incompleteStruct.} = object
sem = semaphore
cond {...}{.incompleteStruct.} = object
Thread {...}{.incompleteStruct.} = object
threadID = culong
The SDL thread ID
TLSID = cuint
Thread local storage ID, 0 is the invalid ID
ThreadFunction = proc (data: pointer): cint {...}{.cdecl.}
AudioFormat = Uint16
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief Audio format flags.
  
  These are what the 16 bits in SDL_AudioFormat currently mean...
  (Unspecified bits are always zero).
  
  \verbatim
    ++-----------------------sample is signed if set
    ||
    ||       ++-----------sample is bigendian if set
    ||       ||
    ||       ||          ++---sample is float if set
    ||       ||          ||
    ||       ||          || +---sample bit size---+
    ||       ||          || |                     |
    15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
    \endverbatim
  
  There are macros in SDL 2.0 and later to query these bits.
AudioCallback = proc (userdata: pointer; stream: ptr Uint8; len: cint) {...}{.cdecl.}
AudioSpec {...}{.bycopy.} = object
  freq*: cint                  ## ::
            ##   < DSP frequency -- samples per second
  format*: AudioFormat         ## ::
                     ##   < Audio data format
  channels*: Uint8             ## ::
                 ##   < Number of channels: 1 mono, 2 stereo
  silence*: Uint8              ## ::
                ##   < Audio buffer silence value (calculated)
  samples*: Uint16             ## ::
                 ##   < Audio buffer size in sample FRAMES (total samples divided by channel count)
  padding*: Uint16             ## ::
                 ##   < Necessary for some compile environments
  size*: Uint32                ## ::
              ##   < Audio buffer size in bytes (calculated)
  callback*: AudioCallback     ## ::
                         ##   < Callback that feeds the audio device (NULL to use SDL_QueueAudio()).
  userdata*: pointer           ## ::
                   ##   < Userdata passed to callback (ignored for NULL callbacks).
  
The calculated values in this structure are calculated by SDL_OpenAudio().
  
  For multi-channel audio, the default SDL channel mapping is:
  2:  FL FR                       (stereo)
  3:  FL FR LFE                   (2.1 surround)
  4:  FL FR BL BR                 (quad)
  5:  FL FR FC BL BR              (quad + center)
  6:  FL FR FC LFE SL SR          (5.1 surround - last two can also be BL BR)
  7:  FL FR FC LFE BC SL SR       (6.1 surround)
  8:  FL FR FC LFE BL BR SL SR    (7.1 surround)
AudioCVT {...}{.bycopy.} = object
  needed*: cint                ## ::
              ##   < Set to 1 if conversion possible
  srcFormat*: AudioFormat      ## ::
                        ##   < Source audio format
  dstFormat*: AudioFormat      ## ::
                        ##   < Target audio format
  rateIncr*: cdouble           ## ::
                   ##   < Rate conversion increment
  buf*: ptr Uint8               ## ::
               ##   < Buffer to hold entire audio data
  len*: cint                   ## ::
           ##   < Length of original audio buffer
  lenCvt*: cint                ## ::
              ##   < Length of converted audio buffer
  lenMult*: cint               ## ::
               ##   < buffer must be lenlen_mult big
  lenRatio*: cdouble           ## ::
                   ##   < Given len, final size is lenlen_ratio
  filters*: array[9 + typeof(9)(1), AudioFilter] ## ::
                                            ##   < NULL-terminated list of filter functions
  filterIndex*: cint           ## ::
                   ##   < Current audio conversion function
  
AudioFilter = proc (cvt: ptr AudioCVT; format: AudioFormat) {...}{.cdecl.}
AudioDeviceID = Uint32
SDL Audio Device IDs.
  
  A successful call to SDL_OpenAudio() is always device id 1, and legacy
  SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls
  always returns devices >= 2 on success. The legacy calls are good both
  for backwards compatibility and when you don't care about multiple,
  specific, or capture devices.
AudioStream {...}{.incompleteStruct.} = object
Color {...}{.bycopy.} = object
  r*: Uint8
  g*: Uint8
  b*: Uint8
  a*: Uint8
Palette {...}{.bycopy.} = object
  ncolors*: cint
  colors*: ptr Color
  Version*: Uint32
  refcount*: cint
PixelFormat {...}{.bycopy.} = object
  format*: Uint32
  palette*: ptr Palette
  BitsPerPixel*: Uint8
  BytesPerPixel*: Uint8
  padding*: array[2, Uint8]
  Rmask*: Uint32
  Gmask*: Uint32
  Bmask*: Uint32
  Amask*: Uint32
  Rloss*: Uint8
  Gloss*: Uint8
  Bloss*: Uint8
  Aloss*: Uint8
  Rshift*: Uint8
  Gshift*: Uint8
  Bshift*: Uint8
  Ashift*: Uint8
  refcount*: cint
  next*: ptr PixelFormat
\note Everything in the pixel format structure is read-only.
Point {...}{.bycopy.} = object
  x*: cint
  y*: cint
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief  The structure that defines a point (integer)
  
  \sa SDL_EnclosePoints
  \sa SDL_PointInRect
FPoint {...}{.bycopy.} = object
  x*: cfloat
  y*: cfloat
\brief  The structure that defines a point (floating point)
  
  \sa SDL_EnclosePoints
  \sa SDL_PointInRect
Rect {...}{.bycopy.} = object
  x*: cint
  y*: cint
  w*: cint
  h*: cint
\brief A rectangle, with the origin at the upper left (integer).
  
  \sa SDL_RectEmpty
  \sa SDL_RectEquals
  \sa SDL_HasIntersection
  \sa SDL_IntersectRect
  \sa SDL_UnionRect
  \sa SDL_EnclosePoints
FRect {...}{.bycopy.} = object
  x*: cfloat
  y*: cfloat
  w*: cfloat
  h*: cfloat
\brief A rectangle, with the origin at the upper left (floating point).
Surface {...}{.bycopy.} = object
  flags*: Uint32               ## ::
               ##   < Read-only
  format*: ptr PixelFormat      ## ::
                        ##   < Read-only
  w*: cint                     ## ::
         ##   < Read-only
  h*: cint                     ## ::
         ##   < Read-only
  pitch*: cint                 ## ::
             ##   < Read-only
  pixels*: pointer             ## ::
                 ##   < Read-write
  userdata*: pointer           ## ::
                   ##   < Read-write
  locked*: cint                ## ::
              ##   < Read-only
  lockData*: pointer           ## ::
                   ##   < Read-only
  clipRect*: Rect              ## ::
                ##   < Read-only
  map*: ptr BlitMap             ## ::
                 ##   < Private
  refcount*: cint              ## ::
                ##   < Read-mostly
  
\brief A collection of pixels used in software blitting.
 
 \note  This structure should be treated as read-only, except for \c pixels,
        which, if not NULL, contains the raw pixel data for the surface.
blit = proc (src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface; dstrect: ptr Rect): cint {...}{.
    cdecl.}
DisplayMode {...}{.bycopy.} = object
  format*: Uint32              ## ::
                ##   < pixel format
  w*: cint                     ## ::
         ##   < width, in screen coordinates
  h*: cint                     ## ::
         ##   < height, in screen coordinates
  refreshRate*: cint           ## ::
                   ##   < refresh rate (or zero for unspecified)
  driverdata*: pointer         ## ::
                     ##   < driver-specific data, initialize to 0
  
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief  The structure that defines a display mode
  
  \sa SDL_GetNumDisplayModes()
  \sa SDL_GetDisplayMode()
  \sa SDL_GetDesktopDisplayMode()
  \sa SDL_GetCurrentDisplayMode()
  \sa SDL_GetClosestDisplayMode()
  \sa SDL_SetWindowDisplayMode()
  \sa SDL_GetWindowDisplayMode()
Window {...}{.incompleteStruct.} = object
GLContext = pointer
\brief An opaque handle to an OpenGL context.
HitTest = proc (win: ptr Window; area: ptr Point; data: pointer): HitTestResult {...}{.cdecl.}
Keycode = Sint32
vi: set ts=4 sw=4 expandtab:
\brief The SDL virtual key representation.
  
  Values of this type are used to represent keyboard keys using the current
  layout of the keyboard.  These values include Unicode values representing
  the unmodified character that would be generated by pressing the key, or
  an SDLK_ constant for those keys that do not generate characters.
  
  A special exception is the number keys at the top of the keyboard which
  always map to SDLK_0...SDLK_9, regardless of layout.
Keysym {...}{.bycopy.} = object
  scancode*: Scancode          ## ::
                    ##   < SDL physical key code - see ::SDL_Scancode for details
  sym*: Keycode                ## ::
              ##   < SDL virtual key code - see ::SDL_Keycode for details
  `mod`*: Uint16               ## ::
               ##   < current key modifiers
  unused*: Uint32
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief The SDL keysym structure, used in key events.
  
  \note  If you are looking for translated character input, see the ::SDL_TEXTINPUT event.
Cursor {...}{.incompleteStruct.} = object
Joystick {...}{.incompleteStruct.} = object
JoystickGUID {...}{.bycopy.} = object
  data*: array[16, Uint8]
A structure that encodes the stable unique id for a joystick device
JoystickID = Sint32
This is a unique ID for a joystick for the time it is connected to the system,
 and is never reused for the lifetime of the application. If the joystick is
 disconnected and reconnected, it will get a new ID.
 
 The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
GameController {...}{.incompleteStruct.} = object
TouchID = Sint64
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
FingerID = Sint64
Finger {...}{.bycopy.} = object
  id*: FingerID
  x*: cfloat
  y*: cfloat
  pressure*: cfloat
GestureID = Sint64
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
CommonEvent {...}{.bycopy.} = object
  kind*: Uint32
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  
\brief Fields shared by every event
DisplayEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_DISPLAYEVENT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  display*: Uint32             ## ::
                 ##   < The associated display index
  event*: Uint8                ## ::
              ##   < ::SDL_DisplayEventID
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
  data1*: Sint32               ## ::
               ##   < event dependent data
  
\brief Display state change event data (event.display.)
WindowEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_WINDOWEVENT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The associated window
  event*: Uint8                ## ::
              ##   < ::SDL_WindowEventID
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
  data1*: Sint32               ## ::
               ##   < event dependent data
  data2*: Sint32               ## ::
               ##   < event dependent data
  
\brief Window state change event data (event.window.)
KeyboardEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_KEYDOWN or ::SDL_KEYUP
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with keyboard focus, if any
  state*: Uint8                ## ::
              ##   < ::SDL_PRESSED or ::SDL_RELEASED
  repeat*: Uint8               ## ::
               ##   < Non-zero if this is a key repeat
  padding2*: Uint8
  padding3*: Uint8
  keysym*: Keysym              ## ::
                ##   < The key that was pressed or released
  
\brief Keyboard button event structure (event.key.)
TextEditingEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_TEXTEDITING
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with keyboard focus, if any
  text*: array[(32), cchar]     ## ::
                         ##   < The editing text
  start*: Sint32               ## ::
               ##   < The start cursor of selected editing text
  length*: Sint32              ## ::
                ##   < The length of selected editing text
  
\brief Keyboard text editing event structure (event.edit.)
TextInputEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_TEXTINPUT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with keyboard focus, if any
  text*: array[(32), cchar]     ## ::
                         ##   < The input text
  
\brief Keyboard text input event structure (event.text.)
MouseMotionEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_MOUSEMOTION
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with mouse focus, if any
  which*: Uint32               ## ::
               ##   < The mouse instance id, or SDL_TOUCH_MOUSEID
  state*: Uint32               ## ::
               ##   < The current button state
  x*: Sint32                   ## ::
           ##   < X coordinate, relative to window
  y*: Sint32                   ## ::
           ##   < Y coordinate, relative to window
  xrel*: Sint32                ## ::
              ##   < The relative motion in the X direction
  yrel*: Sint32                ## ::
              ##   < The relative motion in the Y direction
  
\brief Mouse motion event structure (event.motion.)
MouseButtonEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with mouse focus, if any
  which*: Uint32               ## ::
               ##   < The mouse instance id, or SDL_TOUCH_MOUSEID
  button*: Uint8               ## ::
               ##   < The mouse button index
  state*: Uint8                ## ::
              ##   < ::SDL_PRESSED or ::SDL_RELEASED
  clicks*: Uint8               ## ::
               ##   < 1 for single-click, 2 for double-click, etc.
  padding1*: Uint8
  x*: Sint32                   ## ::
           ##   < X coordinate, relative to window
  y*: Sint32                   ## ::
           ##   < Y coordinate, relative to window
  
\brief Mouse button event structure (event.button.)
MouseWheelEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_MOUSEWHEEL
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The window with mouse focus, if any
  which*: Uint32               ## ::
               ##   < The mouse instance id, or SDL_TOUCH_MOUSEID
  x*: Sint32                   ## ::
           ##   < The amount scrolled horizontally, positive to the right and negative to the left
  y*: Sint32                   ## ::
           ##   < The amount scrolled vertically, positive away from the user and negative toward the user
  direction*: Uint32           ## ::
                   ##   < Set to one of the SDL_MOUSEWHEEL_ defines. When FLIPPED the values in X and Y will be opposite. Multiply by -1 to change them back
  
\brief Mouse wheel event structure (event.wheel.)
JoyAxisEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_JOYAXISMOTION
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  axis*: Uint8                 ## ::
             ##   < The joystick axis index
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
  value*: Sint16               ## ::
               ##   < The axis value (range: -32768 to 32767)
  padding4*: Uint16
\brief Joystick axis motion event structure (event.jaxis.)
JoyBallEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_JOYBALLMOTION
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  ball*: Uint8                 ## ::
             ##   < The joystick trackball index
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
  xrel*: Sint16                ## ::
              ##   < The relative motion in the X direction
  yrel*: Sint16                ## ::
              ##   < The relative motion in the Y direction
  
\brief Joystick trackball motion event structure (event.jball.)
JoyHatEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_JOYHATMOTION
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  hat*: Uint8                  ## ::
            ##   < The joystick hat index
  value*: Uint8 ## ::
              ##   < The hat position value.
              ##      \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP
              ##      \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT
              ##      \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN
              ##   
              ##      Note that zero means the POV is centered.
  padding1*: Uint8
  padding2*: Uint8
\brief Joystick hat position change event structure (event.jhat.)
JoyButtonEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  button*: Uint8               ## ::
               ##   < The joystick button index
  state*: Uint8                ## ::
              ##   < ::SDL_PRESSED or ::SDL_RELEASED
  padding1*: Uint8
  padding2*: Uint8
\brief Joystick button event structure (event.jbutton.)
JoyDeviceEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: Sint32               ## ::
               ##   < The joystick device index for the ADDED event, instance id for the REMOVED event
  
\brief Joystick device event structure (event.jdevice.)
ControllerAxisEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_CONTROLLERAXISMOTION
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  axis*: Uint8                 ## ::
             ##   < The controller axis (SDL_GameControllerAxis)
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
  value*: Sint16               ## ::
               ##   < The axis value (range: -32768 to 32767)
  padding4*: Uint16
\brief Game controller axis motion event structure (event.caxis.)
ControllerButtonEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: JoystickID           ## ::
                   ##   < The joystick instance id
  button*: Uint8               ## ::
               ##   < The controller button (SDL_GameControllerButton)
  state*: Uint8                ## ::
              ##   < ::SDL_PRESSED or ::SDL_RELEASED
  padding1*: Uint8
  padding2*: Uint8
\brief Game controller button event structure (event.cbutton.)
ControllerDeviceEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: Sint32               ## ::
               ##   < The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event
  
\brief Controller device event structure (event.cdevice.)
AudioDeviceEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: Uint32               ## ::
               ##   < The audio device index for the ADDED event (valid until next SDL_GetNumAudioDevices() call), SDL_AudioDeviceID for the REMOVED event
  iscapture*: Uint8            ## ::
                  ##   < zero if an output device, non-zero if a capture device.
  padding1*: Uint8
  padding2*: Uint8
  padding3*: Uint8
\brief Audio device event structure (event.adevice.)
TouchFingerEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  touchId*: TouchID            ## ::
                  ##   < The touch device id
  fingerId*: FingerID
  x*: cfloat                   ## ::
           ##   < Normalized in the range 0...1
  y*: cfloat                   ## ::
           ##   < Normalized in the range 0...1
  dx*: cfloat                  ## ::
            ##   < Normalized in the range -1...1
  dy*: cfloat                  ## ::
            ##   < Normalized in the range -1...1
  pressure*: cfloat            ## ::
                  ##   < Normalized in the range 0...1
  windowID*: Uint32            ## ::
                  ##   < The window underneath the finger, if any
  
\brief Touch finger event structure (event.tfinger.)
MultiGestureEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_MULTIGESTURE
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  touchId*: TouchID            ## ::
                  ##   < The touch device id
  dTheta*: cfloat
  dDist*: cfloat
  x*: cfloat
  y*: cfloat
  numFingers*: Uint16
  padding*: Uint16
\brief Multiple Finger Gesture Event (event.mgesture.)
DollarGestureEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  touchId*: TouchID            ## ::
                  ##   < The touch device id
  gestureId*: GestureID
  numFingers*: Uint32
  error*: cfloat
  x*: cfloat                   ## ::
           ##   < Normalized center of gesture
  y*: cfloat                   ## ::
           ##   < Normalized center of gesture
  
\brief Dollar Gesture Event (event.dgesture.)
DropEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  file*: cstring               ## ::
               ##   < The file name, which should be freed with SDL_free(), is NULL on begin/complete
  windowID*: Uint32            ## ::
                  ##   < The window that was dropped on, if any
  
\brief An event used to request a file open by the system (event.drop.)
         This event is enabled by default, you can disable it with SDL_EventState().
  \note If this event is enabled, you must free the filename in the event.
SensorEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_SENSORUPDATE
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  which*: Sint32               ## ::
               ##   < The instance ID of the sensor
  data*: array[6, cfloat]       ## ::
                       ##   < Up to 6 values from the sensor - additional values can be queried using SDL_SensorGetData()
  
\brief Sensor event structure (event.sensor.)
QuitEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_QUIT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  
\brief The "quit requested" event
OSEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_QUIT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  
\brief OS Specific event
UserEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_USEREVENT through ::SDL_LASTEVENT-1
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  windowID*: Uint32            ## ::
                  ##   < The associated window if any
  code*: Sint32                ## ::
              ##   < User defined event code
  data1*: pointer              ## ::
                ##   < User defined data pointer
  data2*: pointer              ## ::
                ##   < User defined data pointer
  
\brief A user-defined event type (event.user.)
SysWMmsg {...}{.incompleteStruct.} = object
SysWMEvent {...}{.bycopy.} = object
  kind*: Uint32                ## ::
              ##   < ::SDL_SYSWMEVENT
  timestamp*: Uint32           ## ::
                   ##   < In milliseconds, populated using SDL_GetTicks()
  msg*: ptr SysWMmsg            ## ::
                  ##   < driver dependent data, defined in SDL_syswm.h
  
\brief A video driver dependent system event (event.syswm.)
         This event is disabled by default, you can enable it with SDL_EventState()
  
  \note If you want to use this event, you should include SDL_syswm.h.
Event {...}{.union, bycopy.} = object
  kind*: Uint32                ## ::
              ##   < Event type, shared with all events
  common*: CommonEvent         ## ::
                     ##   < Common event data
  display*: DisplayEvent       ## ::
                       ##   < Display event data
  window*: WindowEvent         ## ::
                     ##   < Window event data
  key*: KeyboardEvent          ## ::
                    ##   < Keyboard event data
  edit*: TextEditingEvent      ## ::
                        ##   < Text editing event data
  text*: TextInputEvent        ## ::
                      ##   < Text input event data
  motion*: MouseMotionEvent    ## ::
                          ##   < Mouse motion event data
  button*: MouseButtonEvent    ## ::
                          ##   < Mouse button event data
  wheel*: MouseWheelEvent      ## ::
                        ##   < Mouse wheel event data
  jaxis*: JoyAxisEvent         ## ::
                     ##   < Joystick axis event data
  jball*: JoyBallEvent         ## ::
                     ##   < Joystick ball event data
  jhat*: JoyHatEvent           ## ::
                   ##   < Joystick hat event data
  jbutton*: JoyButtonEvent     ## ::
                         ##   < Joystick button event data
  jdevice*: JoyDeviceEvent     ## ::
                         ##   < Joystick device change event data
  caxis*: ControllerAxisEvent  ## ::
                            ##   < Game Controller axis event data
  cbutton*: ControllerButtonEvent ## ::
                                ##   < Game Controller button event data
  cdevice*: ControllerDeviceEvent ## ::
                                ##   < Game Controller device event data
  adevice*: AudioDeviceEvent   ## ::
                           ##   < Audio device event data
  sensor*: SensorEvent         ## ::
                     ##   < Sensor event data
  quit*: QuitEvent             ## ::
                 ##   < Quit request event data
  user*: UserEvent             ## ::
                 ##   < Custom event data
  syswm*: SysWMEvent           ## ::
                   ##   < System dependent window event data
  tfinger*: TouchFingerEvent   ## ::
                           ##   < Touch finger event data
  mgesture*: MultiGestureEvent ## ::
                             ##   < Gesture event data
  dgesture*: DollarGestureEvent ## ::
                              ##   < Gesture event data
  drop*: DropEvent             ## ::
                 ##   < Drag and drop event data
  padding*: array[56, Uint8]
\brief General event structure
EventFilter = proc (userdata: pointer; event: ptr Event): cint {...}{.cdecl.}
PHaptic {...}{.incompleteStruct.} = object
Haptic = PHaptic
HapticDirection {...}{.bycopy.} = object
  kind*: Uint8                 ## ::
             ##   < The type of encoding.
  dir*: array[3, Sint32]        ## ::
                      ##   < The encoded direction.
  
\brief Structure that represents a haptic direction.
  
  This is the direction where the force comes from,
  instead of the direction in which the force is exerted.
  
  Directions can be specified by:
   - ::SDL_HAPTIC_POLAR : Specified by polar coordinates.
   - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates.
   - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates.
  
  Cardinal directions of the haptic device are relative to the positioning
  of the device.  North is considered to be away from the user.
  
  The following diagram represents the cardinal directions:
  \verbatim
                 .--.
                 |__| .-------.
                 |=.| |.-----.|
                 |--| ||     ||
                 |  | |'-----'|
                 |__|~')_____('
                   [ COMPUTER ]
                     North (0,-1)
                         ^
                         |
                         |
   (-1,0)  West <----[ HAPTIC ]----> East (1,0)
                         |
                         |
                         v
                      South (0,1)
                      [ USER ]
                        \|||/
                        (o o)
                  ---ooO-(_)-Ooo---
    \endverbatim
  
  If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a
  degree starting north and turning clockwise.  ::SDL_HAPTIC_POLAR only uses
  the first \c dir parameter.  The cardinal directions would be:
   - North: 0 (0 degrees)
   - East: 9000 (90 degrees)
   - South: 18000 (180 degrees)
   - West: 27000 (270 degrees)
  
  If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions
  (X axis, Y axis and Z axis (with 3 axes)).  ::SDL_HAPTIC_CARTESIAN uses
  the first three \c dir parameters.  The cardinal directions would be:
   - North:  0,-1, 0
   - East:   1, 0, 0
   - South:  0, 1, 0
   - West:  -1, 0, 0
  
  The Z axis represents the height of the effect if supported, otherwise
  it's unused.  In cartesian encoding (1, 2) would be the same as (2, 4), you
  can use any multiple you want, only the direction matters.
  
  If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations.
  The first two \c dir parameters are used.  The \c dir parameters are as
  follows (all values are in hundredths of degrees):
   - Degrees from (1, 0) rotated towards (0, 1).
   - Degrees towards (0, 0, 1) (device needs at least 3 axes).
  
  
  Example of force coming from the south with all encodings (force coming
  from the south means the user will have to pull the stick to counteract):
  \code
  SDL_HapticDirection direction;
 
 Cartesian directions
  direction.type = SDL_HAPTIC_CARTESIAN; Using cartesian direction encoding.
  direction.dir[0] = 0; X position
  direction.dir[1] = 1; Y position
 Assuming the device has 2 axes, we don't need to specify third parameter.
 
 Polar directions
  direction.type = SDL_HAPTIC_POLAR; We'll be using polar direction encoding.
  direction.dir[0] = 18000; Polar only uses first parameter
 
 Spherical coordinates
  direction.type = SDL_HAPTIC_SPHERICAL; Spherical encoding
  direction.dir[0] = 9000; Since we only have two axes we don't need more parameters.
  \endcode
  
  \sa SDL_HAPTIC_POLAR
  \sa SDL_HAPTIC_CARTESIAN
  \sa SDL_HAPTIC_SPHERICAL
  \sa SDL_HapticEffect
  \sa SDL_HapticNumAxes
HapticConstant {...}{.bycopy.} = object
  kind*: Uint16                ## ::
              ##   < ::SDL_HAPTIC_CONSTANT
  direction*: HapticDirection  ## ::
                            ##   < Direction of the effect.
  length*: Uint32              ## ::
                ##   < Duration of the effect.
  delay*: Uint16               ## ::
               ##   < Delay before starting the effect.
  button*: Uint16              ## ::
                ##   < Button that triggers the effect.
  interval*: Uint16            ## ::
                  ##   < How soon it can be triggered again after button.
  level*: Sint16               ## ::
               ##   < Strength of the constant effect.
  attackLength*: Uint16        ## ::
                      ##   < Duration of the attack.
  attackLevel*: Uint16         ## ::
                     ##   < Level at the start of the attack.
  fadeLength*: Uint16          ## ::
                    ##   < Duration of the fade.
  fadeLevel*: Uint16           ## ::
                   ##   < Level at the end of the fade.
  
\brief A structure containing a template for a Constant effect.
  
  This struct is exclusively for the ::SDL_HAPTIC_CONSTANT effect.
  
  A constant effect applies a constant force in the specified direction
  to the joystick.
  
  \sa SDL_HAPTIC_CONSTANT
  \sa SDL_HapticEffect
HapticPeriodic {...}{.bycopy.} = object
  kind*: Uint16 ## ::
              ##   < ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT,
              ##                                ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or
              ##                                ::SDL_HAPTIC_SAWTOOTHDOWN
  direction*: HapticDirection  ## ::
                            ##   < Direction of the effect.
  length*: Uint32              ## ::
                ##   < Duration of the effect.
  delay*: Uint16               ## ::
               ##   < Delay before starting the effect.
  button*: Uint16              ## ::
                ##   < Button that triggers the effect.
  interval*: Uint16            ## ::
                  ##   < How soon it can be triggered again after button.
  period*: Uint16              ## ::
                ##   < Period of the wave.
  magnitude*: Sint16           ## ::
                   ##   < Peak value; if negative, equivalent to 180 degrees extra phase shift.
  offset*: Sint16              ## ::
                ##   < Mean value of the wave.
  phase*: Uint16               ## ::
               ##   < Positive phase shift given by hundredth of a degree.
  attackLength*: Uint16        ## ::
                      ##   < Duration of the attack.
  attackLevel*: Uint16         ## ::
                     ##   < Level at the start of the attack.
  fadeLength*: Uint16          ## ::
                    ##   < Duration of the fade.
  fadeLevel*: Uint16           ## ::
                   ##   < Level at the end of the fade.
  
\brief A structure containing a template for a Periodic effect.
  
  The struct handles the following effects:
   - ::SDL_HAPTIC_SINE
   - ::SDL_HAPTIC_LEFTRIGHT
   - ::SDL_HAPTIC_TRIANGLE
   - ::SDL_HAPTIC_SAWTOOTHUP
   - ::SDL_HAPTIC_SAWTOOTHDOWN
  
  A periodic effect consists in a wave-shaped effect that repeats itself
  over time.  The type determines the shape of the wave and the parameters
  determine the dimensions of the wave.
  
  Phase is given by hundredth of a degree meaning that giving the phase a value
  of 9000 will displace it 25% of its period.  Here are sample values:
   -     0: No phase displacement.
   -  9000: Displaced 25% of its period.
   - 18000: Displaced 50% of its period.
   - 27000: Displaced 75% of its period.
   - 36000: Displaced 100% of its period, same as 0, but 0 is preferred.
  
  Examples:
  \verbatim
    SDL_HAPTIC_SINE
      __      __      __      __
     /  \    /  \    /  \    /
    /    \__/    \__/    \__/
    SDL_HAPTIC_SQUARE
     __    __    __    __    __
    |  |  |  |  |  |  |  |  |  |
    |  |__|  |__|  |__|  |__|  |
    SDL_HAPTIC_TRIANGLE
      /\    /\    /\    /\    /\
     /  \  /  \  /  \  /  \  /
    /    \/    \/    \/    \/
    SDL_HAPTIC_SAWTOOTHUP
      /|  /|  /|  /|  /|  /|  /|
     / | / | / | / | / | / | / |
    /  |/  |/  |/  |/  |/  |/  |
    SDL_HAPTIC_SAWTOOTHDOWN
    \  |\  |\  |\  |\  |\  |\  |
     \ | \ | \ | \ | \ | \ | \ |
      \|  \|  \|  \|  \|  \|  \|
    \endverbatim
  
  \sa SDL_HAPTIC_SINE
  \sa SDL_HAPTIC_LEFTRIGHT
  \sa SDL_HAPTIC_TRIANGLE
  \sa SDL_HAPTIC_SAWTOOTHUP
  \sa SDL_HAPTIC_SAWTOOTHDOWN
  \sa SDL_HapticEffect
HapticCondition {...}{.bycopy.} = object
  kind*: Uint16                ## ::
              ##   < ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER,
              ##                                    ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION
  direction*: HapticDirection  ## ::
                            ##   < Direction of the effect - Not used ATM.
  length*: Uint32              ## ::
                ##   < Duration of the effect.
  delay*: Uint16               ## ::
               ##   < Delay before starting the effect.
  button*: Uint16              ## ::
                ##   < Button that triggers the effect.
  interval*: Uint16            ## ::
                  ##   < How soon it can be triggered again after button.
  rightSat*: array[3, Uint16]   ## ::
                           ##   < Level when joystick is to the positive side; max 0xFFFF.
  leftSat*: array[3, Uint16]    ## ::
                          ##   < Level when joystick is to the negative side; max 0xFFFF.
  rightCoeff*: array[3, Sint16] ## ::
                             ##   < How fast to increase the force towards the positive side.
  leftCoeff*: array[3, Sint16]  ## ::
                            ##   < How fast to increase the force towards the negative side.
  deadband*: array[3, Uint16]   ## ::
                           ##   < Size of the dead zone; max 0xFFFF: whole axis-range when 0-centered.
  center*: array[3, Sint16]     ## ::
                         ##   < Position of the dead zone.
  
\brief A structure containing a template for a Condition effect.
  
  The struct handles the following effects:
   - ::SDL_HAPTIC_SPRING: Effect based on axes position.
   - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity.
   - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration.
   - ::SDL_HAPTIC_FRICTION: Effect based on axes movement.
  
  Direction is handled by condition internals instead of a direction member.
  The condition effect specific members have three parameters.  The first
  refers to the X axis, the second refers to the Y axis and the third
  refers to the Z axis.  The right terms refer to the positive side of the
  axis and the left terms refer to the negative side of the axis.  Please
  refer to the ::SDL_HapticDirection diagram for which side is positive and
  which is negative.
  
  \sa SDL_HapticDirection
  \sa SDL_HAPTIC_SPRING
  \sa SDL_HAPTIC_DAMPER
  \sa SDL_HAPTIC_INERTIA
  \sa SDL_HAPTIC_FRICTION
  \sa SDL_HapticEffect
HapticRamp {...}{.bycopy.} = object
  kind*: Uint16                ## ::
              ##   < ::SDL_HAPTIC_RAMP
  direction*: HapticDirection  ## ::
                            ##   < Direction of the effect.
  length*: Uint32              ## ::
                ##   < Duration of the effect.
  delay*: Uint16               ## ::
               ##   < Delay before starting the effect.
  button*: Uint16              ## ::
                ##   < Button that triggers the effect.
  interval*: Uint16            ## ::
                  ##   < How soon it can be triggered again after button.
  start*: Sint16               ## ::
               ##   < Beginning strength level.
  `end`*: Sint16               ## ::
               ##   < Ending strength level.
  attackLength*: Uint16        ## ::
                      ##   < Duration of the attack.
  attackLevel*: Uint16         ## ::
                     ##   < Level at the start of the attack.
  fadeLength*: Uint16          ## ::
                    ##   < Duration of the fade.
  fadeLevel*: Uint16           ## ::
                   ##   < Level at the end of the fade.
  
\brief A structure containing a template for a Ramp effect.
  
  This struct is exclusively for the ::SDL_HAPTIC_RAMP effect.
  
  The ramp effect starts at start strength and ends at end strength.
  It augments in linear fashion.  If you use attack and fade with a ramp
  the effects get added to the ramp effect making the effect become
  quadratic instead of linear.
  
  \sa SDL_HAPTIC_RAMP
  \sa SDL_HapticEffect
HapticLeftRight {...}{.bycopy.} = object
  kind*: Uint16                ## ::
              ##   < ::SDL_HAPTIC_LEFTRIGHT
  length*: Uint32              ## ::
                ##   < Duration of the effect in milliseconds.
  largeMagnitude*: Uint16      ## ::
                        ##   < Control of the large controller motor.
  smallMagnitude*: Uint16      ## ::
                        ##   < Control of the small controller motor.
  
\brief A structure containing a template for a Left/Right effect.
 
 This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect.
 
 The Left/Right effect is used to explicitly control the large and small
 motors, commonly found in modern game controllers. The small (right) motor
 is high frequency, and the large (left) motor is low frequency.
 
 \sa SDL_HAPTIC_LEFTRIGHT
 \sa SDL_HapticEffect
HapticCustom {...}{.bycopy.} = object
  kind*: Uint16                ## ::
              ##   < ::SDL_HAPTIC_CUSTOM
  direction*: HapticDirection  ## ::
                            ##   < Direction of the effect.
  length*: Uint32              ## ::
                ##   < Duration of the effect.
  delay*: Uint16               ## ::
               ##   < Delay before starting the effect.
  button*: Uint16              ## ::
                ##   < Button that triggers the effect.
  interval*: Uint16            ## ::
                  ##   < How soon it can be triggered again after button.
  channels*: Uint8             ## ::
                 ##   < Axes to use, minimum of one.
  period*: Uint16              ## ::
                ##   < Sample periods.
  samples*: Uint16             ## ::
                 ##   < Amount of samples.
  data*: ptr Uint16             ## ::
                 ##   < Should contain channelssamples items.
  attackLength*: Uint16        ## ::
                      ##   < Duration of the attack.
  attackLevel*: Uint16         ## ::
                     ##   < Level at the start of the attack.
  fadeLength*: Uint16          ## ::
                    ##   < Duration of the fade.
  fadeLevel*: Uint16           ## ::
                   ##   < Level at the end of the fade.
  
\brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect.
  
  This struct is exclusively for the ::SDL_HAPTIC_CUSTOM effect.
  
  A custom force feedback effect is much like a periodic effect, where the
  application can define its exact shape.  You will have to allocate the
  data yourself.  Data should consist of channels samples Uint16 samples.
  
  If channels is one, the effect is rotated using the defined direction.
  Otherwise it uses the samples in data for the different axes.
  
  \sa SDL_HAPTIC_CUSTOM
  \sa SDL_HapticEffect
HapticEffect {...}{.union, bycopy.} = object
  kind*: Uint16                ## ::
              ##   < Effect type.
  constant*: HapticConstant    ## ::
                          ##   < Constant effect.
  periodic*: HapticPeriodic    ## ::
                          ##   < Periodic effect.
  condition*: HapticCondition  ## ::
                            ##   < Condition effect.
  ramp*: HapticRamp            ## ::
                  ##   < Ramp effect.
  leftright*: HapticLeftRight  ## ::
                            ##   < Left/Right effect.
  custom*: HapticCustom        ## ::
                      ##   < Custom effect.
  
\brief The generic template for any haptic effect.
  
  All values max at 32767 (0x7FFF).  Signed values also can be negative.
  Time values unless specified otherwise are in milliseconds.
  
  You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767
  value.  Neither delay, interval, attack_length nor fade_length support
  ::SDL_HAPTIC_INFINITY.  Fade will also not be used since effect never ends.
  
  Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of
  ::SDL_HAPTIC_INFINITY.
  
  Button triggers may not be supported on all devices, it is advised to not
  use them if possible.  Buttons start at index 1 instead of index 0 like
  the joystick.
  
  If both attack_length and fade_level are 0, the envelope is not used,
  otherwise both values are used.
  
  Common parts:
  \code
 Replay - All effects have this
  Uint32 length; Duration of effect (ms).
  Uint16 delay; Delay before starting effect.
 
 Trigger - All effects have this
  Uint16 button; Button that triggers effect.
  Uint16 interval; How soon before effect can be triggered again.
 
 Envelope - All effects except condition effects have this
  Uint16 attack_length; Duration of the attack (ms).
  Uint16 attack_level; Level at the start of the attack.
  Uint16 fade_length; Duration of the fade out (ms).
  Uint16 fade_level; Level at the end of the fade.
  \endcode
  
  
  Here we have an example of a constant effect evolution in time:
  \verbatim
    Strength
    ^
    |
    |    effect level -->  _________________
    |                     /                 \
    |                    /                   \
    |                   /                     \
    |                  /                       \
    | attack_level --> |                        \
    |                  |                        |  <---  fade_level
    |
    +--------------------------------------------------> Time
                       [--]                 [---]
                       attack_length        fade_length
    [------------------][-----------------------]
    delay               length
    \endverbatim
  
  Note either the attack_level or the fade_level may be above the actual
  effect level.
  
  \sa SDL_HapticConstant
  \sa SDL_HapticPeriodic
  \sa SDL_HapticCondition
  \sa SDL_HapticRamp
  \sa SDL_HapticLeftRight
  \sa SDL_HapticCustom
HintCallback = proc (userdata: pointer; name: cstring; oldValue: cstring;
                  newValue: cstring) {...}{.cdecl.}
LogOutputFunction = proc (userdata: pointer; category: cint; priority: LogPriority;
                       message: cstring) {...}{.cdecl.}
MessageBoxButtonData {...}{.bycopy.} = object
  flags*: Uint32               ## ::
               ##   < ::SDL_MessageBoxButtonFlags
  buttonid*: cint              ## ::
                ##   < User defined button id (value returned via SDL_ShowMessageBox)
  text*: cstring               ## ::
               ##   < The UTF-8 button text
  
\brief Individual button data.
MessageBoxColor {...}{.bycopy.} = object
  r*: Uint8
  g*: Uint8
  b*: Uint8
\brief RGB value used in a message box color scheme
MessageBoxColorScheme {...}{.bycopy.} = object
  colors*: array[MESSAGEBOX_COLOR_MAX, MessageBoxColor]
\brief A set of colors to use for message box dialogs
MessageBoxData {...}{.bycopy.} = object
  flags*: Uint32               ## ::
               ##   < ::SDL_MessageBoxFlags
  window*: ptr Window           ## ::
                   ##   < Parent window, can be NULL
  title*: cstring              ## ::
                ##   < UTF-8 title
  message*: cstring            ## ::
                  ##   < UTF-8 message text
  numbuttons*: cint
  buttons*: ptr MessageBoxButtonData
  colorScheme*: ptr MessageBoxColorScheme ## ::
                                       ##   < ::SDL_MessageBoxColorScheme, can be NULL to use system settings
  
\brief MessageBox structure containing title, text, window, etc.
MetalView = pointer
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS).
  
  \note This can be cast directly to an NSView or UIView.
RendererInfo {...}{.bycopy.} = object
  name*: cstring               ## ::
               ##   < The name of the renderer
  flags*: Uint32               ## ::
               ##   < Supported ::SDL_RendererFlags
  numTextureFormats*: Uint32   ## ::
                           ##   < The number of available texture formats
  textureFormats*: array[16, Uint32] ## ::
                                  ##   < The available texture formats
  maxTextureWidth*: cint       ## ::
                       ##   < The maximum texture width
  maxTextureHeight*: cint      ## ::
                        ##   < The maximum texture height
  
\brief Information on the capabilities of a render driver or context.
Renderer {...}{.incompleteStruct.} = object
Texture {...}{.incompleteStruct.} = object
Sensor {...}{.incompleteStruct.} = object
SensorID = Sint32
This is a unique ID for a sensor for the time it is connected to the system,
 and is never reused for the lifetime of the application.
 
 The ID value starts at 0 and increments from there. The value -1 is an invalid ID.
WindowShapeParams {...}{.union, bycopy.} = object
  binarizationCutoff*: Uint8
  colorKey*: Color
\brief A union containing parameters for shaped windows.
TimerCallback = proc (interval: Uint32; param: pointer): Uint32 {...}{.cdecl.}
TimerID = cint
Definition of the timer ID type.
Version {...}{.bycopy.} = object
  major*: Uint8                ## ::
              ##   < major version
  minor*: Uint8                ## ::
              ##   < minor version
  patch*: Uint8                ## ::
              ##   < update version
  
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief Information the version of SDL in use.
  
  Represents the library's version as three levels: major revision
  (increments with massive changes, additions, and enhancements),
  minor revision (increments with backwards-compatible changes to the
  major revision), and patchlevel (increments with fixes to the minor
  revision).
  
  \sa SDL_VERSION
  \sa SDL_GetVersion

Consts

SDLCacheDir = "/Users/joey/Projects/nim-sdl2/src/build"
SDLStd = false
SDLGit = false
SDLDL = true
SDLStatic = true
SDLSetVer = ""
SDLLPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2/buildcache/libSDL2.a"
SDLPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2/include/SDL.h"
MIN_UINT8 = 0'u8
MIN_UINT64 = 0'u64
MAX_SINT16 = 32767'i16
MAX_SINT32 = 2147483647'i32
Colour = ""
MOUSE_TOUCHID = -1'i64
WINDOWPOS_CENTERED_MASK = 805240832'u
MAX_UINT8 = 255'u8
BlitScaled = ""
MIN_SINT8 = -128'i8
MIN_UINT16 = 0'u16
MIN_UINT32 = 0'u32
TOUCH_MOUSEID = 4294967295
BlitSurface = ""
WINDOWPOS_UNDEFINED_MASK = 536805376'u
MIN_SINT32 = -2147483648'i32
MUTEX_MAXWAIT = 4294967295
MAX_SINT8 = 127'i8
MAX_UINT16 = 65535'u16
MAX_UINT32 = 4294967295'u32
MIN_SINT16 = -32768'i16
MAX_UINT64 = 18446744073709551615'u64
MAX_SINT64 = 9223372036854775807'i64
MACOSX = 1
SIZEOF_VOIDP = 8
HAVE_GCC_ATOMICS = 1
HAVE_LIBC = 1
STDC_HEADERS = 1
HAVE_ALLOCA_H = 1
HAVE_CTYPE_H = 1
HAVE_FLOAT_H = 1
HAVE_ICONV_H = 1
HAVE_INTTYPES_H = 1
HAVE_LIMITS_H = 1
HAVE_MATH_H = 1
HAVE_MEMORY_H = 1
HAVE_SIGNAL_H = 1
HAVE_STDARG_H = 1
HAVE_STDINT_H = 1
HAVE_STDIO_H = 1
HAVE_STDLIB_H = 1
HAVE_STRINGS_H = 1
HAVE_STRING_H = 1
HAVE_SYS_TYPES_H = 1
HAVE_WCHAR_H = 1
HAVE_LIBUNWIND_H = 1
HAVE_MALLOC = 1
HAVE_CALLOC = 1
HAVE_REALLOC = 1
HAVE_FREE = 1
HAVE_ALLOCA = 1
HAVE_GETENV = 1
HAVE_SETENV = 1
HAVE_PUTENV = 1
HAVE_UNSETENV = 1
HAVE_QSORT = 1
HAVE_ABS = 1
HAVE_BCOPY = 1
HAVE_MEMSET = 1
HAVE_MEMCPY = 1
HAVE_MEMMOVE = 1
HAVE_MEMCMP = 1
HAVE_WCSLEN = 1
HAVE_WCSLCPY = 1
HAVE_WCSLCAT = 1
HAVE_WCSDUP = 1
HAVE_WCSSTR = 1
HAVE_WCSCMP = 1
HAVE_WCSNCMP = 1
HAVE_STRLEN = 1
HAVE_STRLCPY = 1
HAVE_STRLCAT = 1
HAVE_STRCHR = 1
HAVE_STRRCHR = 1
HAVE_STRSTR = 1
HAVE_STRTOK_R = 1
HAVE_STRTOL = 1
HAVE_STRTOUL = 1
HAVE_STRTOLL = 1
HAVE_STRTOULL = 1
HAVE_STRTOD = 1
HAVE_ATOI = 1
HAVE_ATOF = 1
HAVE_STRCMP = 1
HAVE_STRNCMP = 1
HAVE_STRCASECMP = 1
HAVE_STRNCASECMP = 1
HAVE_VSSCANF = 1
HAVE_VSNPRINTF = 1
HAVE_ACOS = 1
HAVE_ACOSF = 1
HAVE_ASIN = 1
HAVE_ASINF = 1
HAVE_ATAN = 1
HAVE_ATANF = 1
HAVE_ATAN2 = 1
HAVE_ATAN2F = 1
HAVE_CEIL = 1
HAVE_CEILF = 1
HAVE_COPYSIGN = 1
HAVE_COPYSIGNF = 1
HAVE_COS = 1
HAVE_COSF = 1
HAVE_EXP = 1
HAVE_EXPF = 1
HAVE_FABS = 1
HAVE_FABSF = 1
HAVE_FLOOR = 1
HAVE_FLOORF = 1
HAVE_FMOD = 1
HAVE_FMODF = 1
HAVE_LOG = 1
HAVE_LOGF = 1
HAVE_LOG10 = 1
HAVE_LOG10F = 1
HAVE_POW = 1
HAVE_POWF = 1
HAVE_SCALBN = 1
HAVE_SCALBNF = 1
HAVE_SIN = 1
HAVE_SINF = 1
HAVE_SQRT = 1
HAVE_SQRTF = 1
HAVE_TAN = 1
HAVE_TANF = 1
HAVE_FSEEKO = 1
HAVE_SIGACTION = 1
HAVE_SA_SIGACTION = 1
HAVE_SETJMP = 1
HAVE_NANOSLEEP = 1
HAVE_SYSCONF = 1
HAVE_SYSCTLBYNAME = 1
HAVE_MPROTECT = 1
HAVE_ICONV = 1
HAVE_PTHREAD_SETNAME_NP = 1
HAVE_POLL = 1
HAVE_EXIT = 1
HAVE_IMMINTRIN_H = 1
AUDIO_DRIVER_COREAUDIO = 1
AUDIO_DRIVER_DISK = 1
AUDIO_DRIVER_DUMMY = 1
JOYSTICK_IOKIT = 1
HAPTIC_TYPE_IOKIT = 1
SENSOR_DUMMY = 1
LOADSO_DLOPEN = 1
THREAD_PTHREAD = 1
THREAD_PTHREAD_RECURSIVE_MUTEX = 1
TIMER_UNIX = 1
VIDEO_DRIVER_COCOA = 1
VIDEO_DRIVER_DUMMY = 1
VIDEO_RENDER_OGL = 1
VIDEO_RENDER_OGL_ES2 = 1
VIDEO_RENDER_METAL = 1
VIDEO_OPENGL = 1
VIDEO_OPENGL_ES2 = 1
VIDEO_OPENGL_CGL = 1
VIDEO_OPENGL_EGL = 1
VIDEO_VULKAN = 1
VIDEO_METAL = 1
POWER_MACOSX = 1
FILESYSTEM_COCOA = 1
ASSEMBLY_ROUTINES = 1
PRIs64 = "lld"
ICONV_ERROR = -1
ICONV_E2BIG = -2
ICONV_EILSEQ = -3
ICONV_EINVAL = -4
ASSERT_LEVEL = 2
NULL_WHILE_LOOP_CONDITION = 0
ASSERTION_RETRY = 0'i32
< Retry the assert immediately.
ASSERTION_BREAK = 1
< Make the debugger trigger a breakpoint.
ASSERTION_ABORT = 2
< Terminate the program.
ASSERTION_IGNORE = 3
< Ignore the assert.
ASSERTION_ALWAYS_IGNORE = 4
< Ignore the assert from now on.
ENOMEM = 0'i32
EFREAD = 1
EFWRITE = 2
EFSEEK = 3
UNSUPPORTED = 4
LASTERROR = 5
LIL_ENDIAN = 1234
BIG_ENDIAN = 4321
BYTEORDER = 1234
MUTEX_TIMEDOUT = 1
THREAD_PRIORITY_LOW = 0'i32
THREAD_PRIORITY_NORMAL = 1
THREAD_PRIORITY_HIGH = 2
THREAD_PRIORITY_TIME_CRITICAL = 3
RWOPS_UNKNOWN = 0'u
RWOPS_WINFILE = 1'u
RWOPS_STDFILE = 2'u
RWOPS_JNIFILE = 3'u
RWOPS_MEMORY = 4'u
RWOPS_MEMORY_RO = 5'u
RW_SEEK_SET = 0
RW_SEEK_CUR = 1
RW_SEEK_END = 2
AUDIO_MASK_BITSIZE = 0x000000FF
AUDIO_MASK_DATATYPE = 256
AUDIO_MASK_ENDIAN = 4096
AUDIO_MASK_SIGNED = 32768
AUDIO_U8 = 0x00000008
AUDIO_S8 = 0x00008008
AUDIO_U16LSB = 0x00000010
AUDIO_S16LSB = 0x00008010
AUDIO_U16MSB = 0x00001010
AUDIO_S16MSB = 0x00009010
AUDIO_U16 = 0x00000010
AUDIO_S16 = 0x00008010
AUDIO_S32LSB = 0x00008020
AUDIO_S32MSB = 0x00009020
AUDIO_S32 = 0x00008020
AUDIO_F32LSB = 0x00008120
AUDIO_F32MSB = 0x00009120
AUDIO_F32 = 0x00008120
AUDIO_U16SYS = 0x00000010
AUDIO_S16SYS = 0x00008010
AUDIO_S32SYS = 0x00008020
AUDIO_F32SYS = 0x00008120
AUDIO_ALLOW_FREQUENCY_CHANGE = 0x00000001
AUDIO_ALLOW_FORMAT_CHANGE = 0x00000002
AUDIO_ALLOW_CHANNELS_CHANGE = 0x00000004
AUDIO_ALLOW_SAMPLES_CHANGE = 0x00000008
AUDIO_ALLOW_ANY_CHANGE = 15
AUDIOCVT_MAX_FILTERS = 9
AUDIO_STOPPED = 0'i32
AUDIO_PLAYING = 1
AUDIO_PAUSED = 2
MIX_MAXVOLUME = 128
CACHELINE_SIZE = 128
ALPHA_OPAQUE = 255
ALPHA_TRANSPARENT = 0
PIXELTYPE_UNKNOWN = 0'i32
PIXELTYPE_INDEX1 = 1
PIXELTYPE_INDEX4 = 2
PIXELTYPE_INDEX8 = 3
PIXELTYPE_PACKED8 = 4
PIXELTYPE_PACKED16 = 5
PIXELTYPE_PACKED32 = 6
PIXELTYPE_ARRAYU8 = 7
PIXELTYPE_ARRAYU16 = 8
PIXELTYPE_ARRAYU32 = 9
PIXELTYPE_ARRAYF16 = 10
PIXELTYPE_ARRAYF32 = 11
BITMAPORDER_NONE = 0'i32
BITMAPORDER_4321 = 1
BITMAPORDER_1234 = 2
PACKEDORDER_NONE = 0'i32
PACKEDORDER_XRGB = 1
PACKEDORDER_RGBX = 2
PACKEDORDER_ARGB = 3
PACKEDORDER_RGBA = 4
PACKEDORDER_XBGR = 5
PACKEDORDER_BGRX = 6
PACKEDORDER_ABGR = 7
PACKEDORDER_BGRA = 8
ARRAYORDER_NONE = 0'i32
ARRAYORDER_RGB = 1
ARRAYORDER_RGBA = 2
ARRAYORDER_ARGB = 3
ARRAYORDER_BGR = 4
ARRAYORDER_BGRA = 5
ARRAYORDER_ABGR = 6
PACKEDLAYOUT_NONE = 0'i32
PACKEDLAYOUT_332 = 1
PACKEDLAYOUT_4444 = 2
PACKEDLAYOUT_1555 = 3
PACKEDLAYOUT_5551 = 4
PACKEDLAYOUT_565 = 5
PACKEDLAYOUT_8888 = 6
PACKEDLAYOUT_2101010 = 7
PACKEDLAYOUT_1010102 = 8
PIXELFORMAT_UNKNOWN = 0'i32
PIXELFORMAT_INDEX1LSB = 286261504'i32
PIXELFORMAT_INDEX1MSB = 287310080'i32
PIXELFORMAT_INDEX4LSB = 303039488'i32
PIXELFORMAT_INDEX4MSB = 304088064'i32
PIXELFORMAT_INDEX8 = 318769153'i32
PIXELFORMAT_RGB332 = 336660481'i32
PIXELFORMAT_RGB444 = 353504258'i32
PIXELFORMAT_BGR444 = 357698562'i32
PIXELFORMAT_RGB555 = 353570562'i32
PIXELFORMAT_BGR555 = 357764866'i32
PIXELFORMAT_ARGB4444 = 355602434'i32
PIXELFORMAT_RGBA4444 = 356651010'i32
PIXELFORMAT_ABGR4444 = 359796738'i32
PIXELFORMAT_BGRA4444 = 360845314'i32
PIXELFORMAT_ARGB1555 = 355667970'i32
PIXELFORMAT_RGBA5551 = 356782082'i32
PIXELFORMAT_ABGR1555 = 359862274'i32
PIXELFORMAT_BGRA5551 = 360976386'i32
PIXELFORMAT_RGB565 = 353701890'i32
PIXELFORMAT_BGR565 = 357896194'i32
PIXELFORMAT_RGB24 = 386930691'i32
PIXELFORMAT_BGR24 = 390076419'i32
PIXELFORMAT_RGB888 = 370546692'i32
PIXELFORMAT_RGBX8888 = 371595268'i32
PIXELFORMAT_BGR888 = 374740996'i32
PIXELFORMAT_BGRX8888 = 375789572'i32
PIXELFORMAT_ARGB8888 = 372645892'i32
PIXELFORMAT_RGBA8888 = 373694468'i32
PIXELFORMAT_ABGR8888 = 376840196'i32
PIXELFORMAT_BGRA8888 = 377888772'i32
PIXELFORMAT_ARGB2101010 = 372711428'i32
Aliases for RGBA byte arrays of color data, for the current platform
PIXELFORMAT_RGBA32 = 376840196'i32
PIXELFORMAT_ARGB32 = 377888772'i32
PIXELFORMAT_BGRA32 = 372645892'i32
PIXELFORMAT_ABGR32 = 373694468'i32
PIXELFORMAT_YV12 = 373694469
PIXELFORMAT_IYUV = 373694470
PIXELFORMAT_YUY2 = 373694471
PIXELFORMAT_UYVY = 373694472
PIXELFORMAT_YVYU = 373694473
PIXELFORMAT_NV12 = 373694474
PIXELFORMAT_NV21 = 373694475
PIXELFORMAT_EXTERNAL_OES = 373694476
BLENDMODE_NONE = 0'i32
< no blending
                                              dstRGBA = srcRGBA
BLENDMODE_BLEND = 1'i32
< alpha blending
                                              dstRGB = (srcRGB srcA) + (dstRGB (1-srcA))
                                              dstA = srcA + (dstA (1-srcA))
BLENDMODE_ADD = 2'i32
< additive blending
                                              dstRGB = (srcRGB srcA) + dstRGB
                                              dstA = dstA
BLENDMODE_MOD = 4'i32
< color modulate
                                              dstRGB = srcRGB dstRGB
                                              dstA = dstA
BLENDMODE_MUL = 8'i32
< color multiply
                                              dstRGB = (srcRGB dstRGB) + (dstRGB (1-srcA))
                                              dstA = (srcA dstA) + (dstA (1-srcA))
BLENDMODE_INVALID = 2147483647'i32
Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode()
BLENDOPERATION_ADD = 1'i32
< dst + src: supported by all renderers
BLENDOPERATION_SUBTRACT = 2'i32
< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES
BLENDOPERATION_REV_SUBTRACT = 3'i32
< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES
BLENDOPERATION_MINIMUM = 4'i32
< min(dst, src) : supported by D3D11
BLENDOPERATION_MAXIMUM = 5'i32
< max(dst, src) : supported by D3D11
BLENDFACTOR_ZERO = 1'i32
< 0, 0, 0, 0
BLENDFACTOR_ONE = 2'i32
< 1, 1, 1, 1
BLENDFACTOR_SRC_COLOR = 3'i32
< srcR, srcG, srcB, srcA
BLENDFACTOR_ONE_MINUS_SRC_COLOR = 4'i32
< 1-srcR, 1-srcG, 1-srcB, 1-srcA
BLENDFACTOR_SRC_ALPHA = 5'i32
< srcA, srcA, srcA, srcA
BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 6'i32
< 1-srcA, 1-srcA, 1-srcA, 1-srcA
BLENDFACTOR_DST_COLOR = 7'i32
< dstR, dstG, dstB, dstA
BLENDFACTOR_ONE_MINUS_DST_COLOR = 8'i32
< 1-dstR, 1-dstG, 1-dstB, 1-dstA
BLENDFACTOR_DST_ALPHA = 9'i32
< dstA, dstA, dstA, dstA
BLENDFACTOR_ONE_MINUS_DST_ALPHA = 10'i32
< 1-dstA, 1-dstA, 1-dstA, 1-dstA
SWSURFACE = 0
PREALLOC = 0x00000001
RLEACCEL = 0x00000002
DONTFREE = 0x00000004
SIMD_ALIGNED = 0x00000008
YUV_CONVERSION_JPEG = 0'i32
< Full range JPEG
YUV_CONVERSION_BT601 = 1
< BT.601 (the default)
YUV_CONVERSION_BT709 = 2
< BT.709
YUV_CONVERSION_AUTOMATIC = 3
< BT.601 for SD content, BT.709 for HD content
WINDOW_FULLSCREEN = 1'i32
< fullscreen window
WINDOW_OPENGL = 2'i32
< window usable with OpenGL context
WINDOW_SHOWN = 4'i32
< window is visible
WINDOW_HIDDEN = 8'i32
< window is not visible
WINDOW_BORDERLESS = 16'i32
< no window decoration
WINDOW_RESIZABLE = 32'i32
< window can be resized
WINDOW_MINIMIZED = 64'i32
< window is minimized
WINDOW_MAXIMIZED = 128'i32
< window is maximized
WINDOW_INPUT_GRABBED = 256'i32
< window has grabbed input focus
WINDOW_INPUT_FOCUS = 512'i32
< window has input focus
WINDOW_MOUSE_FOCUS = 1024'i32
< window has mouse focus
WINDOW_FULLSCREEN_DESKTOP = 4097'i32
WINDOW_FOREIGN = 2048'i32
< window not created by SDL
WINDOW_ALLOW_HIGHDPI = 8192'i32
< window should be created in high-DPI mode if supported.
                                                     On macOS NSHighResolutionCapable must be set true in the
                                                     application's Info.plist for this to have any effect.
WINDOW_MOUSE_CAPTURE = 16384'i32
< window has mouse captured (unrelated to INPUT_GRABBED)
WINDOW_ALWAYS_ON_TOP = 32768'i32
< window should always be above others
WINDOW_SKIP_TASKBAR = 65536'i32
< window should not be added to the taskbar
WINDOW_UTILITY = 131072'i32
< window should be treated as a utility window
WINDOW_TOOLTIP = 262144'i32
< window should be treated as a tooltip
WINDOW_POPUP_MENU = 524288'i32
< window should be treated as a popup menu
WINDOW_VULKAN = 268435456'i32
< window usable for Vulkan surface
WINDOWEVENT_NONE = 0'i32
< Never used
WINDOWEVENT_SHOWN = 1
< Window has been shown
WINDOWEVENT_HIDDEN = 2
< Window has been hidden
WINDOWEVENT_EXPOSED = 3
< Window has been exposed and should be
                                         redrawn
WINDOWEVENT_MOVED = 4
< Window has been moved to data1, data2
WINDOWEVENT_RESIZED = 5
< Window has been resized to data1xdata2
WINDOWEVENT_SIZE_CHANGED = 6
< The window size has changed, either as
                                         a result of an API call or through the
                                         system or user changing the window size.
WINDOWEVENT_MINIMIZED = 7
< Window has been minimized
WINDOWEVENT_MAXIMIZED = 8
< Window has been maximized
WINDOWEVENT_RESTORED = 9
< Window has been restored to normal size
                                         and position
WINDOWEVENT_ENTER = 10
< Window has gained mouse focus
WINDOWEVENT_LEAVE = 11
< Window has lost mouse focus
WINDOWEVENT_FOCUS_GAINED = 12
< Window has gained keyboard focus
WINDOWEVENT_FOCUS_LOST = 13
< Window has lost keyboard focus
WINDOWEVENT_CLOSE = 14
< The window manager requests that the window be closed
WINDOWEVENT_TAKE_FOCUS = 15
< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore)
WINDOWEVENT_HIT_TEST = 16
< Window had a hit test that wasn't SDL_HITTEST_NORMAL.
DISPLAYEVENT_NONE = 0'i32
< Never used
DISPLAYEVENT_ORIENTATION = 1
< Display orientation has changed to data1
ORIENTATION_UNKNOWN = 0'i32
< The display orientation can't be determined
ORIENTATION_LANDSCAPE = 1
< The display is in landscape mode, with the right side up, relative to portrait mode
ORIENTATION_LANDSCAPE_FLIPPED = 2
< The display is in landscape mode, with the left side up, relative to portrait mode
ORIENTATION_PORTRAIT = 3
< The display is in portrait mode
ORIENTATION_PORTRAIT_FLIPPED = 4
< The display is in portrait mode, upside down
GL_RED_SIZE = 0'i32
GL_GREEN_SIZE = 1
GL_BLUE_SIZE = 2
GL_ALPHA_SIZE = 3
GL_BUFFER_SIZE = 4
GL_DOUBLEBUFFER = 5
GL_DEPTH_SIZE = 6
GL_STENCIL_SIZE = 7
GL_ACCUM_RED_SIZE = 8
GL_ACCUM_GREEN_SIZE = 9
GL_ACCUM_BLUE_SIZE = 10
GL_ACCUM_ALPHA_SIZE = 11
GL_STEREO = 12
GL_MULTISAMPLEBUFFERS = 13
GL_MULTISAMPLESAMPLES = 14
GL_ACCELERATED_VISUAL = 15
GL_RETAINED_BACKING = 16
GL_CONTEXT_MAJOR_VERSION = 17
GL_CONTEXT_MINOR_VERSION = 18
GL_CONTEXT_EGL = 19
GL_CONTEXT_FLAGS = 20
GL_CONTEXT_PROFILE_MASK = 21
GL_SHARE_WITH_CURRENT_CONTEXT = 22
GL_FRAMEBUFFER_SRGB_CAPABLE = 23
GL_CONTEXT_RELEASE_BEHAVIOR = 24
GL_CONTEXT_RESET_NOTIFICATION = 25
GL_CONTEXT_NO_ERROR = 26
GL_CONTEXT_PROFILE_CORE = 1'i32
GL_CONTEXT_PROFILE_COMPATIBILITY = 2'i32
GL_CONTEXT_PROFILE_ES = 4'i32
< GLX_CONTEXT_ES2_PROFILE_BIT_EXT
GL_CONTEXT_DEBUG_FLAG = 1'i32
GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 2'i32
GL_CONTEXT_ROBUST_ACCESS_FLAG = 4'i32
GL_CONTEXT_RESET_ISOLATION_FLAG = 8'i32
GL_CONTEXT_RELEASE_BEHAVIOR_NONE = 0'i32
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 1'i32
GL_CONTEXT_RESET_NO_NOTIFICATION = 0'i32
GL_CONTEXT_RESET_LOSE_CONTEXT = 1'i32
HITTEST_NORMAL = 0'i32
< Region is normal. No special properties.
HITTEST_DRAGGABLE = 1
< Region can drag entire window.
HITTEST_RESIZE_TOPLEFT = 2
HITTEST_RESIZE_TOP = 3
HITTEST_RESIZE_TOPRIGHT = 4
HITTEST_RESIZE_RIGHT = 5
HITTEST_RESIZE_BOTTOMRIGHT = 6
HITTEST_RESIZE_BOTTOM = 7
HITTEST_RESIZE_BOTTOMLEFT = 8
HITTEST_RESIZE_LEFT = 9
SCANCODE_UNKNOWN = 0'i32
\name Usage page 0x07
  
  These values are from usage page 0x07 (USB keyboard page).
SCANCODE_A = 4'i32
SCANCODE_B = 5'i32
SCANCODE_C = 6'i32
SCANCODE_D = 7'i32
SCANCODE_E = 8'i32
SCANCODE_F = 9'i32
SCANCODE_G = 10'i32
SCANCODE_H = 11'i32
SCANCODE_I = 12'i32
SCANCODE_J = 13'i32
SCANCODE_K = 14'i32
SCANCODE_L = 15'i32
SCANCODE_M = 16'i32
SCANCODE_N = 17'i32
SCANCODE_O = 18'i32
SCANCODE_P = 19'i32
SCANCODE_Q = 20'i32
SCANCODE_R = 21'i32
SCANCODE_S = 22'i32
SCANCODE_T = 23'i32
SCANCODE_U = 24'i32
SCANCODE_V = 25'i32
SCANCODE_W = 26'i32
SCANCODE_X = 27'i32
SCANCODE_Y = 28'i32
SCANCODE_Z = 29'i32
SCANCODE_1 = 30'i32
SCANCODE_2 = 31'i32
SCANCODE_3 = 32'i32
SCANCODE_4 = 33'i32
SCANCODE_5 = 34'i32
SCANCODE_6 = 35'i32
SCANCODE_7 = 36'i32
SCANCODE_8 = 37'i32
SCANCODE_9 = 38'i32
SCANCODE_0 = 39'i32
SCANCODE_RETURN = 40'i32
SCANCODE_ESCAPE = 41'i32
SCANCODE_BACKSPACE = 42'i32
SCANCODE_TAB = 43'i32
SCANCODE_SPACE = 44'i32
SCANCODE_MINUS = 45'i32
SCANCODE_EQUALS = 46'i32
SCANCODE_LEFTBRACKET = 47'i32
SCANCODE_RIGHTBRACKET = 48'i32
SCANCODE_BACKSLASH = 49'i32
< Located at the lower left of the return
   key on ISO keyboards and at the right end
   of the QWERTY row on ANSI keyboards.
   Produces REVERSE SOLIDUS (backslash) and
   VERTICAL LINE in a US layout, REVERSE
   SOLIDUS and VERTICAL LINE in a UK Mac
   layout, NUMBER SIGN and TILDE in a UK
   Windows layout, DOLLAR SIGN and POUND SIGN
   in a Swiss German layout, NUMBER SIGN and
   APOSTROPHE in a German layout, GRAVE
   ACCENT and POUND SIGN in a French Mac
   layout, and ASTERISK and MICRO SIGN in a
   French Windows layout.
SCANCODE_NONUSHASH = 50'i32
< ISO USB keyboards actually use this code
   instead of 49 for the same key, but all
   OSes I've seen treat the two codes
   identically. So, as an implementor, unless
   your keyboard generates both of those
   codes and your OS treats them differently,
   you should generate SDL_SCANCODE_BACKSLASH
   instead of this code. As a user, you
   should not rely on this code because SDL
   will never generate it with most (all?)
   keyboards.
SCANCODE_SEMICOLON = 51'i32
SCANCODE_APOSTROPHE = 52'i32
SCANCODE_GRAVE = 53'i32
< Located in the top left corner (on both ANSI
   and ISO keyboards). Produces GRAVE ACCENT and
   TILDE in a US Windows layout and in US and UK
   Mac layouts on ANSI keyboards, GRAVE ACCENT
   and NOT SIGN in a UK Windows layout, SECTION
   SIGN and PLUS-MINUS SIGN in US and UK Mac
   layouts on ISO keyboards, SECTION SIGN and
   DEGREE SIGN in a Swiss German layout (Mac:
   only on ISO keyboards), CIRCUMFLEX ACCENT and
   DEGREE SIGN in a German layout (Mac: only on
   ISO keyboards), SUPERSCRIPT TWO and TILDE in a
   French Windows layout, COMMERCIAL AT and
   NUMBER SIGN in a French Mac layout on ISO
   keyboards, and LESS-THAN SIGN and GREATER-THAN
   SIGN in a Swiss German, German, or French Mac
   layout on ANSI keyboards.
SCANCODE_COMMA = 54'i32
SCANCODE_PERIOD = 55'i32
SCANCODE_SLASH = 56'i32
SCANCODE_CAPSLOCK = 57'i32
SCANCODE_F1 = 58'i32
SCANCODE_F2 = 59'i32
SCANCODE_F3 = 60'i32
SCANCODE_F4 = 61'i32
SCANCODE_F5 = 62'i32
SCANCODE_F6 = 63'i32
SCANCODE_F7 = 64'i32
SCANCODE_F8 = 65'i32
SCANCODE_F9 = 66'i32
SCANCODE_F10 = 67'i32
SCANCODE_F11 = 68'i32
SCANCODE_F12 = 69'i32
SCANCODE_PRINTSCREEN = 70'i32
SCANCODE_SCROLLLOCK = 71'i32
SCANCODE_PAUSE = 72'i32
SCANCODE_INSERT = 73'i32
< insert on PC, help on some Mac keyboards (but
                                   does send code 73, not 117)
SCANCODE_HOME = 74'i32
SCANCODE_PAGEUP = 75'i32
SCANCODE_DELETE = 76'i32
SCANCODE_END = 77'i32
SCANCODE_PAGEDOWN = 78'i32
SCANCODE_RIGHT = 79'i32
SCANCODE_LEFT = 80'i32
SCANCODE_DOWN = 81'i32
SCANCODE_UP = 82'i32
SCANCODE_NUMLOCKCLEAR = 83'i32
< num lock on PC, clear on Mac keyboards
SCANCODE_KP_DIVIDE = 84'i32
SCANCODE_KP_MULTIPLY = 85'i32
SCANCODE_KP_MINUS = 86'i32
SCANCODE_KP_PLUS = 87'i32
SCANCODE_KP_ENTER = 88'i32
SCANCODE_KP_1 = 89'i32
SCANCODE_KP_2 = 90'i32
SCANCODE_KP_3 = 91'i32
SCANCODE_KP_4 = 92'i32
SCANCODE_KP_5 = 93'i32
SCANCODE_KP_6 = 94'i32
SCANCODE_KP_7 = 95'i32
SCANCODE_KP_8 = 96'i32
SCANCODE_KP_9 = 97'i32
SCANCODE_KP_0 = 98'i32
SCANCODE_KP_PERIOD = 99'i32
SCANCODE_NONUSBACKSLASH = 100'i32
< This is the additional key that ISO
   keyboards have over ANSI ones,
   located between left shift and Y.
   Produces GRAVE ACCENT and TILDE in a
   US or UK Mac layout, REVERSE SOLIDUS
   (backslash) and VERTICAL LINE in a
   US or UK Windows layout, and
   LESS-THAN SIGN and GREATER-THAN SIGN
   in a Swiss German, German, or French
   layout.
SCANCODE_APPLICATION = 101'i32
< windows contextual menu, compose
SCANCODE_POWER = 102'i32
< The USB document says this is a status flag,
   not a physical key - but some Mac keyboards
   do have a power key.
SCANCODE_KP_EQUALS = 103'i32
SCANCODE_F13 = 104'i32
SCANCODE_F14 = 105'i32
SCANCODE_F15 = 106'i32
SCANCODE_F16 = 107'i32
SCANCODE_F17 = 108'i32
SCANCODE_F18 = 109'i32
SCANCODE_F19 = 110'i32
SCANCODE_F20 = 111'i32
SCANCODE_F21 = 112'i32
SCANCODE_F22 = 113'i32
SCANCODE_F23 = 114'i32
SCANCODE_F24 = 115'i32
SCANCODE_EXECUTE = 116'i32
SCANCODE_HELP = 117'i32
SCANCODE_MENU = 118'i32
SCANCODE_SELECT = 119'i32
SCANCODE_STOP = 120'i32
SCANCODE_AGAIN = 121'i32
< redo
SCANCODE_UNDO = 122'i32
SCANCODE_CUT = 123'i32
SCANCODE_COPY = 124'i32
SCANCODE_PASTE = 125'i32
SCANCODE_FIND = 126'i32
SCANCODE_MUTE = 127'i32
SCANCODE_VOLUMEUP = 128'i32
SCANCODE_VOLUMEDOWN = 129'i32
not sure whether there's a reason to enable these
SCANCODE_KP_COMMA = 133'i32
SCANCODE_KP_EQUALSAS400 = 134'i32
SCANCODE_INTERNATIONAL1 = 135'i32
< used on Asian keyboards, see
                                            footnotes in USB doc
SCANCODE_INTERNATIONAL2 = 136'i32
SCANCODE_INTERNATIONAL3 = 137'i32
< Yen
SCANCODE_INTERNATIONAL4 = 138'i32
SCANCODE_INTERNATIONAL5 = 139'i32
SCANCODE_INTERNATIONAL6 = 140'i32
SCANCODE_INTERNATIONAL7 = 141'i32
SCANCODE_INTERNATIONAL8 = 142'i32
SCANCODE_INTERNATIONAL9 = 143'i32
SCANCODE_LANG1 = 144'i32
< Hangul/English toggle
SCANCODE_LANG2 = 145'i32
< Hanja conversion
SCANCODE_LANG3 = 146'i32
< Katakana
SCANCODE_LANG4 = 147'i32
< Hiragana
SCANCODE_LANG5 = 148'i32
< Zenkaku/Hankaku
SCANCODE_LANG6 = 149'i32
< reserved
SCANCODE_LANG7 = 150'i32
< reserved
SCANCODE_LANG8 = 151'i32
< reserved
SCANCODE_LANG9 = 152'i32
< reserved
SCANCODE_ALTERASE = 153'i32
< Erase-Eaze
SCANCODE_SYSREQ = 154'i32
SCANCODE_CANCEL = 155'i32
SCANCODE_CLEAR = 156'i32
SCANCODE_PRIOR = 157'i32
SCANCODE_RETURN2 = 158'i32
SCANCODE_SEPARATOR = 159'i32
SCANCODE_OUT = 160'i32
SCANCODE_OPER = 161'i32
SCANCODE_CLEARAGAIN = 162'i32
SCANCODE_CRSEL = 163'i32
SCANCODE_EXSEL = 164'i32
SCANCODE_KP_00 = 176'i32
SCANCODE_KP_000 = 177'i32
SCANCODE_THOUSANDSSEPARATOR = 178'i32
SCANCODE_DECIMALSEPARATOR = 179'i32
SCANCODE_CURRENCYUNIT = 180'i32
SCANCODE_CURRENCYSUBUNIT = 181'i32
SCANCODE_KP_LEFTPAREN = 182'i32
SCANCODE_KP_RIGHTPAREN = 183'i32
SCANCODE_KP_LEFTBRACE = 184'i32
SCANCODE_KP_RIGHTBRACE = 185'i32
SCANCODE_KP_TAB = 186'i32
SCANCODE_KP_BACKSPACE = 187'i32
SCANCODE_KP_A = 188'i32
SCANCODE_KP_B = 189'i32
SCANCODE_KP_C = 190'i32
SCANCODE_KP_D = 191'i32
SCANCODE_KP_E = 192'i32
SCANCODE_KP_F = 193'i32
SCANCODE_KP_XOR = 194'i32
SCANCODE_KP_POWER = 195'i32
SCANCODE_KP_PERCENT = 196'i32
SCANCODE_KP_LESS = 197'i32
SCANCODE_KP_GREATER = 198'i32
SCANCODE_KP_AMPERSAND = 199'i32
SCANCODE_KP_DBLAMPERSAND = 200'i32
SCANCODE_KP_VERTICALBAR = 201'i32
SCANCODE_KP_DBLVERTICALBAR = 202'i32
SCANCODE_KP_COLON = 203'i32
SCANCODE_KP_HASH = 204'i32
SCANCODE_KP_SPACE = 205'i32
SCANCODE_KP_AT = 206'i32
SCANCODE_KP_EXCLAM = 207'i32
SCANCODE_KP_MEMSTORE = 208'i32
SCANCODE_KP_MEMRECALL = 209'i32
SCANCODE_KP_MEMCLEAR = 210'i32
SCANCODE_KP_MEMADD = 211'i32
SCANCODE_KP_MEMSUBTRACT = 212'i32
SCANCODE_KP_MEMMULTIPLY = 213'i32
SCANCODE_KP_MEMDIVIDE = 214'i32
SCANCODE_KP_PLUSMINUS = 215'i32
SCANCODE_KP_CLEAR = 216'i32
SCANCODE_KP_CLEARENTRY = 217'i32
SCANCODE_KP_BINARY = 218'i32
SCANCODE_KP_OCTAL = 219'i32
SCANCODE_KP_DECIMAL = 220'i32
SCANCODE_KP_HEXADECIMAL = 221'i32
SCANCODE_LCTRL = 224'i32
SCANCODE_LSHIFT = 225'i32
SCANCODE_LALT = 226'i32
< alt, option
SCANCODE_LGUI = 227'i32
< windows, command (apple), meta
SCANCODE_RCTRL = 228'i32
SCANCODE_RSHIFT = 229'i32
SCANCODE_RALT = 230'i32
< alt gr, option
SCANCODE_RGUI = 231'i32
< windows, command (apple), meta
SCANCODE_MODE = 257'i32
< I'm not sure if this is really not covered
   by any of the above, but since there's a
   special KMOD_MODE for it I'm adding it here
SCANCODE_AUDIONEXT = 258'i32
SCANCODE_AUDIOPREV = 259'i32
SCANCODE_AUDIOSTOP = 260'i32
SCANCODE_AUDIOPLAY = 261'i32
SCANCODE_AUDIOMUTE = 262'i32
SCANCODE_MEDIASELECT = 263'i32
SCANCODE_WWW = 264'i32
SCANCODE_MAIL = 265'i32
SCANCODE_CALCULATOR = 266'i32
SCANCODE_COMPUTER = 267'i32
SCANCODE_AC_SEARCH = 268'i32
SCANCODE_AC_HOME = 269'i32
SCANCODE_AC_BACK = 270'i32
SCANCODE_AC_FORWARD = 271'i32
SCANCODE_AC_STOP = 272'i32
SCANCODE_AC_REFRESH = 273'i32
SCANCODE_AC_BOOKMARKS = 274'i32
@}
SCANCODE_BRIGHTNESSDOWN = 275'i32
SCANCODE_BRIGHTNESSUP = 276'i32
SCANCODE_DISPLAYSWITCH = 277'i32
< display mirroring/dual display
                                           switch, video mode switch
SCANCODE_KBDILLUMTOGGLE = 278'i32
SCANCODE_KBDILLUMDOWN = 279'i32
SCANCODE_KBDILLUMUP = 280'i32
SCANCODE_EJECT = 281'i32
SCANCODE_SLEEP = 282'i32
SCANCODE_APP1 = 283'i32
SCANCODE_APP2 = 284'i32
@}
SCANCODE_AUDIOREWIND = 285'i32
SCANCODE_AUDIOFASTFORWARD = 286'i32
@}
NUM_SCANCODES = 512'i32
< not a key, just marks the number of scancodes
                                 for array bounds
KEYCODE_SCANCODE_MASK = 1073741824
KEYCODE_UNKNOWN = 0'i32
KEYCODE_RETURN = 13'i32
KEYCODE_ESCAPE = 27'i32
KEYCODE_BACKSPACE = 8'i32
KEYCODE_TAB = 9'i32
KEYCODE_SPACE = 32'i32
KEYCODE_EXCLAIM = 33'i32
KEYCODE_QUOTEDBL = 34'i32
KEYCODE_HASH = 35'i32
KEYCODE_PERCENT = 37'i32
KEYCODE_DOLLAR = 36'i32
KEYCODE_AMPERSAND = 38'i32
KEYCODE_QUOTE = 39'i32
KEYCODE_LEFTPAREN = 40'i32
KEYCODE_RIGHTPAREN = 41'i32
KEYCODE_ASTERISK = 42'i32
KEYCODE_PLUS = 43'i32
KEYCODE_COMMA = 44'i32
KEYCODE_MINUS = 45'i32
KEYCODE_PERIOD = 46'i32
KEYCODE_SLASH = 47'i32
KEYCODE_0 = 48'i32
KEYCODE_1 = 49'i32
KEYCODE_2 = 50'i32
KEYCODE_3 = 51'i32
KEYCODE_4 = 52'i32
KEYCODE_5 = 53'i32
KEYCODE_6 = 54'i32
KEYCODE_7 = 55'i32
KEYCODE_8 = 56'i32
KEYCODE_9 = 57'i32
KEYCODE_COLON = 58'i32
KEYCODE_SEMICOLON = 59'i32
KEYCODE_LESS = 60'i32
KEYCODE_EQUALS = 61'i32
KEYCODE_GREATER = 62'i32
KEYCODE_QUESTION = 63'i32
KEYCODE_AT = 64'i32
Skip uppercase letters
KEYCODE_LEFTBRACKET = 91'i32
KEYCODE_BACKSLASH = 92'i32
KEYCODE_RIGHTBRACKET = 93'i32
KEYCODE_CARET = 94'i32
KEYCODE_UNDERSCORE = 95'i32
KEYCODE_BACKQUOTE = 96'i32
KEYCODE_a = 97'i32
KEYCODE_b = 98'i32
KEYCODE_c = 99'i32
KEYCODE_d = 100'i32
KEYCODE_e = 101'i32
KEYCODE_f = 102'i32
KEYCODE_g = 103'i32
KEYCODE_h = 104'i32
KEYCODE_i = 105'i32
KEYCODE_j = 106'i32
KEYCODE_k = 107'i32
KEYCODE_l = 108'i32
KEYCODE_m = 109'i32
KEYCODE_n = 110'i32
KEYCODE_o = 111'i32
KEYCODE_p = 112'i32
KEYCODE_q = 113'i32
KEYCODE_r = 114'i32
KEYCODE_s = 115'i32
KEYCODE_t = 116'i32
KEYCODE_u = 117'i32
KEYCODE_v = 118'i32
KEYCODE_w = 119'i32
KEYCODE_x = 120'i32
KEYCODE_y = 121'i32
KEYCODE_z = 122'i32
KEYCODE_CAPSLOCK = 1073741881'i32
KEYCODE_F1 = 1073741882'i32
KEYCODE_F2 = 1073741883'i32
KEYCODE_F3 = 1073741884'i32
KEYCODE_F4 = 1073741885'i32
KEYCODE_F5 = 1073741886'i32
KEYCODE_F6 = 1073741887'i32
KEYCODE_F7 = 1073741888'i32
KEYCODE_F8 = 1073741889'i32
KEYCODE_F9 = 1073741890'i32
KEYCODE_F10 = 1073741891'i32
KEYCODE_F11 = 1073741892'i32
KEYCODE_F12 = 1073741893'i32
KEYCODE_PRINTSCREEN = 1073741894'i32
KEYCODE_SCROLLLOCK = 1073741895'i32
KEYCODE_PAUSE = 1073741896'i32
KEYCODE_INSERT = 1073741897'i32
KEYCODE_HOME = 1073741898'i32
KEYCODE_PAGEUP = 1073741899'i32
KEYCODE_DELETE = 127'i32
KEYCODE_END = 1073741901'i32
KEYCODE_PAGEDOWN = 1073741902'i32
KEYCODE_RIGHT = 1073741903'i32
KEYCODE_LEFT = 1073741904'i32
KEYCODE_DOWN = 1073741905'i32
KEYCODE_UP = 1073741906'i32
KEYCODE_NUMLOCKCLEAR = 1073741907'i32
KEYCODE_KP_DIVIDE = 1073741908'i32
KEYCODE_KP_MULTIPLY = 1073741909'i32
KEYCODE_KP_MINUS = 1073741910'i32
KEYCODE_KP_PLUS = 1073741911'i32
KEYCODE_KP_ENTER = 1073741912'i32
KEYCODE_KP_1 = 1073741913'i32
KEYCODE_KP_2 = 1073741914'i32
KEYCODE_KP_3 = 1073741915'i32
KEYCODE_KP_4 = 1073741916'i32
KEYCODE_KP_5 = 1073741917'i32
KEYCODE_KP_6 = 1073741918'i32
KEYCODE_KP_7 = 1073741919'i32
KEYCODE_KP_8 = 1073741920'i32
KEYCODE_KP_9 = 1073741921'i32
KEYCODE_KP_0 = 1073741922'i32
KEYCODE_KP_PERIOD = 1073741923'i32
KEYCODE_APPLICATION = 1073741925'i32
KEYCODE_POWER = 1073741926'i32
KEYCODE_KP_EQUALS = 1073741927'i32
KEYCODE_F13 = 1073741928'i32
KEYCODE_F14 = 1073741929'i32
KEYCODE_F15 = 1073741930'i32
KEYCODE_F16 = 1073741931'i32
KEYCODE_F17 = 1073741932'i32
KEYCODE_F18 = 1073741933'i32
KEYCODE_F19 = 1073741934'i32
KEYCODE_F20 = 1073741935'i32
KEYCODE_F21 = 1073741936'i32
KEYCODE_F22 = 1073741937'i32
KEYCODE_F23 = 1073741938'i32
KEYCODE_F24 = 1073741939'i32
KEYCODE_EXECUTE = 1073741940'i32
KEYCODE_HELP = 1073741941'i32
KEYCODE_MENU = 1073741942'i32
KEYCODE_SELECT = 1073741943'i32
KEYCODE_STOP = 1073741944'i32
KEYCODE_AGAIN = 1073741945'i32
KEYCODE_UNDO = 1073741946'i32
KEYCODE_CUT = 1073741947'i32
KEYCODE_COPY = 1073741948'i32
KEYCODE_PASTE = 1073741949'i32
KEYCODE_FIND = 1073741950'i32
KEYCODE_MUTE = 1073741951'i32
KEYCODE_VOLUMEUP = 1073741952'i32
KEYCODE_VOLUMEDOWN = 1073741953'i32
KEYCODE_KP_COMMA = 1073741957'i32
KEYCODE_KP_EQUALSAS400 = 1073741958'i32
KEYCODE_ALTERASE = 1073741977'i32
KEYCODE_SYSREQ = 1073741978'i32
KEYCODE_CANCEL = 1073741979'i32
KEYCODE_CLEAR = 1073741980'i32
KEYCODE_PRIOR = 1073741981'i32
KEYCODE_RETURN2 = 1073741982'i32
KEYCODE_SEPARATOR = 1073741983'i32
KEYCODE_OUT = 1073741984'i32
KEYCODE_OPER = 1073741985'i32
KEYCODE_CLEARAGAIN = 1073741986'i32
KEYCODE_CRSEL = 1073741987'i32
KEYCODE_EXSEL = 1073741988'i32
KEYCODE_KP_00 = 1073742000'i32
KEYCODE_KP_000 = 1073742001'i32
KEYCODE_THOUSANDSSEPARATOR = 1073742002'i32
KEYCODE_DECIMALSEPARATOR = 1073742003'i32
KEYCODE_CURRENCYUNIT = 1073742004'i32
KEYCODE_CURRENCYSUBUNIT = 1073742005'i32
KEYCODE_KP_LEFTPAREN = 1073742006'i32
KEYCODE_KP_RIGHTPAREN = 1073742007'i32
KEYCODE_KP_LEFTBRACE = 1073742008'i32
KEYCODE_KP_RIGHTBRACE = 1073742009'i32
KEYCODE_KP_TAB = 1073742010'i32
KEYCODE_KP_BACKSPACE = 1073742011'i32
KEYCODE_KP_A = 1073742012'i32
KEYCODE_KP_B = 1073742013'i32
KEYCODE_KP_C = 1073742014'i32
KEYCODE_KP_D = 1073742015'i32
KEYCODE_KP_E = 1073742016'i32
KEYCODE_KP_F = 1073742017'i32
KEYCODE_KP_XOR = 1073742018'i32
KEYCODE_KP_POWER = 1073742019'i32
KEYCODE_KP_PERCENT = 1073742020'i32
KEYCODE_KP_LESS = 1073742021'i32
KEYCODE_KP_GREATER = 1073742022'i32
KEYCODE_KP_AMPERSAND = 1073742023'i32
KEYCODE_KP_DBLAMPERSAND = 1073742024'i32
KEYCODE_KP_VERTICALBAR = 1073742025'i32
KEYCODE_KP_DBLVERTICALBAR = 1073742026'i32
KEYCODE_KP_COLON = 1073742027'i32
KEYCODE_KP_HASH = 1073742028'i32
KEYCODE_KP_SPACE = 1073742029'i32
KEYCODE_KP_AT = 1073742030'i32
KEYCODE_KP_EXCLAM = 1073742031'i32
KEYCODE_KP_MEMSTORE = 1073742032'i32
KEYCODE_KP_MEMRECALL = 1073742033'i32
KEYCODE_KP_MEMCLEAR = 1073742034'i32
KEYCODE_KP_MEMADD = 1073742035'i32
KEYCODE_KP_MEMSUBTRACT = 1073742036'i32
KEYCODE_KP_MEMMULTIPLY = 1073742037'i32
KEYCODE_KP_MEMDIVIDE = 1073742038'i32
KEYCODE_KP_PLUSMINUS = 1073742039'i32
KEYCODE_KP_CLEAR = 1073742040'i32
KEYCODE_KP_CLEARENTRY = 1073742041'i32
KEYCODE_KP_BINARY = 1073742042'i32
KEYCODE_KP_OCTAL = 1073742043'i32
KEYCODE_KP_DECIMAL = 1073742044'i32
KEYCODE_KP_HEXADECIMAL = 1073742045'i32
KEYCODE_LCTRL = 1073742048'i32
KEYCODE_LSHIFT = 1073742049'i32
KEYCODE_LALT = 1073742050'i32
KEYCODE_LGUI = 1073742051'i32
KEYCODE_RCTRL = 1073742052'i32
KEYCODE_RSHIFT = 1073742053'i32
KEYCODE_RALT = 1073742054'i32
KEYCODE_RGUI = 1073742055'i32
KEYCODE_MODE = 1073742081'i32
KEYCODE_AUDIONEXT = 1073742082'i32
KEYCODE_AUDIOPREV = 1073742083'i32
KEYCODE_AUDIOSTOP = 1073742084'i32
KEYCODE_AUDIOPLAY = 1073742085'i32
KEYCODE_AUDIOMUTE = 1073742086'i32
KEYCODE_MEDIASELECT = 1073742087'i32
KEYCODE_WWW = 1073742088'i32
KEYCODE_MAIL = 1073742089'i32
KEYCODE_CALCULATOR = 1073742090'i32
KEYCODE_COMPUTER = 1073742091'i32
KEYCODE_AC_SEARCH = 1073742092'i32
KEYCODE_AC_HOME = 1073742093'i32
KEYCODE_AC_BACK = 1073742094'i32
KEYCODE_AC_FORWARD = 1073742095'i32
KEYCODE_AC_STOP = 1073742096'i32
KEYCODE_AC_REFRESH = 1073742097'i32
KEYCODE_AC_BOOKMARKS = 1073742098'i32
KEYCODE_BRIGHTNESSDOWN = 1073742099'i32
KEYCODE_BRIGHTNESSUP = 1073742100'i32
KEYCODE_DISPLAYSWITCH = 1073742101'i32
KEYCODE_KBDILLUMTOGGLE = 1073742102'i32
KEYCODE_KBDILLUMDOWN = 1073742103'i32
KEYCODE_KBDILLUMUP = 1073742104'i32
KEYCODE_EJECT = 1073742105'i32
KEYCODE_SLEEP = 1073742106'i32
KEYCODE_APP1 = 1073742107'i32
KEYCODE_APP2 = 1073742108'i32
KEYCODE_AUDIOREWIND = 1073742109'i32
KEYCODE_AUDIOFASTFORWARD = 1073742110'i32
KMOD_NONE = 0'i32
KMOD_LSHIFT = 1'i32
KMOD_RSHIFT = 2'i32
KMOD_LCTRL = 64'i32
KMOD_RCTRL = 128'i32
KMOD_LALT = 256'i32
KMOD_RALT = 512'i32
KMOD_LGUI = 1024'i32
KMOD_RGUI = 2048'i32
KMOD_NUM = 4096'i32
KMOD_CAPS = 8192'i32
KMOD_MODE = 16384'i32
KMOD_RESERVED = 32768'i32
KMOD_CTRL = 192'i32
KMOD_SHIFT = 3'i32
KMOD_ALT = 768'i32
KMOD_GUI = 3072'i32
SYSTEM_CURSOR_ARROW = 0'i32
< Arrow
SYSTEM_CURSOR_IBEAM = 1
< I-beam
SYSTEM_CURSOR_WAIT = 2
< Wait
SYSTEM_CURSOR_CROSSHAIR = 3
< Crosshair
SYSTEM_CURSOR_WAITARROW = 4
< Small wait cursor (or Wait if not available)
SYSTEM_CURSOR_SIZENWSE = 5
< Double arrow pointing northwest and southeast
SYSTEM_CURSOR_SIZENESW = 6
< Double arrow pointing northeast and southwest
SYSTEM_CURSOR_SIZEWE = 7
< Double arrow pointing west and east
SYSTEM_CURSOR_SIZENS = 8
< Double arrow pointing north and south
SYSTEM_CURSOR_SIZEALL = 9
< Four pointed arrow pointing north, south, east, and west
SYSTEM_CURSOR_NO = 10
< Slashed circle or crossbones
SYSTEM_CURSOR_HAND = 11
< Hand
NUM_SYSTEM_CURSORS = 12
MOUSEWHEEL_NORMAL = 0'i32
< The scroll direction is normal
MOUSEWHEEL_FLIPPED = 1
< The scroll direction is flipped / natural
BUTTON_LEFT = 1
BUTTON_MIDDLE = 2
BUTTON_RIGHT = 3
BUTTON_X1 = 4
BUTTON_X2 = 5
JOYSTICK_TYPE_UNKNOWN = 0'i32
JOYSTICK_TYPE_GAMECONTROLLER = 1
JOYSTICK_TYPE_WHEEL = 2
JOYSTICK_TYPE_ARCADE_STICK = 3
JOYSTICK_TYPE_FLIGHT_STICK = 4
JOYSTICK_TYPE_DANCE_PAD = 5
JOYSTICK_TYPE_GUITAR = 6
JOYSTICK_TYPE_DRUM_KIT = 7
JOYSTICK_TYPE_ARCADE_PAD = 8
JOYSTICK_TYPE_THROTTLE = 9
JOYSTICK_POWER_UNKNOWN = -1'i32
JOYSTICK_POWER_EMPTY = 0
<= 5%
JOYSTICK_POWER_LOW = 1
<= 20%
JOYSTICK_POWER_MEDIUM = 2
<= 70%
JOYSTICK_POWER_FULL = 3
<= 100%
JOYSTICK_POWER_WIRED = 4
JOYSTICK_POWER_MAX = 5
JOYSTICK_AXIS_MAX = 32767
JOYSTICK_AXIS_MIN = -32768
HAT_CENTERED = 0x00000000
HAT_UP = 0x00000001
HAT_RIGHT = 0x00000002
HAT_DOWN = 0x00000004
HAT_LEFT = 0x00000008
HAT_RIGHTUP = 3
HAT_RIGHTDOWN = 6
HAT_LEFTUP = 9
HAT_LEFTDOWN = 12
CONTROLLER_TYPE_UNKNOWN = 0'i32
CONTROLLER_TYPE_XBOX360 = 1
CONTROLLER_TYPE_XBOXONE = 2
CONTROLLER_TYPE_PS3 = 3
CONTROLLER_TYPE_PS4 = 4
CONTROLLER_TYPE_NINTENDO_SWITCH_PRO = 5
CONTROLLER_AXIS_INVALID = -1'i32
CONTROLLER_AXIS_LEFTX = 0
CONTROLLER_AXIS_LEFTY = 1
CONTROLLER_AXIS_RIGHTX = 2
CONTROLLER_AXIS_RIGHTY = 3
CONTROLLER_AXIS_TRIGGERLEFT = 4
CONTROLLER_AXIS_TRIGGERRIGHT = 5
CONTROLLER_AXIS_MAX = 6
CONTROLLER_BUTTON_INVALID = -1'i32
CONTROLLER_BUTTON_A = 0
CONTROLLER_BUTTON_B = 1
CONTROLLER_BUTTON_X = 2
CONTROLLER_BUTTON_Y = 3
CONTROLLER_BUTTON_BACK = 4
CONTROLLER_BUTTON_GUIDE = 5
CONTROLLER_BUTTON_START = 6
CONTROLLER_BUTTON_LEFTSTICK = 7
CONTROLLER_BUTTON_RIGHTSTICK = 8
CONTROLLER_BUTTON_LEFTSHOULDER = 9
CONTROLLER_BUTTON_RIGHTSHOULDER = 10
CONTROLLER_BUTTON_DPAD_UP = 11
CONTROLLER_BUTTON_DPAD_DOWN = 12
CONTROLLER_BUTTON_DPAD_LEFT = 13
CONTROLLER_BUTTON_DPAD_RIGHT = 14
CONTROLLER_BUTTON_MAX = 15
TOUCH_DEVICE_INVALID = -1'i32
TOUCH_DEVICE_DIRECT = 0
touch screen with window-relative coordinates
TOUCH_DEVICE_INDIRECT_ABSOLUTE = 1
trackpad with absolute device coordinates
TOUCH_DEVICE_INDIRECT_RELATIVE = 2
trackpad with screen cursor-relative coordinates
RELEASED = 0
PRESSED = 1
EVENT_FIRSTEVENT = 0'i32
< Unused (do not remove)
EVENT_QUIT = 256'i32
< User-requested quit
EVENT_APP_TERMINATING = 257
< The application is being terminated by the OS
                                     Called on iOS in applicationWillTerminate()
                                     Called on Android in onDestroy()
EVENT_APP_LOWMEMORY = 258
< The application is low on memory, free memory if possible.
                                     Called on iOS in applicationDidReceiveMemoryWarning()
                                     Called on Android in onLowMemory()
EVENT_APP_WILLENTERBACKGROUND = 259
< The application is about to enter the background
                                     Called on iOS in applicationWillResignActive()
                                     Called on Android in onPause()
EVENT_APP_DIDENTERBACKGROUND = 260
< The application did enter the background and may not get CPU for some time
                                     Called on iOS in applicationDidEnterBackground()
                                     Called on Android in onPause()
EVENT_APP_WILLENTERFOREGROUND = 261
< The application is about to enter the foreground
                                     Called on iOS in applicationWillEnterForeground()
                                     Called on Android in onResume()
EVENT_APP_DIDENTERFOREGROUND = 262
< The application is now interactive
                                     Called on iOS in applicationDidBecomeActive()
                                     Called on Android in onResume()
EVENT_DISPLAYEVENT = 336'i32
< Display state change
EVENT_WINDOWEVENT = 512'i32
< Window state change
EVENT_SYSWMEVENT = 513
< System specific event
EVENT_KEYDOWN = 768'i32
< Key pressed
EVENT_KEYUP = 769
< Key released
EVENT_TEXTEDITING = 770
< Keyboard text editing (composition)
EVENT_TEXTINPUT = 771
< Keyboard text input
EVENT_KEYMAPCHANGED = 772
< Keymap changed due to a system event such as an
                                     input language or keyboard layout change.
EVENT_MOUSEMOTION = 1024'i32
< Mouse moved
EVENT_MOUSEBUTTONDOWN = 1025
< Mouse button pressed
EVENT_MOUSEBUTTONUP = 1026
< Mouse button released
EVENT_MOUSEWHEEL = 1027
< Mouse wheel motion
EVENT_JOYAXISMOTION = 1536'i32
< Joystick axis motion
EVENT_JOYBALLMOTION = 1537
< Joystick trackball motion
EVENT_JOYHATMOTION = 1538
< Joystick hat position change
EVENT_JOYBUTTONDOWN = 1539
< Joystick button pressed
EVENT_JOYBUTTONUP = 1540
< Joystick button released
EVENT_JOYDEVICEADDED = 1541
< A new joystick has been inserted into the system
EVENT_JOYDEVICEREMOVED = 1542
< An opened joystick has been removed
EVENT_CONTROLLERAXISMOTION = 1616'i32
< Game controller axis motion
EVENT_CONTROLLERBUTTONDOWN = 1617
< Game controller button pressed
EVENT_CONTROLLERBUTTONUP = 1618
< Game controller button released
EVENT_CONTROLLERDEVICEADDED = 1619
< A new Game controller has been inserted into the system
EVENT_CONTROLLERDEVICEREMOVED = 1620
< An opened Game controller has been removed
EVENT_CONTROLLERDEVICEREMAPPED = 1621
< The controller mapping was updated
EVENT_FINGERDOWN = 1792'i32
EVENT_FINGERUP = 1793
EVENT_FINGERMOTION = 1794
Gesture events
EVENT_DOLLARGESTURE = 2048'i32
EVENT_DOLLARRECORD = 2049
EVENT_MULTIGESTURE = 2050
Clipboard events
EVENT_CLIPBOARDUPDATE = 2304'i32
< The clipboard changed
EVENT_DROPFILE = 4096'i32
< The system requests a file open
EVENT_DROPTEXT = 4097
< text/plain drag-and-drop event
EVENT_DROPBEGIN = 4098
< A new set of drops is beginning (NULL filename)
EVENT_DROPCOMPLETE = 4099
< Current set of drops is now complete (NULL filename)
EVENT_AUDIODEVICEADDED = 4352'i32
< A new audio device is available
EVENT_AUDIODEVICEREMOVED = 4353
< An audio device has been removed.
EVENT_SENSORUPDATE = 4608'i32
< A sensor was updated
EVENT_RENDER_TARGETS_RESET = 8192'i32
< The render targets have been reset and their contents need to be updated
EVENT_RENDER_DEVICE_RESET = 8193
< The device has been reset and all textures need to be recreated
EVENT_USEREVENT = 32768'i32
This last event is only for bounding internal arrays
EVENT_LASTEVENT = 65535'i32
TEXTEDITINGEVENT_TEXT_SIZE = 32
TEXTINPUTEVENT_TEXT_SIZE = 32
ADDEVENT = 0'i32
PEEKEVENT = 1
GETEVENT = 2
QUERY = -1
IGNORE = 0
DISABLE = 0
ENABLE = 1
HAPTIC_TYPE_CONSTANT = 1'u
HAPTIC_TYPE_SINE = 2'u
HAPTIC_TYPE_LEFTRIGHT = 4'u
HAPTIC_TYPE_TRIANGLE = 8'u
HAPTIC_TYPE_SAWTOOTHUP = 16'u
HAPTIC_TYPE_SAWTOOTHDOWN = 32'u
HAPTIC_TYPE_RAMP = 64'u
HAPTIC_TYPE_SPRING = 128'u
HAPTIC_TYPE_DAMPER = 256'u
HAPTIC_TYPE_INERTIA = 512'u
HAPTIC_TYPE_FRICTION = 1024'u
HAPTIC_TYPE_CUSTOM = 2048'u
HAPTIC_TYPE_GAIN = 4096'u
HAPTIC_TYPE_AUTOCENTER = 8192'u
HAPTIC_TYPE_STATUS = 16384'u
HAPTIC_TYPE_PAUSE = 32768'u
HAPTIC_TYPE_POLAR = 0
HAPTIC_TYPE_CARTESIAN = 1
HAPTIC_TYPE_SPHERICAL = 2
HAPTIC_TYPE_INFINITY = 4294967295'u
HINT_FRAMEBUFFER_ACCELERATION = "SDL_FRAMEBUFFER_ACCELERATION"
HINT_RENDER_DRIVER = "SDL_RENDER_DRIVER"
HINT_RENDER_OPENGL_SHADERS = "SDL_RENDER_OPENGL_SHADERS"
HINT_RENDER_DIRECT3D_THREADSAFE = "SDL_RENDER_DIRECT3D_THREADSAFE"
HINT_RENDER_DIRECT3D11_DEBUG = "SDL_RENDER_DIRECT3D11_DEBUG"
HINT_RENDER_LOGICAL_SIZE_MODE = "SDL_RENDER_LOGICAL_SIZE_MODE"
HINT_RENDER_SCALE_QUALITY = "SDL_RENDER_SCALE_QUALITY"
HINT_RENDER_VSYNC = "SDL_RENDER_VSYNC"
HINT_VIDEO_ALLOW_SCREENSAVER = "SDL_VIDEO_ALLOW_SCREENSAVER"
HINT_VIDEO_EXTERNAL_CONTEXT = "SDL_VIDEO_EXTERNAL_CONTEXT"
HINT_VIDEO_X11_XVIDMODE = "SDL_VIDEO_X11_XVIDMODE"
HINT_VIDEO_X11_XINERAMA = "SDL_VIDEO_X11_XINERAMA"
HINT_VIDEO_X11_XRANDR = "SDL_VIDEO_X11_XRANDR"
HINT_VIDEO_X11_WINDOW_VISUALID = "SDL_VIDEO_X11_WINDOW_VISUALID"
HINT_VIDEO_X11_NET_WM_PING = "SDL_VIDEO_X11_NET_WM_PING"
HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR = "SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
HINT_VIDEO_X11_FORCE_EGL = "SDL_VIDEO_X11_FORCE_EGL"
HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN = "SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
HINT_WINDOWS_INTRESOURCE_ICON = "SDL_WINDOWS_INTRESOURCE_ICON"
HINT_WINDOWS_INTRESOURCE_ICON_SMALL = "SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
HINT_WINDOWS_ENABLE_MESSAGELOOP = "SDL_WINDOWS_ENABLE_MESSAGELOOP"
HINT_GRAB_KEYBOARD = "SDL_GRAB_KEYBOARD"
HINT_MOUSE_DOUBLE_CLICK_TIME = "SDL_MOUSE_DOUBLE_CLICK_TIME"
HINT_MOUSE_DOUBLE_CLICK_RADIUS = "SDL_MOUSE_DOUBLE_CLICK_RADIUS"
HINT_MOUSE_NORMAL_SPEED_SCALE = "SDL_MOUSE_NORMAL_SPEED_SCALE"
HINT_MOUSE_RELATIVE_SPEED_SCALE = "SDL_MOUSE_RELATIVE_SPEED_SCALE"
HINT_MOUSE_RELATIVE_MODE_WARP = "SDL_MOUSE_RELATIVE_MODE_WARP"
HINT_MOUSE_FOCUS_CLICKTHROUGH = "SDL_MOUSE_FOCUS_CLICKTHROUGH"
HINT_TOUCH_MOUSE_EVENTS = "SDL_TOUCH_MOUSE_EVENTS"
HINT_MOUSE_TOUCH_EVENTS = "SDL_MOUSE_TOUCH_EVENTS"
HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS = "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
HINT_IDLE_TIMER_DISABLED = "SDL_IOS_IDLE_TIMER_DISABLED"
HINT_ORIENTATIONS = "SDL_IOS_ORIENTATIONS"
HINT_APPLE_TV_CONTROLLER_UI_EVENTS = "SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
HINT_APPLE_TV_REMOTE_ALLOW_ROTATION = "SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
HINT_IOS_HIDE_HOME_INDICATOR = "SDL_IOS_HIDE_HOME_INDICATOR"
HINT_ACCELEROMETER_AS_JOYSTICK = "SDL_ACCELEROMETER_AS_JOYSTICK"
HINT_TV_REMOTE_AS_JOYSTICK = "SDL_TV_REMOTE_AS_JOYSTICK"
HINT_XINPUT_ENABLED = "SDL_XINPUT_ENABLED"
HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING = "SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
HINT_GAMECONTROLLERTYPE = "SDL_GAMECONTROLLERTYPE"
HINT_GAMECONTROLLERCONFIG = "SDL_GAMECONTROLLERCONFIG"
HINT_GAMECONTROLLERCONFIG_FILE = "SDL_GAMECONTROLLERCONFIG_FILE"
HINT_GAMECONTROLLER_IGNORE_DEVICES = "SDL_GAMECONTROLLER_IGNORE_DEVICES"
HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT = "SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
HINT_GAMECONTROLLER_USE_BUTTON_LABELS = "SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS = "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
HINT_JOYSTICK_HIDAPI = "SDL_JOYSTICK_HIDAPI"
HINT_JOYSTICK_HIDAPI_PS4 = "SDL_JOYSTICK_HIDAPI_PS4"
HINT_JOYSTICK_HIDAPI_PS4_RUMBLE = "SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
HINT_JOYSTICK_HIDAPI_STEAM = "SDL_JOYSTICK_HIDAPI_STEAM"
HINT_JOYSTICK_HIDAPI_SWITCH = "SDL_JOYSTICK_HIDAPI_SWITCH"
HINT_JOYSTICK_HIDAPI_XBOX = "SDL_JOYSTICK_HIDAPI_XBOX"
HINT_JOYSTICK_HIDAPI_GAMECUBE = "SDL_JOYSTICK_HIDAPI_GAMECUBE"
HINT_ENABLE_STEAM_CONTROLLERS = "SDL_ENABLE_STEAM_CONTROLLERS"
HINT_ALLOW_TOPMOST = "SDL_ALLOW_TOPMOST"
HINT_TIMER_RESOLUTION = "SDL_TIMER_RESOLUTION"
HINT_QTWAYLAND_CONTENT_ORIENTATION = "SDL_QTWAYLAND_CONTENT_ORIENTATION"
HINT_QTWAYLAND_WINDOW_FLAGS = "SDL_QTWAYLAND_WINDOW_FLAGS"
HINT_THREAD_STACK_SIZE = "SDL_THREAD_STACK_SIZE"
HINT_VIDEO_HIGHDPI_DISABLED = "SDL_VIDEO_HIGHDPI_DISABLED"
HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK = "SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
HINT_VIDEO_WIN_D3DCOMPILER = "SDL_VIDEO_WIN_D3DCOMPILER"
HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT = "SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
HINT_WINRT_PRIVACY_POLICY_URL = "SDL_WINRT_PRIVACY_POLICY_URL"
HINT_WINRT_PRIVACY_POLICY_LABEL = "SDL_WINRT_PRIVACY_POLICY_LABEL"
HINT_WINRT_HANDLE_BACK_BUTTON = "SDL_WINRT_HANDLE_BACK_BUTTON"
HINT_VIDEO_MAC_FULLSCREEN_SPACES = "SDL_VIDEO_MAC_FULLSCREEN_SPACES"
HINT_MAC_BACKGROUND_APP = "SDL_MAC_BACKGROUND_APP"
HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION = "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
HINT_IME_INTERNAL_EDITING = "SDL_IME_INTERNAL_EDITING"
HINT_ANDROID_TRAP_BACK_BUTTON = "SDL_ANDROID_TRAP_BACK_BUTTON"
HINT_ANDROID_BLOCK_ON_PAUSE = "SDL_ANDROID_BLOCK_ON_PAUSE"
HINT_RETURN_KEY_HIDES_IME = "SDL_RETURN_KEY_HIDES_IME"
HINT_EMSCRIPTEN_KEYBOARD_ELEMENT = "SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
HINT_NO_SIGNAL_HANDLERS = "SDL_NO_SIGNAL_HANDLERS"
HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 = "SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
HINT_BMP_SAVE_LEGACY_FORMAT = "SDL_BMP_SAVE_LEGACY_FORMAT"
HINT_WINDOWS_DISABLE_THREAD_NAMING = "SDL_WINDOWS_DISABLE_THREAD_NAMING"
HINT_RPI_VIDEO_LAYER = "SDL_RPI_VIDEO_LAYER"
HINT_VIDEO_DOUBLE_BUFFER = "SDL_VIDEO_DOUBLE_BUFFER"
HINT_OPENGL_ES_DRIVER = "SDL_OPENGL_ES_DRIVER"
HINT_AUDIO_RESAMPLING_MODE = "SDL_AUDIO_RESAMPLING_MODE"
HINT_AUDIO_CATEGORY = "SDL_AUDIO_CATEGORY"
HINT_RENDER_BATCHING = "SDL_RENDER_BATCHING"
HINT_EVENT_LOGGING = "SDL_EVENT_LOGGING"
HINT_WAVE_RIFF_CHUNK_SIZE = "SDL_WAVE_RIFF_CHUNK_SIZE"
HINT_WAVE_TRUNCATION = "SDL_WAVE_TRUNCATION"
HINT_WAVE_FACT_CHUNK = "SDL_WAVE_FACT_CHUNK"
HINT_DISPLAY_USABLE_BOUNDS = "SDL_DISPLAY_USABLE_BOUNDS"
HINT_DEFAULT = 0'i32
HINT_NORMAL = 1
HINT_OVERRIDE = 2
MAX_LOG_MESSAGE = 4096
LOG_CATEGORY_APPLICATION = 0'i32
LOG_CATEGORY_ERROR = 1
LOG_CATEGORY_ASSERT = 2
LOG_CATEGORY_SYSTEM = 3
LOG_CATEGORY_AUDIO = 4
LOG_CATEGORY_VIDEO = 5
LOG_CATEGORY_RENDER = 6
LOG_CATEGORY_INPUT = 7
LOG_CATEGORY_TEST = 8
Reserved for future SDL library use
LOG_CATEGORY_RESERVED1 = 9
LOG_CATEGORY_RESERVED2 = 10
LOG_CATEGORY_RESERVED3 = 11
LOG_CATEGORY_RESERVED4 = 12
LOG_CATEGORY_RESERVED5 = 13
LOG_CATEGORY_RESERVED6 = 14
LOG_CATEGORY_RESERVED7 = 15
LOG_CATEGORY_RESERVED8 = 16
LOG_CATEGORY_RESERVED9 = 17
LOG_CATEGORY_RESERVED10 = 18
Beyond this point is reserved for application use, e.g.
       enum {
           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
           MYAPP_CATEGORY_AWESOME2,
           MYAPP_CATEGORY_AWESOME3,
           ...
       };
LOG_CATEGORY_CUSTOM = 19
LOG_PRIORITY_VERBOSE = 1'i32
LOG_PRIORITY_DEBUG = 2
LOG_PRIORITY_INFO = 3
LOG_PRIORITY_WARN = 4
LOG_PRIORITY_ERROR = 5
LOG_PRIORITY_CRITICAL = 6
NUM_LOG_PRIORITIES = 7
MESSAGEBOX_ERROR = 16'i32
< error dialog
MESSAGEBOX_WARNING = 32'i32
< warning dialog
MESSAGEBOX_INFORMATION = 64'i32
< informational dialog
MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 128'i32
< buttons placed left to right
MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 256'i32
< buttons placed right to left
MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 1'i32
< Marks the default button when return is hit
MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 2'i32
< Marks the default button when escape is hit
MESSAGEBOX_COLOR_BACKGROUND = 0'i32
MESSAGEBOX_COLOR_TEXT = 1
MESSAGEBOX_COLOR_BUTTON_BORDER = 2
MESSAGEBOX_COLOR_BUTTON_BACKGROUND = 3
MESSAGEBOX_COLOR_BUTTON_SELECTED = 4
MESSAGEBOX_COLOR_MAX = 5
POWERSTATE_UNKNOWN = 0'i32
< cannot determine power status
POWERSTATE_ON_BATTERY = 1
< Not plugged in, running on the battery
POWERSTATE_NO_BATTERY = 2
< Plugged in, no battery available
POWERSTATE_CHARGING = 3
< Plugged in, charging battery
POWERSTATE_CHARGED = 4
< Plugged in, battery charged
RENDERER_SOFTWARE = 1'i32
< The renderer is a software fallback
RENDERER_ACCELERATED = 2'i32
< The renderer uses hardware
                                                     acceleration
RENDERER_PRESENTVSYNC = 4'i32
< Present is synchronized
                                                     with the refresh rate
RENDERER_TARGETTEXTURE = 8'i32
< The renderer supports
                                                     rendering to texture
ScaleModeNearest = 0'i32
< nearest pixel sampling
ScaleModeLinear = 1
< linear filtering
ScaleModeBest = 2
< anisotropic filtering
TEXTUREACCESS_STATIC = 0'i32
< Changes rarely, not lockable
TEXTUREACCESS_STREAMING = 1
< Changes frequently, lockable
TEXTUREACCESS_TARGET = 2
< Texture can be used as a render target
TEXTUREMODULATE_NONE = 0'i32
< No modulation
TEXTUREMODULATE_COLOR = 1'i32
< srcC = srcC color
TEXTUREMODULATE_ALPHA = 2'i32
< srcA = srcA alpha
FLIP_NONE = 0'i32
< Do not flip
FLIP_HORIZONTAL = 1'i32
< flip horizontally
FLIP_VERTICAL = 2'i32
< flip vertically
SENSOR_INVALID = -1'i32
< Returned for an invalid sensor
SENSOR_UNKNOWN = 0
< Unknown sensor type
SENSOR_ACCEL = 1
< Accelerometer
SENSOR_GYRO = 2
< Gyroscope
STANDARD_GRAVITY = 9.806649999999999'f64
NONSHAPEABLE_WINDOW = -1
INVALID_SHAPE_ARGUMENT = -2
WINDOW_LACKS_SHAPE = -3
ShapeModeDefault = 0'i32
\brief A binarized alpha cutoff with a given integer value.
ShapeModeBinarizeAlpha = 1
\brief A binarized alpha cutoff with a given integer value, but with the opposite comparison.
ShapeModeReverseBinarizeAlpha = 2
\brief A color key is applied.
ShapeModeColorKey = 3
MAJOR_VERSION = 2
MINOR_VERSION = 0
PATCHLEVEL = 12
INIT_TIMER = 0x00000001'u
INIT_AUDIO = 0x00000010'u
INIT_VIDEO = 0x00000020'u
INIT_JOYSTICK = 0x00000200'u
INIT_HAPTIC = 0x00001000'u
INIT_GAMECONTROLLER = 0x00002000'u
INIT_EVENTS = 0x00004000'u
INIT_SENSOR = 0x00008000'u
INIT_NOPARACHUTE = 0x00100000'u
INIT_EVERYTHING = 62001'u
SDLDyLibPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2/buildcache/libSDL2-2.0.dylib"
SDLMainLib = "/Users/joey/Projects/nim-sdl2/src/build/sdl2/buildcache/libSDL2main.a"
SDLStaticLib = "/Users/joey/Projects/nim-sdl2/src/build/sdl2/buildcache/libSDL2.a"
WINDOWPOS_UNDEFINED = 536805376'u
WINDOWPOS_CENTERED = 805240832'u
SCANCODE_MASK = 1073741824
BUTTON_LMASK = 1
BUTTON_MMASK = 2
BUTTON_RMASK = 4
BUTTON_X1MASK = 8
BUTTON_X2MASK = 16

Procs

proc getPlatform(): cstring {...}{.importc: "SDL_GetPlatform", cdecl.}
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief Gets the name of the platform.
proc malloc(size: uint): pointer {...}{.importc: "SDL_malloc", cdecl.}
proc calloc(nmemb: uint; size: uint): pointer {...}{.importc: "SDL_calloc", cdecl.}
proc realloc(mem: pointer; size: uint): pointer {...}{.importc: "SDL_realloc", cdecl.}
proc free(mem: pointer) {...}{.importc: "SDL_free", cdecl.}
proc getMemoryFunctions(mallocFunc: ptr malloc_func; callocFunc: ptr calloc_func;
                       reallocFunc: ptr realloc_func; freeFunc: ptr free_func) {...}{.
    importc: "SDL_GetMemoryFunctions", cdecl.}
\brief Get the current set of SDL memory functions
proc setMemoryFunctions(mallocFunc: malloc_func; callocFunc: calloc_func;
                       reallocFunc: realloc_func; freeFunc: free_func): cint {...}{.
    importc: "SDL_SetMemoryFunctions", cdecl.}
\brief Replace SDL's memory allocation functions with a custom set
  
  \note If you are replacing SDL's memory functions, you should call
        SDL_GetNumAllocations() and be very careful if it returns non-zero.
        That means that your free function will be called with memory
        allocated by the previous memory allocation functions.
proc getNumAllocations(): cint {...}{.importc: "SDL_GetNumAllocations", cdecl.}
\brief Get the number of outstanding (unfreed) allocations
proc getenv(name: cstring): cstring {...}{.importc: "SDL_getenv", cdecl.}
proc setenv(name: cstring; value: cstring; overwrite: cint): cint {...}{.
    importc: "SDL_setenv", cdecl.}
proc qsort(base: pointer; nmemb: uint; size: uint;
          compare: proc (a1: pointer; a2: pointer): cint {...}{.cdecl.}) {...}{.
    importc: "SDL_qsort", cdecl.}
proc abs(x: cint): cint {...}{.importc: "SDL_abs", cdecl.}
proc isdigit(x: cint): cint {...}{.importc: "SDL_isdigit", cdecl.}
proc isspace(x: cint): cint {...}{.importc: "SDL_isspace", cdecl.}
proc isupper(x: cint): cint {...}{.importc: "SDL_isupper", cdecl.}
proc islower(x: cint): cint {...}{.importc: "SDL_islower", cdecl.}
proc toupper(x: cint): cint {...}{.importc: "SDL_toupper", cdecl.}
proc tolower(x: cint): cint {...}{.importc: "SDL_tolower", cdecl.}
proc memset(dst: pointer; c: cint; len: uint): pointer {...}{.importc: "SDL_memset", cdecl.}
proc memcpy(dst: pointer; src: pointer; len: uint): pointer {...}{.importc: "SDL_memcpy", cdecl.}
proc memmove(dst: pointer; src: pointer; len: uint): pointer {...}{.importc: "SDL_memmove",
    cdecl.}
proc memcmp(s1: pointer; s2: pointer; len: uint): cint {...}{.importc: "SDL_memcmp", cdecl.}
proc wcslen(wstr: ptr wchar_t): uint {...}{.importc: "SDL_wcslen", cdecl.}
proc wcslcpy(dst: ptr wchar_t; src: ptr wchar_t; maxlen: uint): uint {...}{.
    importc: "SDL_wcslcpy", cdecl.}
proc wcslcat(dst: ptr wchar_t; src: ptr wchar_t; maxlen: uint): uint {...}{.
    importc: "SDL_wcslcat", cdecl.}
proc wcsdup(wstr: ptr wchar_t): ptr wchar_t {...}{.importc: "SDL_wcsdup", cdecl.}
proc wcsstr(haystack: ptr wchar_t; needle: ptr wchar_t): ptr wchar_t {...}{.
    importc: "SDL_wcsstr", cdecl.}
proc wcscmp(str1: ptr wchar_t; str2: ptr wchar_t): cint {...}{.importc: "SDL_wcscmp", cdecl.}
proc wcsncmp(str1: ptr wchar_t; str2: ptr wchar_t; maxlen: uint): cint {...}{.
    importc: "SDL_wcsncmp", cdecl.}
proc strlen(str: cstring): uint {...}{.importc: "SDL_strlen", cdecl.}
proc strlcpy(dst: cstring; src: cstring; maxlen: uint): uint {...}{.importc: "SDL_strlcpy",
    cdecl.}
proc utf8strlcpy(dst: cstring; src: cstring; dstBytes: uint): uint {...}{.
    importc: "SDL_utf8strlcpy", cdecl.}
proc strlcat(dst: cstring; src: cstring; maxlen: uint): uint {...}{.importc: "SDL_strlcat",
    cdecl.}
proc strdup(str: cstring): cstring {...}{.importc: "SDL_strdup", cdecl.}
proc strrev(str: cstring): cstring {...}{.importc: "SDL_strrev", cdecl.}
proc strupr(str: cstring): cstring {...}{.importc: "SDL_strupr", cdecl.}
proc strlwr(str: cstring): cstring {...}{.importc: "SDL_strlwr", cdecl.}
proc strchr(str: cstring; c: cint): cstring {...}{.importc: "SDL_strchr", cdecl.}
proc strrchr(str: cstring; c: cint): cstring {...}{.importc: "SDL_strrchr", cdecl.}
proc strstr(haystack: cstring; needle: cstring): cstring {...}{.importc: "SDL_strstr", cdecl.}
proc strtokr(s1: cstring; s2: cstring; saveptr: ptr cstring): cstring {...}{.
    importc: "SDL_strtokr", cdecl.}
proc utf8strlen(str: cstring): uint {...}{.importc: "SDL_utf8strlen", cdecl.}
proc itoa(value: cint; str: cstring; radix: cint): cstring {...}{.importc: "SDL_itoa", cdecl.}
proc uitoa(value: cuint; str: cstring; radix: cint): cstring {...}{.importc: "SDL_uitoa", cdecl.}
proc ltoa(value: clong; str: cstring; radix: cint): cstring {...}{.importc: "SDL_ltoa", cdecl.}
proc ultoa(value: culong; str: cstring; radix: cint): cstring {...}{.importc: "SDL_ultoa",
    cdecl.}
proc lltoa(value: Sint64; str: cstring; radix: cint): cstring {...}{.importc: "SDL_lltoa",
    cdecl.}
proc ulltoa(value: Uint64; str: cstring; radix: cint): cstring {...}{.importc: "SDL_ulltoa",
    cdecl.}
proc atoi(str: cstring): cint {...}{.importc: "SDL_atoi", cdecl.}
proc atof(str: cstring): cdouble {...}{.importc: "SDL_atof", cdecl.}
proc strtol(str: cstring; endp: ptr cstring; base: cint): clong {...}{.importc: "SDL_strtol",
    cdecl.}
proc strtoul(str: cstring; endp: ptr cstring; base: cint): culong {...}{.
    importc: "SDL_strtoul", cdecl.}
proc strtoll(str: cstring; endp: ptr cstring; base: cint): Sint64 {...}{.
    importc: "SDL_strtoll", cdecl.}
proc strtoull(str: cstring; endp: ptr cstring; base: cint): Uint64 {...}{.
    importc: "SDL_strtoull", cdecl.}
proc strtod(str: cstring; endp: ptr cstring): cdouble {...}{.importc: "SDL_strtod", cdecl.}
proc strcmp(str1: cstring; str2: cstring): cint {...}{.importc: "SDL_strcmp", cdecl.}
proc strncmp(str1: cstring; str2: cstring; maxlen: uint): cint {...}{.importc: "SDL_strncmp",
    cdecl.}
proc strcasecmp(str1: cstring; str2: cstring): cint {...}{.importc: "SDL_strcasecmp", cdecl.}
proc strncasecmp(str1: cstring; str2: cstring; len: uint): cint {...}{.
    importc: "SDL_strncasecmp", cdecl.}
proc sscanf(text: cstring; fmt: cstring): cint {...}{.importc: "SDL_sscanf", cdecl, varargs.}
proc vsscanf(text: cstring; fmt: cstring; ap: va_list): cint {...}{.importc: "SDL_vsscanf",
    cdecl.}
proc snprintf(text: cstring; maxlen: uint; fmt: cstring): cint {...}{.
    importc: "SDL_snprintf", cdecl, varargs.}
proc vsnprintf(text: cstring; maxlen: uint; fmt: cstring; ap: va_list): cint {...}{.
    importc: "SDL_vsnprintf", cdecl.}
proc acos(x: cdouble): cdouble {...}{.importc: "SDL_acos", cdecl.}
proc acosf(x: cfloat): cfloat {...}{.importc: "SDL_acosf", cdecl.}
proc asin(x: cdouble): cdouble {...}{.importc: "SDL_asin", cdecl.}
proc asinf(x: cfloat): cfloat {...}{.importc: "SDL_asinf", cdecl.}
proc atan(x: cdouble): cdouble {...}{.importc: "SDL_atan", cdecl.}
proc atanf(x: cfloat): cfloat {...}{.importc: "SDL_atanf", cdecl.}
proc atan2(x: cdouble; y: cdouble): cdouble {...}{.importc: "SDL_atan2", cdecl.}
proc atan2f(x: cfloat; y: cfloat): cfloat {...}{.importc: "SDL_atan2f", cdecl.}
proc ceil(x: cdouble): cdouble {...}{.importc: "SDL_ceil", cdecl.}
proc ceilf(x: cfloat): cfloat {...}{.importc: "SDL_ceilf", cdecl.}
proc copysign(x: cdouble; y: cdouble): cdouble {...}{.importc: "SDL_copysign", cdecl.}
proc copysignf(x: cfloat; y: cfloat): cfloat {...}{.importc: "SDL_copysignf", cdecl.}
proc cos(x: cdouble): cdouble {...}{.importc: "SDL_cos", cdecl.}
proc cosf(x: cfloat): cfloat {...}{.importc: "SDL_cosf", cdecl.}
proc exp(x: cdouble): cdouble {...}{.importc: "SDL_exp", cdecl.}
proc expf(x: cfloat): cfloat {...}{.importc: "SDL_expf", cdecl.}
proc fabs(x: cdouble): cdouble {...}{.importc: "SDL_fabs", cdecl.}
proc fabsf(x: cfloat): cfloat {...}{.importc: "SDL_fabsf", cdecl.}
proc floor(x: cdouble): cdouble {...}{.importc: "SDL_floor", cdecl.}
proc floorf(x: cfloat): cfloat {...}{.importc: "SDL_floorf", cdecl.}
proc fmod(x: cdouble; y: cdouble): cdouble {...}{.importc: "SDL_fmod", cdecl.}
proc fmodf(x: cfloat; y: cfloat): cfloat {...}{.importc: "SDL_fmodf", cdecl.}
proc log(x: cdouble): cdouble {...}{.importc: "SDL_log", cdecl.}
proc logf(x: cfloat): cfloat {...}{.importc: "SDL_logf", cdecl.}
proc log10(x: cdouble): cdouble {...}{.importc: "SDL_log10", cdecl.}
proc log10f(x: cfloat): cfloat {...}{.importc: "SDL_log10f", cdecl.}
proc pow(x: cdouble; y: cdouble): cdouble {...}{.importc: "SDL_pow", cdecl.}
proc powf(x: cfloat; y: cfloat): cfloat {...}{.importc: "SDL_powf", cdecl.}
proc scalbn(x: cdouble; n: cint): cdouble {...}{.importc: "SDL_scalbn", cdecl.}
proc scalbnf(x: cfloat; n: cint): cfloat {...}{.importc: "SDL_scalbnf", cdecl.}
proc sin(x: cdouble): cdouble {...}{.importc: "SDL_sin", cdecl.}
proc sinf(x: cfloat): cfloat {...}{.importc: "SDL_sinf", cdecl.}
proc sqrt(x: cdouble): cdouble {...}{.importc: "SDL_sqrt", cdecl.}
proc sqrtf(x: cfloat): cfloat {...}{.importc: "SDL_sqrtf", cdecl.}
proc tan(x: cdouble): cdouble {...}{.importc: "SDL_tan", cdecl.}
proc tanf(x: cfloat): cfloat {...}{.importc: "SDL_tanf", cdecl.}
proc iconv_open(tocode: cstring; fromcode: cstring): iconv_t {...}{.
    importc: "SDL_iconv_open", cdecl.}
proc iconv_close(cd: iconv_t): cint {...}{.importc: "SDL_iconv_close", cdecl.}
proc iconv(cd: iconv_t; inbuf: ptr cstring; inbytesleft: ptr uint; outbuf: ptr cstring;
          outbytesleft: ptr uint): uint {...}{.importc: "SDL_iconv", cdecl.}
proc iconv_string(tocode: cstring; fromcode: cstring; inbuf: cstring; inbytesleft: uint): cstring {...}{.
    importc: "SDL_iconv_string", cdecl.}
This function converts a string between encodings in one pass, returning a
  string that must be freed with SDL_free() or NULL on error.
proc main(argc: cint; argv: UncheckedArray[cstring]): cint {...}{.importc: "SDL_main", cdecl.}
proc setMainReady() {...}{.importc: "SDL_SetMainReady", cdecl.}
This is called by the real SDL main function to let the rest of the
  library know that initialization was done properly.
  
  Calling this yourself without knowing what you're doing can cause
  crashes and hard to diagnose problems with your application.
proc reportAssertion(a1: ptr AssertData; a2: cstring; a3: cstring; a4: cint): AssertState {...}{.
    importc: "SDL_ReportAssertion", cdecl.}
Never call this directly. Use the SDL_assert macros.
proc setAssertionHandler(handler: AssertionHandler; userdata: pointer) {...}{.
    importc: "SDL_SetAssertionHandler", cdecl.}
\brief Set an application-defined assertion handler.
  
  This allows an app to show its own assertion UI and/or force the
  response to an assertion failure. If the app doesn't provide this, SDL
  will try to do the right thing, popping up a system-specific GUI dialog,
  and probably minimizing any fullscreen windows.
  
  This callback may fire from any thread, but it runs wrapped in a mutex, so
  it will only fire from one thread at a time.
  
  Setting the callback to NULL restores SDL's original internal handler.
  
  This callback is NOT reset to SDL's internal handler upon SDL_Quit()!
  
  Return SDL_AssertState value of how to handle the assertion failure.
  
  \param handler Callback function, called when an assertion fails.
  \param userdata A pointer passed to the callback as-is.
proc getDefaultAssertionHandler(): AssertionHandler {...}{.
    importc: "SDL_GetDefaultAssertionHandler", cdecl.}
\brief Get the default assertion handler.
  
  This returns the function pointer that is called by default when an
   assertion is triggered. This is an internal function provided by SDL,
   that is used for assertions when SDL_SetAssertionHandler() hasn't been
   used to provide a different function.
  
  \return The default SDL_AssertionHandler that is called when an assert triggers.
proc getAssertionHandler(puserdata: ptr pointer): AssertionHandler {...}{.
    importc: "SDL_GetAssertionHandler", cdecl.}
\brief Get the current assertion handler.
  
  This returns the function pointer that is called when an assertion is
   triggered. This is either the value last passed to
   SDL_SetAssertionHandler(), or if no application-specified function is
   set, is equivalent to calling SDL_GetDefaultAssertionHandler().
   
   \param puserdata Pointer to a void, which will store the "userdata"
                    pointer that was passed to SDL_SetAssertionHandler().
                    This value will always be NULL for the default handler.
                    If you don't care about this data, it is safe to pass
                    a NULL pointer to this function to ignore it.
  \return The SDL_AssertionHandler that is called when an assert triggers.
proc getAssertionReport(): ptr AssertData {...}{.importc: "SDL_GetAssertionReport", cdecl.}
\brief Get a list of all assertion failures.
  
  Get all assertions triggered since last call to SDL_ResetAssertionReport(),
  or the start of the program.
  
  The proper way to examine this data looks something like this:
  
  <code>
  const SDL_AssertDataitem = SDL_GetAssertionReport();
  while (item) {
      printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\\n",
             item->condition, item->function, item->filename,
             item->linenum, item->trigger_count,
             item->always_ignore ? "yes" : "no");
      item = item->next;
  }
  </code>
  
  \return List of all assertions.
  \sa SDL_ResetAssertionReport
proc resetAssertionReport() {...}{.importc: "SDL_ResetAssertionReport", cdecl.}
\brief Reset the list of all assertion failures.
  
  Reset list of all assertions triggered.
  
  \sa SDL_GetAssertionReport
proc atomicTryLock(lock: ptr SpinLock): bool {...}{.importc: "SDL_AtomicTryLock", cdecl.}
\brief Try to lock a spin lock by setting it to a non-zero value.
 
 \param lock Points to the lock.
 
 \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
proc atomicLock(lock: ptr SpinLock) {...}{.importc: "SDL_AtomicLock", cdecl.}
\brief Lock a spin lock by setting it to a non-zero value.
 
 \param lock Points to the lock.
proc atomicUnlock(lock: ptr SpinLock) {...}{.importc: "SDL_AtomicUnlock", cdecl.}
\brief Unlock a spin lock by setting it to 0. Always returns immediately
 
 \param lock Points to the lock.
proc memoryBarrierReleaseFunction() {...}{.importc: "SDL_MemoryBarrierReleaseFunction",
                                    cdecl.}
Memory barriers are designed to prevent reads and writes from being
 reordered by the compiler and being seen out of order on multi-core CPUs.
 
 A typical pattern would be for thread A to write some data and a flag,
 and for thread B to read the flag and get the data. In this case you
 would insert a release barrier between writing the data and the flag,
 guaranteeing that the data write completes no later than the flag is
 written, and you would insert an acquire barrier between reading the
 flag and reading the data, to ensure that all the reads associated
 with the flag have completed.
 
 In this pattern you should always see a release barrier paired with
 an acquire barrier and you should gate the data reads/writes with a
 single flag variable.
 
 For more information on these semantics, take a look at the blog post:
 http:preshing.com/20120913/acquire-and-release-semantics
proc memoryBarrierAcquireFunction() {...}{.importc: "SDL_MemoryBarrierAcquireFunction",
                                    cdecl.}
proc atomicCAS(a: ptr atomic_t; oldval: cint; newval: cint): bool {...}{.
    importc: "SDL_AtomicCAS", cdecl.}
\brief Set an atomic variable to a new value if it is currently an old value.
 
 \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
 
 \note If you don't know what this function is for, you shouldn't use it!
proc atomicSet(a: ptr atomic_t; v: cint): cint {...}{.importc: "SDL_AtomicSet", cdecl.}
\brief Set an atomic variable to a value.
 
 \return The previous value of the atomic variable.
proc atomicGet(a: ptr atomic_t): cint {...}{.importc: "SDL_AtomicGet", cdecl.}
\brief Get the value of an atomic variable
proc atomicAdd(a: ptr atomic_t; v: cint): cint {...}{.importc: "SDL_AtomicAdd", cdecl.}
\brief Add to an atomic variable.
 
 \return The previous value of the atomic variable.
 
 \note This same style can be used for any number operation
proc atomicCASPtr(a: ptr pointer; oldval: pointer; newval: pointer): bool {...}{.
    importc: "SDL_AtomicCASPtr", cdecl.}
\brief Set a pointer to a new value if it is currently an old value.
 
 \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
 
 \note If you don't know what this function is for, you shouldn't use it!
proc atomicSetPtr(a: ptr pointer; v: pointer): pointer {...}{.importc: "SDL_AtomicSetPtr",
    cdecl.}
\brief Set a pointer to a value atomically.
 
 \return The previous value of the pointer.
proc atomicGetPtr(a: ptr pointer): pointer {...}{.importc: "SDL_AtomicGetPtr", cdecl.}
\brief Get the value of a pointer atomically.
proc setError(fmt: cstring): cint {...}{.importc: "SDL_SetError", cdecl, varargs.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
Public functions
SDL_SetError() unconditionally returns -1.
proc getError(): cstring {...}{.importc: "SDL_GetError", cdecl.}
proc clearError() {...}{.importc: "SDL_ClearError", cdecl.}
proc error(code: errorcode): cint {...}{.importc: "SDL_Error", cdecl.}
SDL_Error() unconditionally returns -1.
proc createMutex(): ptr mutex {...}{.importc: "SDL_CreateMutex", cdecl.}
Create a mutex, initialized unlocked.
proc lockMutex(mutex: ptr mutex): cint {...}{.importc: "SDL_LockMutex", cdecl.}
proc tryLockMutex(mutex: ptr mutex): cint {...}{.importc: "SDL_TryLockMutex", cdecl.}
Try to lock the mutex
  
  \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error
proc unlockMutex(mutex: ptr mutex): cint {...}{.importc: "SDL_UnlockMutex", cdecl.}
proc destroyMutex(mutex: ptr mutex) {...}{.importc: "SDL_DestroyMutex", cdecl.}
Destroy a mutex.
proc createSemaphore(initialValue: Uint32): ptr sem {...}{.importc: "SDL_CreateSemaphore",
    cdecl.}
Create a semaphore, initialized with value, returns NULL on failure.
proc destroySemaphore(sem: ptr sem) {...}{.importc: "SDL_DestroySemaphore", cdecl.}
Destroy a semaphore.
proc semWait(sem: ptr sem): cint {...}{.importc: "SDL_SemWait", cdecl.}
This function suspends the calling thread until the semaphore pointed
  to by \c sem has a positive count. It then atomically decreases the
  semaphore count.
proc semTryWait(sem: ptr sem): cint {...}{.importc: "SDL_SemTryWait", cdecl.}
Non-blocking variant of SDL_SemWait().
  
  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would
          block, and -1 on error.
proc semWaitTimeout(sem: ptr sem; ms: Uint32): cint {...}{.importc: "SDL_SemWaitTimeout",
    cdecl.}
Variant of SDL_SemWait() with a timeout in milliseconds.
  
  \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not
          succeed in the allotted time, and -1 on error.
  
  \warning On some platforms this function is implemented by looping with a
           delay of 1 ms, and so should be avoided if possible.
proc semPost(sem: ptr sem): cint {...}{.importc: "SDL_SemPost", cdecl.}
Atomically increases the semaphore's count (not blocking).
  
  \return 0, or -1 on error.
proc semValue(sem: ptr sem): Uint32 {...}{.importc: "SDL_SemValue", cdecl.}
Returns the current count of the semaphore.
proc createCond(): ptr cond {...}{.importc: "SDL_CreateCond", cdecl.}
Create a condition variable.
  
  Typical use of condition variables:
  
  Thread A:
    SDL_LockMutex(lock);
    while ( ! condition ) {
        SDL_CondWait(cond, lock);
    }
    SDL_UnlockMutex(lock);
  
  Thread B:
    SDL_LockMutex(lock);
    ...
    condition = true;
    ...
    SDL_CondSignal(cond);
    SDL_UnlockMutex(lock);
  
  There is some discussion whether to signal the condition variable
  with the mutex locked or not.  There is some potential performance
  benefit to unlocking first on some platforms, but there are some
  potential race conditions depending on how your code is structured.
  
  In general it's safer to signal the condition variable while the
  mutex is locked.
proc destroyCond(cond: ptr cond) {...}{.importc: "SDL_DestroyCond", cdecl.}
Destroy a condition variable.
proc condSignal(cond: ptr cond): cint {...}{.importc: "SDL_CondSignal", cdecl.}
Restart one of the threads that are waiting on the condition variable.
  
  \return 0 or -1 on error.
proc condBroadcast(cond: ptr cond): cint {...}{.importc: "SDL_CondBroadcast", cdecl.}
Restart all threads that are waiting on the condition variable.
  
  \return 0 or -1 on error.
proc condWait(cond: ptr cond; mutex: ptr mutex): cint {...}{.importc: "SDL_CondWait", cdecl.}
Wait on the condition variable, unlocking the provided mutex.
  
  \warning The mutex must be locked before entering this function!
  
  The mutex is re-locked once the condition variable is signaled.
  
  \return 0 when it is signaled, or -1 on error.
proc condWaitTimeout(cond: ptr cond; mutex: ptr mutex; ms: Uint32): cint {...}{.
    importc: "SDL_CondWaitTimeout", cdecl.}
Waits for at most \c ms milliseconds, and returns 0 if the condition
  variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not
  signaled in the allotted time, and -1 on error.
  
  \warning On some platforms this function is implemented by looping with a
           delay of 1 ms, and so should be avoided if possible.
proc createThread(fn: ThreadFunction; name: cstring; data: pointer): ptr Thread {...}{.
    importc: "SDL_CreateThread", cdecl.}
Create a thread with a default stack size.
  
  This is equivalent to calling:
  SDL_CreateThreadWithStackSize(fn, name, 0, data);
proc createThreadWithStackSize(fn: ThreadFunction; name: cstring; stacksize: uint;
                              data: pointer): ptr Thread {...}{.
    importc: "SDL_CreateThreadWithStackSize", cdecl.}
Create a thread.
   
   Thread naming is a little complicated: Most systems have very small
    limits for the string length (Haiku has 32 bytes, Linux currently has 16,
    Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll
    have to see what happens with your system's debugger. The name should be
    UTF-8 (but using the naming limits of C identifiers is a better bet).
   There are no requirements for thread naming conventions, so long as the
    string is null-terminated UTF-8, but these guidelines are helpful in
    choosing a name:
    
    http:stackoverflow.com/questions/149932/naming-conventions-for-threads
   
   If a system imposes requirements, SDL will try to munge the string for
    it (truncate, etc), but the original string contents will be available
    from SDL_GetThreadName().
   
   The size (in bytes) of the new stack can be specified. Zero means "use
    the system default" which might be wildly different between platforms
    (x86 Linux generally defaults to eight megabytes, an embedded device
    might be a few kilobytes instead).
   
   In SDL 2.1, stacksize will be folded into the original SDL_CreateThread
    function.
proc getThreadName(thread: ptr Thread): cstring {...}{.importc: "SDL_GetThreadName", cdecl.}
Get the thread name, as it was specified in SDL_CreateThread().
  This function returns a pointer to a UTF-8 string that names the
  specified thread, or NULL if it doesn't have a name. This is internal
  memory, not to be free()'d by the caller, and remains valid until the
  specified thread is cleaned up by SDL_WaitThread().
proc getThreadID(thread: ptr Thread): threadID {...}{.importc: "SDL_GetThreadID", cdecl.}
Get the thread identifier for the specified thread.
  
  Equivalent to SDL_ThreadID() if the specified thread is NULL.
proc setThreadPriority(priority: ThreadPriority): cint {...}{.
    importc: "SDL_SetThreadPriority", cdecl.}
Set the priority for the current thread
proc waitThread(thread: ptr Thread; status: ptr cint) {...}{.importc: "SDL_WaitThread", cdecl.}
Wait for a thread to finish. Threads that haven't been detached will
  remain (as a "zombie") until this function cleans them up. Not doing so
  is a resource leak.
  
  Once a thread has been cleaned up through this function, the SDL_Thread
  that references it becomes invalid and should not be referenced again.
  As such, only one thread may call SDL_WaitThread() on another.
  
  The return code for the thread function is placed in the area
  pointed to by \c status, if \c status is not NULL.
  
  You may not wait on a thread that has been used in a call to
  SDL_DetachThread(). Use either that function or this one, but not
  both, or behavior is undefined.
  
  It is safe to pass NULL to this function; it is a no-op.
proc detachThread(thread: ptr Thread) {...}{.importc: "SDL_DetachThread", cdecl.}
A thread may be "detached" to signify that it should not remain until
  another thread has called SDL_WaitThread() on it. Detaching a thread
  is useful for long-running threads that nothing needs to synchronize
  with or further manage. When a detached thread is done, it simply
  goes away.
  
  There is no way to recover the return code of a detached thread. If you
  need this, don't detach the thread and instead use SDL_WaitThread().
  
  Once a thread is detached, you should usually assume the SDL_Thread isn't
  safe to reference again, as it will become invalid immediately upon
  the detached thread's exit, instead of remaining until someone has called
  SDL_WaitThread() to finally clean it up. As such, don't detach the same
  thread more than once.
  
  If a thread has already exited when passed to SDL_DetachThread(), it will
  stop waiting for a call to SDL_WaitThread() and clean up immediately.
  It is not safe to detach a thread that might be used with SDL_WaitThread().
  
  You may not call SDL_WaitThread() on a thread that has been detached.
  Use either that function or this one, but not both, or behavior is
  undefined.
  
  It is safe to pass NULL to this function; it is a no-op.
proc tLSCreate(): TLSID {...}{.importc: "SDL_TLSCreate", cdecl.}
\brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific.
  
  \return The newly created thread local storage identifier, or 0 on error
  
  \code
  static SDL_SpinLock tls_lock;
  static SDL_TLSID thread_local_storage;
  
  void SetMyThreadData(voidvalue)
  {
      if (!thread_local_storage) {
          SDL_AtomicLock(&tls_lock);
          if (!thread_local_storage) {
              thread_local_storage = SDL_TLSCreate();
          }
          SDL_AtomicUnlock(&tls_lock);
      }
      SDL_TLSSet(thread_local_storage, value, 0);
  }
  
  voidGetMyThreadData(void)
  {
      return SDL_TLSGet(thread_local_storage);
  }
  \endcode
  
  \sa SDL_TLSGet()
  \sa SDL_TLSSet()
proc tLSGet(id: TLSID): pointer {...}{.importc: "SDL_TLSGet", cdecl.}
\brief Get the value associated with a thread local storage ID for the current thread.
  
  \param id The thread local storage ID
  
  \return The value associated with the ID for the current thread, or NULL if no value has been set.
  
  \sa SDL_TLSCreate()
  \sa SDL_TLSSet()
proc tLSSet(id: TLSID; value: pointer; destructor: proc (a1: pointer) {...}{.cdecl.}): cint {...}{.
    importc: "SDL_TLSSet", cdecl.}
\brief Set the value associated with a thread local storage ID for the current thread.
  
  \param id The thread local storage ID
  \param value The value to associate with the ID for the current thread
  \param destructor A function called when the thread exits, to free the value.
  
  \return 0 on success, -1 on error
  
  \sa SDL_TLSCreate()
  \sa SDL_TLSGet()
proc rWFromFile(file: cstring; mode: cstring): ptr RWops {...}{.importc: "SDL_RWFromFile",
    cdecl.}
\name RWFrom functions
  
  Functions to create SDL_RWops structures from various data streams.
@{
proc rWFromFP(fp: File; autoclose: bool): ptr RWops {...}{.importc: "SDL_RWFromFP", cdecl.}
proc rWFromMem(mem: pointer; size: cint): ptr RWops {...}{.importc: "SDL_RWFromMem", cdecl.}
proc rWFromConstMem(mem: pointer; size: cint): ptr RWops {...}{.
    importc: "SDL_RWFromConstMem", cdecl.}
proc allocRW(): ptr RWops {...}{.importc: "SDL_AllocRW", cdecl.}
@}
RWFrom functions
proc freeRW(area: ptr RWops) {...}{.importc: "SDL_FreeRW", cdecl.}
proc rWsize(context: ptr RWops): Sint64 {...}{.importc: "SDL_RWsize", cdecl.}
Return the size of the file in this rwops, or -1 if unknown
proc rWseek(context: ptr RWops; offset: Sint64; whence: cint): Sint64 {...}{.
    importc: "SDL_RWseek", cdecl.}
Seek to \c offset relative to \c whence, one of stdio's whence values:
  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
  
  \return the final offset in the data stream, or -1 on error.
proc rWtell(context: ptr RWops): Sint64 {...}{.importc: "SDL_RWtell", cdecl.}
Return the current offset in the data stream, or -1 on error.
proc rWread(context: ptr RWops; `ptr`: pointer; size: uint; maxnum: uint): uint {...}{.
    importc: "SDL_RWread", cdecl.}
Read up to \c maxnum objects each of size \c size from the data
  stream to the area pointed at by \c ptr.
  
  \return the number of objects read, or 0 at error or end of file.
proc rWwrite(context: ptr RWops; `ptr`: pointer; size: uint; num: uint): uint {...}{.
    importc: "SDL_RWwrite", cdecl.}
Write exactly \c num objects each of size \c size from the area
  pointed at by \c ptr to data stream.
  
  \return the number of objects written, or 0 at error or end of file.
proc rWclose(context: ptr RWops): cint {...}{.importc: "SDL_RWclose", cdecl.}
Close and free an allocated SDL_RWops structure.
  
  \return 0 if successful or -1 on write error when flushing data.
proc loadFile_RW(src: ptr RWops; datasize: ptr uint; freesrc: cint): pointer {...}{.
    importc: "SDL_LoadFile_RW", cdecl.}
Load all the data from an SDL data stream.
  
  The data is allocated with a zero byte at the end (null terminated)
  
  If \c datasize is not NULL, it is filled with the size of the data read.
  
  If \c freesrc is non-zero, the stream will be closed after being read.
  
  The data should be freed with SDL_free().
  
  \return the data, or NULL if there was an error.
proc loadFile(file: cstring; datasize: ptr uint): pointer {...}{.importc: "SDL_LoadFile",
    cdecl.}
Load an entire file.
  
  The data is allocated with a zero byte at the end (null terminated)
  
  If \c datasize is not NULL, it is filled with the size of the data read.
  
  If \c freesrc is non-zero, the stream will be closed after being read.
  
  The data should be freed with SDL_free().
  
  \return the data, or NULL if there was an error.
proc readU8(src: ptr RWops): Uint8 {...}{.importc: "SDL_ReadU8", cdecl.}
\name Read endian functions
  
  Read an item of the specified endianness and return in native format.
@{
proc readLE16(src: ptr RWops): Uint16 {...}{.importc: "SDL_ReadLE16", cdecl.}
proc readBE16(src: ptr RWops): Uint16 {...}{.importc: "SDL_ReadBE16", cdecl.}
proc readLE32(src: ptr RWops): Uint32 {...}{.importc: "SDL_ReadLE32", cdecl.}
proc readBE32(src: ptr RWops): Uint32 {...}{.importc: "SDL_ReadBE32", cdecl.}
proc readLE64(src: ptr RWops): Uint64 {...}{.importc: "SDL_ReadLE64", cdecl.}
proc readBE64(src: ptr RWops): Uint64 {...}{.importc: "SDL_ReadBE64", cdecl.}
proc writeU8(dst: ptr RWops; value: Uint8): uint {...}{.importc: "SDL_WriteU8", cdecl.}
@}
Read endian functions
\name Write endian functions
  
  Write an item of native format to the specified endianness.
@{
proc writeLE16(dst: ptr RWops; value: Uint16): uint {...}{.importc: "SDL_WriteLE16", cdecl.}
proc writeBE16(dst: ptr RWops; value: Uint16): uint {...}{.importc: "SDL_WriteBE16", cdecl.}
proc writeLE32(dst: ptr RWops; value: Uint32): uint {...}{.importc: "SDL_WriteLE32", cdecl.}
proc writeBE32(dst: ptr RWops; value: Uint32): uint {...}{.importc: "SDL_WriteBE32", cdecl.}
proc writeLE64(dst: ptr RWops; value: Uint64): uint {...}{.importc: "SDL_WriteLE64", cdecl.}
proc writeBE64(dst: ptr RWops; value: Uint64): uint {...}{.importc: "SDL_WriteBE64", cdecl.}
proc getNumAudioDrivers(): cint {...}{.importc: "SDL_GetNumAudioDrivers", cdecl.}
Function prototypes
\name Driver discovery functions
  
  These functions return the list of built in audio drivers, in the
  order that they are normally initialized by default.
@{
proc getAudioDriver(index: cint): cstring {...}{.importc: "SDL_GetAudioDriver", cdecl.}
proc audioInit(driverName: cstring): cint {...}{.importc: "SDL_AudioInit", cdecl.}
@}
\name Initialization and cleanup
  
  \internal These functions are used internally, and should not be used unless
            you have a specific need to specify the audio driver you want to
            use.  You should normally use SDL_Init() or SDL_InitSubSystem().
@{
proc audioQuit() {...}{.importc: "SDL_AudioQuit", cdecl.}
proc getCurrentAudioDriver(): cstring {...}{.importc: "SDL_GetCurrentAudioDriver", cdecl.}
@}
This function returns the name of the current audio driver, or NULL
  if no driver has been initialized.
proc openAudio(desired: ptr AudioSpec; obtained: ptr AudioSpec): cint {...}{.
    importc: "SDL_OpenAudio", cdecl.}
This function opens the audio device with the desired parameters, and
  returns 0 if successful, placing the actual hardware parameters in the
  structure pointed to by \c obtained.  If \c obtained is NULL, the audio
  data passed to the callback function will be guaranteed to be in the
  requested format, and will be automatically converted to the hardware
  audio format if necessary.  This function returns -1 if it failed
  to open the audio device, or couldn't set up the audio thread.
  
  When filling in the desired audio spec structure,
    - \c desired->freq should be the desired audio frequency in samples-per-
      second.
    - \c desired->format should be the desired audio format.
    - \c desired->samples is the desired size of the audio buffer, in
      samples.  This number should be a power of two, and may be adjusted by
      the audio driver to a value more suitable for the hardware.  Good values
      seem to range between 512 and 8096 inclusive, depending on the
      application and CPU speed.  Smaller values yield faster response time,
      but can lead to underflow if the application is doing heavy processing
      and cannot fill the audio buffer in time.  A stereo sample consists of
      both right and left channels in LR ordering.
      Note that the number of samples is directly related to time by the
      following formula:  \code ms = (samples1000)/freq \endcode
    - \c desired->size is the size in bytes of the audio buffer, and is
      calculated by SDL_OpenAudio().
    - \c desired->silence is the value used to set the buffer to silence,
      and is calculated by SDL_OpenAudio().
    - \c desired->callback should be set to a function that will be called
      when the audio device is ready for more data.  It is passed a pointer
      to the audio buffer, and the length in bytes of the audio buffer.
      This function usually runs in a separate thread, and so you should
      protect data structures that it accesses by calling SDL_LockAudio()
      and SDL_UnlockAudio() in your code. Alternately, you may pass a NULL
      pointer here, and call SDL_QueueAudio() with some frequency, to queue
      more audio samples to be played (or for capture devices, call
      SDL_DequeueAudio() with some frequency, to obtain audio samples).
    - \c desired->userdata is passed as the first parameter to your callback
      function. If you passed a NULL callback, this value is ignored.
  
  The audio device starts out playing silence when it's opened, and should
  be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready
  for your audio callback function to be called.  Since the audio driver
  may modify the requested size of the audio buffer, you should allocate
  any local mixing buffers after you open the audio device.
proc getNumAudioDevices(iscapture: cint): cint {...}{.importc: "SDL_GetNumAudioDevices",
    cdecl.}
Get the number of available devices exposed by the current driver.
  Only valid after a successfully initializing the audio subsystem.
  Returns -1 if an explicit list of devices can't be determined; this is
  not an error. For example, if SDL is set up to talk to a remote audio
  server, it can't list every one available on the Internet, but it will
  still allow a specific host to be specified to SDL_OpenAudioDevice().
  
  In many common cases, when this function returns a value <= 0, it can still
  successfully open the default device (NULL for first argument of
  SDL_OpenAudioDevice()).
proc getAudioDeviceName(index: cint; iscapture: cint): cstring {...}{.
    importc: "SDL_GetAudioDeviceName", cdecl.}
Get the human-readable name of a specific audio device.
  Must be a value between 0 and (number of audio devices-1).
  Only valid after a successfully initializing the audio subsystem.
  The values returned by this function reflect the latest call to
  SDL_GetNumAudioDevices(); recall that function to redetect available
  hardware.
  
  The string returned by this function is UTF-8 encoded, read-only, and
  managed internally. You are not to free it. If you need to keep the
  string for any length of time, you should make your own copy of it, as it
  will be invalid next time any of several other SDL functions is called.
proc openAudioDevice(device: cstring; iscapture: cint; desired: ptr AudioSpec;
                    obtained: ptr AudioSpec; allowedChanges: cint): AudioDeviceID {...}{.
    importc: "SDL_OpenAudioDevice", cdecl.}
Open a specific audio device. Passing in a device name of NULL requests
  the most reasonable default (and is equivalent to calling SDL_OpenAudio()).
  
  The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but
  some drivers allow arbitrary and driver-specific strings, such as a
  hostname/IP address for a remote audio server, or a filename in the
  diskaudio driver.
  
  \return 0 on error, a valid device ID that is >= 2 on success.
  
  SDL_OpenAudio(), unlike this function, always acts on device ID 1.
proc getAudioStatus(): AudioStatus {...}{.importc: "SDL_GetAudioStatus", cdecl.}
proc getAudioDeviceStatus(dev: AudioDeviceID): AudioStatus {...}{.
    importc: "SDL_GetAudioDeviceStatus", cdecl.}
proc pauseAudio(pauseOn: cint) {...}{.importc: "SDL_PauseAudio", cdecl.}
@}
Audio State
\name Pause audio functions
  
  These functions pause and unpause the audio callback processing.
  They should be called with a parameter of 0 after opening the audio
  device to start playing sound.  This is so you can safely initialize
  data for your callback function after opening the audio device.
  Silence will be written to the audio device during the pause.
@{
proc pauseAudioDevice(dev: AudioDeviceID; pauseOn: cint) {...}{.
    importc: "SDL_PauseAudioDevice", cdecl.}
proc loadWAV_RW(src: ptr RWops; freesrc: cint; spec: ptr AudioSpec;
               audioBuf: ptr ptr Uint8; audioLen: ptr Uint32): ptr AudioSpec {...}{.
    importc: "SDL_LoadWAV_RW", cdecl.}
@}
Pause audio functions
\brief Load the audio data of a WAVE file into memory
  
  Loading a WAVE file requires \c src, \c spec, \c audio_buf and \c audio_len
  to be valid pointers. The entire data portion of the file is then loaded
  into memory and decoded if necessary.
  
  If \c freesrc is non-zero, the data source gets automatically closed and
  freed before the function returns.
  
  Supported are RIFF WAVE files with the formats PCM (8, 16, 24, and 32 bits),
  IEEE Float (32 bits), Microsoft ADPCM and IMA ADPCM (4 bits), and A-law and
  µ-law (8 bits). Other formats are currently unsupported and cause an error.
  
  If this function succeeds, the pointer returned by it is equal to \c spec
  and the pointer to the audio data allocated by the function is written to
  \c audio_buf and its length in bytes to \c audio_len. The \ref SDL_AudioSpec
  members \c freq, \c channels, and \c format are set to the values of the
  audio data in the buffer. The \c samples member is set to a sane default and
  all others are set to zero.
  
  It's necessary to use SDL_FreeWAV() to free the audio data returned in
  \c audio_buf when it is no longer used.
  
  Because of the underspecification of the Waveform format, there are many
  problematic files in the wild that cause issues with strict decoders. To
  provide compatibility with these files, this decoder is lenient in regards
  to the truncation of the file, the fact chunk, and the size of the RIFF
  chunk. The hints SDL_HINT_WAVE_RIFF_CHUNK_SIZE, SDL_HINT_WAVE_TRUNCATION,
  and SDL_HINT_WAVE_FACT_CHUNK can be used to tune the behavior of the
  loading process.
  
  Any file that is invalid (due to truncation, corruption, or wrong values in
  the headers), too big, or unsupported causes an error. Additionally, any
  critical I/O error from the data source will terminate the loading process
  with an error. The function returns NULL on error and in all cases (with the
  exception of \c src being NULL), an appropriate error message will be set.
  
  It is required that the data source supports seeking.
  
  Example:
  \code
      SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...);
  \endcode
  
  \param src The data source with the WAVE data
  \param freesrc A integer value that makes the function close the data source if non-zero
  \param spec A pointer filled with the audio format of the audio data
  \param audio_buf A pointer filled with the audio data allocated by the function
  \param audio_len A pointer filled with the length of the audio data buffer in bytes
  \return NULL on error, or non-NULL on success.
proc freeWAV(audioBuf: ptr Uint8) {...}{.importc: "SDL_FreeWAV", cdecl.}
This function frees data previously allocated with SDL_LoadWAV_RW()
proc buildAudioCVT(cvt: ptr AudioCVT; srcFormat: AudioFormat; srcChannels: Uint8;
                  srcRate: cint; dstFormat: AudioFormat; dstChannels: Uint8;
                  dstRate: cint): cint {...}{.importc: "SDL_BuildAudioCVT", cdecl.}
This function takes a source format and rate and a destination format
  and rate, and initializes the \c cvt structure with information needed
  by SDL_ConvertAudio() to convert a buffer of audio data from one format
  to the other. An unsupported format causes an error and -1 will be returned.
  
  \return 0 if no conversion is needed, 1 if the audio filter is set up,
  or -1 on error.
proc convertAudio(cvt: ptr AudioCVT): cint {...}{.importc: "SDL_ConvertAudio", cdecl.}
Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(),
  created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of
  audio data in the source format, this function will convert it in-place
  to the desired format.
  
  The data conversion may expand the size of the audio data, so the buffer
  \c cvt->buf should be allocated after the \c cvt structure is initialized by
  SDL_BuildAudioCVT(), and should be \c cvt->lencvt->len_mult bytes long.
  
  \return 0 on success or -1 if \c cvt->buf is NULL.
proc newAudioStream(srcFormat: AudioFormat; srcChannels: Uint8; srcRate: cint;
                   dstFormat: AudioFormat; dstChannels: Uint8; dstRate: cint): ptr AudioStream {...}{.
    importc: "SDL_NewAudioStream", cdecl.}
Create a new audio stream
  
  \param src_format The format of the source audio
  \param src_channels The number of channels of the source audio
  \param src_rate The sampling rate of the source audio
  \param dst_format The format of the desired audio output
  \param dst_channels The number of channels of the desired audio output
  \param dst_rate The sampling rate of the desired audio output
  \return 0 on success, or -1 on error.
  
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamFlush
  \sa SDL_AudioStreamClear
  \sa SDL_FreeAudioStream
proc audioStreamPut(stream: ptr AudioStream; buf: pointer; len: cint): cint {...}{.
    importc: "SDL_AudioStreamPut", cdecl.}
Add data to be converted/resampled to the stream
  
  \param stream The stream the audio data is being added to
  \param buf A pointer to the audio data to add
  \param len The number of bytes to write to the stream
  \return 0 on success, or -1 on error.
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamFlush
  \sa SDL_AudioStreamClear
  \sa SDL_FreeAudioStream
proc audioStreamGet(stream: ptr AudioStream; buf: pointer; len: cint): cint {...}{.
    importc: "SDL_AudioStreamGet", cdecl.}
Get converted/resampled data from the stream
  
  \param stream The stream the audio is being requested from
  \param buf A buffer to fill with audio data
  \param len The maximum number of bytes to fill
  \return The number of bytes read from the stream, or -1 on error
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamFlush
  \sa SDL_AudioStreamClear
  \sa SDL_FreeAudioStream
proc audioStreamAvailable(stream: ptr AudioStream): cint {...}{.
    importc: "SDL_AudioStreamAvailable", cdecl.}
Get the number of converted/resampled bytes available. The stream may be
  buffering data behind the scenes until it has enough to resample
  correctly, so this number might be lower than what you expect, or even
  be zero. Add more data or flush the stream if you need the data now.
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamFlush
  \sa SDL_AudioStreamClear
  \sa SDL_FreeAudioStream
proc audioStreamFlush(stream: ptr AudioStream): cint {...}{.
    importc: "SDL_AudioStreamFlush", cdecl.}
Tell the stream that you're done sending data, and anything being buffered
  should be converted/resampled and made available immediately.
 
 It is legal to add more data to a stream after flushing, but there will
  be audio gaps in the output. Generally this is intended to signal the
  end of input, so the complete output becomes available.
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamClear
  \sa SDL_FreeAudioStream
proc audioStreamClear(stream: ptr AudioStream) {...}{.importc: "SDL_AudioStreamClear",
    cdecl.}
Clear any pending data in the stream without converting it
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamFlush
  \sa SDL_FreeAudioStream
proc freeAudioStream(stream: ptr AudioStream) {...}{.importc: "SDL_FreeAudioStream", cdecl.}
Free an audio stream
  
  \sa SDL_NewAudioStream
  \sa SDL_AudioStreamPut
  \sa SDL_AudioStreamGet
  \sa SDL_AudioStreamAvailable
  \sa SDL_AudioStreamFlush
  \sa SDL_AudioStreamClear
proc mixAudio(dst: ptr Uint8; src: ptr Uint8; len: Uint32; volume: cint) {...}{.
    importc: "SDL_MixAudio", cdecl.}
This takes two audio buffers of the playing audio format and mixes
  them, performing addition, volume adjustment, and overflow clipping.
  The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME
  for full audio volume.  Note this does not change hardware volume.
  This is provided for convenience -- you can mix your own audio data.
proc mixAudioFormat(dst: ptr Uint8; src: ptr Uint8; format: AudioFormat; len: Uint32;
                   volume: cint) {...}{.importc: "SDL_MixAudioFormat", cdecl.}
This works like SDL_MixAudio(), but you specify the audio format instead of
  using the format of audio device 1. Thus it can be used when no audio
  device is open at all.
proc queueAudio(dev: AudioDeviceID; data: pointer; len: Uint32): cint {...}{.
    importc: "SDL_QueueAudio", cdecl.}
Queue more audio on non-callback devices.
  
  (If you are looking to retrieve queued audio from a non-callback capture
  device, you want SDL_DequeueAudio() instead. This will return -1 to
  signify an error if you use it with capture devices.)
  
  SDL offers two ways to feed audio to the device: you can either supply a
  callback that SDL triggers with some frequency to obtain more audio
  (pull method), or you can supply no callback, and then SDL will expect
  you to supply data at regular intervals (push method) with this function.
  
  There are no limits on the amount of data you can queue, short of
  exhaustion of address space. Queued data will drain to the device as
  necessary without further intervention from you. If the device needs
  audio but there is not enough queued, it will play silence to make up
  the difference. This means you will have skips in your audio playback
  if you aren't routinely queueing sufficient data.
  
  This function copies the supplied data, so you are safe to free it when
  the function returns. This function is thread-safe, but queueing to the
  same device from two threads at once does not promise which buffer will
  be queued first.
  
  You may not queue audio on a device that is using an application-supplied
  callback; doing so returns an error. You have to use the audio callback
  or queue audio with this function, but not both.
  
  You should not call SDL_LockAudio() on the device before queueing; SDL
  handles locking internally for this function.
  
  \param dev The device ID to which we will queue audio.
  \param data The data to queue to the device for later playback.
  \param len The number of bytes (not samples!) to which (data) points.
  \return 0 on success, or -1 on error.
  
  \sa SDL_GetQueuedAudioSize
  \sa SDL_ClearQueuedAudio
proc dequeueAudio(dev: AudioDeviceID; data: pointer; len: Uint32): Uint32 {...}{.
    importc: "SDL_DequeueAudio", cdecl.}
Dequeue more audio on non-callback devices.
  
  (If you are looking to queue audio for output on a non-callback playback
  device, you want SDL_QueueAudio() instead. This will always return 0
  if you use it with playback devices.)
  
  SDL offers two ways to retrieve audio from a capture device: you can
  either supply a callback that SDL triggers with some frequency as the
  device records more audio data, (push method), or you can supply no
  callback, and then SDL will expect you to retrieve data at regular
  intervals (pull method) with this function.
  
  There are no limits on the amount of data you can queue, short of
  exhaustion of address space. Data from the device will keep queuing as
  necessary without further intervention from you. This means you will
  eventually run out of memory if you aren't routinely dequeueing data.
  
  Capture devices will not queue data when paused; if you are expecting
  to not need captured audio for some length of time, use
  SDL_PauseAudioDevice() to stop the capture device from queueing more
  data. This can be useful during, say, level loading times. When
  unpaused, capture devices will start queueing data from that point,
  having flushed any capturable data available while paused.
  
  This function is thread-safe, but dequeueing from the same device from
  two threads at once does not promise which thread will dequeued data
  first.
  
  You may not dequeue audio from a device that is using an
  application-supplied callback; doing so returns an error. You have to use
  the audio callback, or dequeue audio with this function, but not both.
  
  You should not call SDL_LockAudio() on the device before queueing; SDL
  handles locking internally for this function.
  
  \param dev The device ID from which we will dequeue audio.
  \param data A pointer into where audio data should be copied.
  \param len The number of bytes (not samples!) to which (data) points.
  \return number of bytes dequeued, which could be less than requested.
  
  \sa SDL_GetQueuedAudioSize
  \sa SDL_ClearQueuedAudio
proc getQueuedAudioSize(dev: AudioDeviceID): Uint32 {...}{.
    importc: "SDL_GetQueuedAudioSize", cdecl.}
Get the number of bytes of still-queued audio.
  
  For playback device:
    
    This is the number of bytes that have been queued for playback with
    SDL_QueueAudio(), but have not yet been sent to the hardware. This
    number may shrink at any time, so this only informs of pending data.
    
    Once we've sent it to the hardware, this function can not decide the
    exact byte boundary of what has been played. It's possible that we just
    gave the hardware several kilobytes right before you called this
    function, but it hasn't played any of it yet, or maybe half of it, etc.
  
  For capture devices:
    
    This is the number of bytes that have been captured by the device and
    are waiting for you to dequeue. This number may grow at any time, so
    this only informs of the lower-bound of available data.
  
  You may not queue audio on a device that is using an application-supplied
  callback; calling this function on such a device always returns 0.
  You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
  the audio callback, but not both.
  
  You should not call SDL_LockAudio() on the device before querying; SDL
  handles locking internally for this function.
  
  \param dev The device ID of which we will query queued audio size.
  \return Number of bytes (not samples!) of queued audio.
  
  \sa SDL_QueueAudio
  \sa SDL_ClearQueuedAudio
proc clearQueuedAudio(dev: AudioDeviceID) {...}{.importc: "SDL_ClearQueuedAudio", cdecl.}
Drop any queued audio data. For playback devices, this is any queued data
  still waiting to be submitted to the hardware. For capture devices, this
  is any data that was queued by the device that hasn't yet been dequeued by
  the application.
  
  Immediately after this call, SDL_GetQueuedAudioSize() will return 0. For
  playback devices, the hardware will start playing silence if more audio
  isn't queued. Unpaused capture devices will start filling the queue again
  as soon as they have more data available (which, depending on the state
  of the hardware and the thread, could be before this function call
  returns!).
  
  This will not prevent playback of queued audio that's already been sent
  to the hardware, as we can not undo that, so expect there to be some
  fraction of a second of audio that might still be heard. This can be
  useful if you want to, say, drop any pending music during a level change
  in your game.
  
  You may not queue audio on a device that is using an application-supplied
  callback; calling this function on such a device is always a no-op.
  You have to queue audio with SDL_QueueAudio()/SDL_DequeueAudio(), or use
  the audio callback, but not both.
  
  You should not call SDL_LockAudio() on the device before clearing the
  queue; SDL handles locking internally for this function.
  
  This function always succeeds and thus returns void.
  
  \param dev The device ID of which to clear the audio queue.
  
  \sa SDL_QueueAudio
  \sa SDL_GetQueuedAudioSize
proc lockAudio() {...}{.importc: "SDL_LockAudio", cdecl.}
\name Audio lock functions
  
  The lock manipulated by these functions protects the callback function.
  During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that
  the callback function is not running.  Do not call these from the callback
  function or you will cause deadlock.
@{
proc lockAudioDevice(dev: AudioDeviceID) {...}{.importc: "SDL_LockAudioDevice", cdecl.}
proc unlockAudio() {...}{.importc: "SDL_UnlockAudio", cdecl.}
proc unlockAudioDevice(dev: AudioDeviceID) {...}{.importc: "SDL_UnlockAudioDevice", cdecl.}
proc closeAudio() {...}{.importc: "SDL_CloseAudio", cdecl.}
@}
Audio lock functions
This function shuts down audio processing and closes the audio device.
proc closeAudioDevice(dev: AudioDeviceID) {...}{.importc: "SDL_CloseAudioDevice", cdecl.}
proc setClipboardText(text: cstring): cint {...}{.importc: "SDL_SetClipboardText", cdecl.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
Function prototypes
\brief Put UTF-8 text into the clipboard
 
 \sa SDL_GetClipboardText()
proc getClipboardText(): cstring {...}{.importc: "SDL_GetClipboardText", cdecl.}
\brief Get UTF-8 text from the clipboard, which must be freed with SDL_free()
 
 \sa SDL_SetClipboardText()
proc hasClipboardText(): bool {...}{.importc: "SDL_HasClipboardText", cdecl.}
\brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty
 
 \sa SDL_GetClipboardText()
proc getCPUCount(): cint {...}{.importc: "SDL_GetCPUCount", cdecl.}
This function returns the number of CPU cores available.
proc getCPUCacheLineSize(): cint {...}{.importc: "SDL_GetCPUCacheLineSize", cdecl.}
This function returns the L1 cache line size of the CPU
  
  This is useful for determining multi-threaded structure padding
  or SIMD prefetch sizes.
proc hasRDTSC(): bool {...}{.importc: "SDL_HasRDTSC", cdecl.}
This function returns true if the CPU has the RDTSC instruction.
proc hasAltiVec(): bool {...}{.importc: "SDL_HasAltiVec", cdecl.}
This function returns true if the CPU has AltiVec features.
proc hasMMX(): bool {...}{.importc: "SDL_HasMMX", cdecl.}
This function returns true if the CPU has MMX features.
proc has3DNow(): bool {...}{.importc: "SDL_Has3DNow", cdecl.}
This function returns true if the CPU has 3DNow! features.
proc hasSSE(): bool {...}{.importc: "SDL_HasSSE", cdecl.}
This function returns true if the CPU has SSE features.
proc hasSSE2(): bool {...}{.importc: "SDL_HasSSE2", cdecl.}
This function returns true if the CPU has SSE2 features.
proc hasSSE3(): bool {...}{.importc: "SDL_HasSSE3", cdecl.}
This function returns true if the CPU has SSE3 features.
proc hasSSE41(): bool {...}{.importc: "SDL_HasSSE41", cdecl.}
This function returns true if the CPU has SSE4.1 features.
proc hasSSE42(): bool {...}{.importc: "SDL_HasSSE42", cdecl.}
This function returns true if the CPU has SSE4.2 features.
proc hasAVX(): bool {...}{.importc: "SDL_HasAVX", cdecl.}
This function returns true if the CPU has AVX features.
proc hasAVX2(): bool {...}{.importc: "SDL_HasAVX2", cdecl.}
This function returns true if the CPU has AVX2 features.
proc hasAVX512F(): bool {...}{.importc: "SDL_HasAVX512F", cdecl.}
This function returns true if the CPU has AVX-512F (foundation) features.
proc hasARMSIMD(): bool {...}{.importc: "SDL_HasARMSIMD", cdecl.}
This function returns true if the CPU has ARM SIMD (ARMv6) features.
proc hasNEON(): bool {...}{.importc: "SDL_HasNEON", cdecl.}
This function returns true if the CPU has NEON (ARM SIMD) features.
proc getSystemRAM(): cint {...}{.importc: "SDL_GetSystemRAM", cdecl.}
This function returns the amount of RAM configured in the system, in MB.
proc sIMDGetAlignment(): uint {...}{.importc: "SDL_SIMDGetAlignment", cdecl.}
\brief Report the alignment this system needs for SIMD allocations.
 
 This will return the minimum number of bytes to which a pointer must be
  aligned to be compatible with SIMD instructions on the current machine.
  For example, if the machine supports SSE only, it will return 16, but if
  it supports AVX-512F, it'll return 64 (etc). This only reports values for
  instruction sets SDL knows about, so if your SDL build doesn't have
  SDL_HasAVX512F(), then it might return 16 for the SSE support it sees and
  not 64 for the AVX-512 instructions that exist but SDL doesn't know about.
  Plan accordingly.
proc sIMDAlloc(len: uint): pointer {...}{.importc: "SDL_SIMDAlloc", cdecl.}
\brief Allocate memory in a SIMD-friendly way.
 
 This will allocate a block of memory that is suitable for use with SIMD
  instructions. Specifically, it will be properly aligned and padded for
  the system's supported vector instructions.
 
 The memory returned will be padded such that it is safe to read or write
  an incomplete vector at the end of the memory block. This can be useful
  so you don't have to drop back to a scalar fallback at the end of your
  SIMD processing loop to deal with the final elements without overflowing
  the allocated buffer.
 
 You must free this memory with SDL_FreeSIMD(), not free() or SDL_free()
  or delete[], etc.
 
 Note that SDL will only deal with SIMD instruction sets it is aware of;
  for example, SDL 2.0.8 knows that SSE wants 16-byte vectors
  (SDL_HasSSE()), and AVX2 wants 32 bytes (SDL_HasAVX2()), but doesn't
  know that AVX-512 wants 64. To be clear: if you can't decide to use an
  instruction set with an SDL_Has() function, don't use that instruction
  set with memory allocated through here.
 
 SDL_AllocSIMD(0) will return a non-NULL pointer, assuming the system isn't
  out of memory.
  
  \param len The length, in bytes, of the block to allocated. The actual
             allocated block might be larger due to padding, etc.
 \return Pointer to newly-allocated block, NULL if out of memory.
 
 \sa SDL_SIMDAlignment
 \sa SDL_SIMDFree
proc sIMDFree(`ptr`: pointer) {...}{.importc: "SDL_SIMDFree", cdecl.}
\brief Deallocate memory obtained from SDL_SIMDAlloc
 
 It is not valid to use this function on a pointer from anything but
  SDL_SIMDAlloc(). It can't be used on pointers from malloc, realloc,
  SDL_malloc, memalign, new[], etc.
 
 However, SDL_SIMDFree(NULL) is a legal no-op.
 
 \sa SDL_SIMDAlloc
proc getPixelFormatName(format: Uint32): cstring {...}{.
    importc: "SDL_GetPixelFormatName", cdecl.}
\brief Get the human readable name of a pixel format
proc pixelFormatEnumToMasks(format: Uint32; bpp: ptr cint; Rmask: ptr Uint32;
                           Gmask: ptr Uint32; Bmask: ptr Uint32; Amask: ptr Uint32): bool {...}{.
    importc: "SDL_PixelFormatEnumToMasks", cdecl.}
\brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
  
  \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
  
  \sa SDL_MasksToPixelFormatEnum()
proc masksToPixelFormatEnum(bpp: cint; Rmask: Uint32; Gmask: Uint32; Bmask: Uint32;
                           Amask: Uint32): Uint32 {...}{.
    importc: "SDL_MasksToPixelFormatEnum", cdecl.}
\brief Convert a bpp and RGBA masks to an enumerated pixel format.
  
  \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
          wasn't possible.
  
  \sa SDL_PixelFormatEnumToMasks()
proc allocFormat(pixelFormat: Uint32): ptr PixelFormat {...}{.importc: "SDL_AllocFormat",
    cdecl.}
\brief Create an SDL_PixelFormat structure from a pixel format enum.
proc freeFormat(format: ptr PixelFormat) {...}{.importc: "SDL_FreeFormat", cdecl.}
\brief Free an SDL_PixelFormat structure.
proc allocPalette(ncolors: cint): ptr Palette {...}{.importc: "SDL_AllocPalette", cdecl.}
\brief Create a palette structure with the specified number of color
         entries.
  
  \return A new palette, or NULL if there wasn't enough memory.
  
  \note The palette entries are initialized to white.
  
  \sa SDL_FreePalette()
proc setPixelFormatPalette(format: ptr PixelFormat; palette: ptr Palette): cint {...}{.
    importc: "SDL_SetPixelFormatPalette", cdecl.}
\brief Set the palette for a pixel format structure.
proc setPaletteColors(palette: ptr Palette; colors: ptr Color; firstcolor: cint;
                     ncolors: cint): cint {...}{.importc: "SDL_SetPaletteColors", cdecl.}
\brief Set a range of colors in a palette.
  
  \param palette    The palette to modify.
  \param colors     An array of colors to copy into the palette.
  \param firstcolor The index of the first palette entry to modify.
  \param ncolors    The number of entries to modify.
  
  \return 0 on success, or -1 if not all of the colors could be set.
proc freePalette(palette: ptr Palette) {...}{.importc: "SDL_FreePalette", cdecl.}
\brief Free a palette created with SDL_AllocPalette().
  
  \sa SDL_AllocPalette()
proc mapRGB(format: ptr PixelFormat; r: Uint8; g: Uint8; b: Uint8): Uint32 {...}{.
    importc: "SDL_MapRGB", cdecl.}
\brief Maps an RGB triple to an opaque pixel value for a given pixel format.
  
  \sa SDL_MapRGBA
proc mapRGBA(format: ptr PixelFormat; r: Uint8; g: Uint8; b: Uint8; a: Uint8): Uint32 {...}{.
    importc: "SDL_MapRGBA", cdecl.}
\brief Maps an RGBA quadruple to a pixel value for a given pixel format.
  
  \sa SDL_MapRGB
proc getRGB(pixel: Uint32; format: ptr PixelFormat; r: ptr Uint8; g: ptr Uint8; b: ptr Uint8) {...}{.
    importc: "SDL_GetRGB", cdecl.}
\brief Get the RGB components from a pixel of the specified format.
  
  \sa SDL_GetRGBA
proc getRGBA(pixel: Uint32; format: ptr PixelFormat; r: ptr Uint8; g: ptr Uint8;
            b: ptr Uint8; a: ptr Uint8) {...}{.importc: "SDL_GetRGBA", cdecl.}
\brief Get the RGBA components from a pixel of the specified format.
  
  \sa SDL_GetRGB
proc calculateGammaRamp(gamma: cfloat; ramp: ptr Uint16) {...}{.
    importc: "SDL_CalculateGammaRamp", cdecl.}
\brief Calculate a 256 entry gamma ramp for a gamma value.
proc hasIntersection(A: ptr Rect; B: ptr Rect): bool {...}{.importc: "SDL_HasIntersection",
    cdecl.}
\brief Determine whether two rectangles intersect.
  
  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
proc intersectRect(A: ptr Rect; B: ptr Rect; result: ptr Rect): bool {...}{.
    importc: "SDL_IntersectRect", cdecl.}
\brief Calculate the intersection of two rectangles.
  
  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
proc unionRect(A: ptr Rect; B: ptr Rect; result: ptr Rect) {...}{.importc: "SDL_UnionRect", cdecl.}
\brief Calculate the union of two rectangles.
proc enclosePoints(points: ptr Point; count: cint; clip: ptr Rect; result: ptr Rect): bool {...}{.
    importc: "SDL_EnclosePoints", cdecl.}
\brief Calculate a minimal rectangle enclosing a set of points
  
  \return SDL_TRUE if any points were within the clipping rect
proc intersectRectAndLine(rect: ptr Rect; X1: ptr cint; Y1: ptr cint; X2: ptr cint;
                         Y2: ptr cint): bool {...}{.importc: "SDL_IntersectRectAndLine",
    cdecl.}
\brief Calculate the intersection of a rectangle and line segment.
  
  \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise.
proc composeCustomBlendMode(srcColorFactor: BlendFactor;
                           dstColorFactor: BlendFactor;
                           colorOperation: BlendOperation;
                           srcAlphaFactor: BlendFactor;
                           dstAlphaFactor: BlendFactor;
                           alphaOperation: BlendOperation): BlendMode {...}{.
    importc: "SDL_ComposeCustomBlendMode", cdecl.}
\brief Create a custom blend mode, which may or may not be supported by a given renderer
  
  \param srcColorFactor source color factor
  \param dstColorFactor destination color factor
  \param colorOperation color operation
  \param srcAlphaFactor source alpha factor
  \param dstAlphaFactor destination alpha factor
  \param alphaOperation alpha operation
  
  The result of the blend mode operation will be:
      dstRGB = dstRGB dstColorFactor colorOperation srcRGB srcColorFactor
  and
      dstA = dstA dstAlphaFactor alphaOperation srcA srcAlphaFactor
proc createRGBSurface(flags: Uint32; width: cint; height: cint; depth: cint;
                     Rmask: Uint32; Gmask: Uint32; Bmask: Uint32; Amask: Uint32): ptr Surface {...}{.
    importc: "SDL_CreateRGBSurface", cdecl.}
Allocate and free an RGB surface.
  
  If the depth is 4 or 8 bits, an empty palette is allocated for the surface.
  If the depth is greater than 8 bits, the pixel format is set using the
  flags '[RGB]mask'.
  
  If the function runs out of memory, it will return NULL.
  
  \param flags The \c flags are obsolete and should be set to 0.
  \param width The width in pixels of the surface to create.
  \param height The height in pixels of the surface to create.
  \param depth The depth in bits of the surface to create.
  \param Rmask The red mask of the surface to create.
  \param Gmask The green mask of the surface to create.
  \param Bmask The blue mask of the surface to create.
  \param Amask The alpha mask of the surface to create.
proc createRGBSurfaceWithFormat(flags: Uint32; width: cint; height: cint; depth: cint;
                               format: Uint32): ptr Surface {...}{.
    importc: "SDL_CreateRGBSurfaceWithFormat", cdecl.}
!!! FIXME for 2.1: why does this ask for depth? Format provides that.
proc createRGBSurfaceFrom(pixels: pointer; width: cint; height: cint; depth: cint;
                         pitch: cint; Rmask: Uint32; Gmask: Uint32; Bmask: Uint32;
                         Amask: Uint32): ptr Surface {...}{.
    importc: "SDL_CreateRGBSurfaceFrom", cdecl.}
proc createRGBSurfaceWithFormatFrom(pixels: pointer; width: cint; height: cint;
                                   depth: cint; pitch: cint; format: Uint32): ptr Surface {...}{.
    importc: "SDL_CreateRGBSurfaceWithFormatFrom", cdecl.}
proc freeSurface(surface: ptr Surface) {...}{.importc: "SDL_FreeSurface", cdecl.}
proc setSurfacePalette(surface: ptr Surface; palette: ptr Palette): cint {...}{.
    importc: "SDL_SetSurfacePalette", cdecl.}
\brief Set the palette used by a surface.
  
  \return 0, or -1 if the surface format doesn't use a palette.
  
  \note A single palette can be shared with many surfaces.
proc lockSurface(surface: ptr Surface): cint {...}{.importc: "SDL_LockSurface", cdecl.}
\brief Sets up a surface for directly accessing the pixels.
  
  Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write
  to and read from \c surface->pixels, using the pixel format stored in
  \c surface->format.  Once you are done accessing the surface, you should
  use SDL_UnlockSurface() to release it.
  
  Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates
  to 0, then you can read and write to the surface at any time, and the
  pixel format of the surface will not change.
  
  No operating system or library calls should be made between lock/unlock
  pairs, as critical system locks may be held during this time.
  
  SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.
  
  \sa SDL_UnlockSurface()
proc unlockSurface(surface: ptr Surface) {...}{.importc: "SDL_UnlockSurface", cdecl.}
\sa SDL_LockSurface()
proc loadBMP_RW(src: ptr RWops; freesrc: cint): ptr Surface {...}{.importc: "SDL_LoadBMP_RW",
    cdecl.}
Load a surface from a seekable SDL data stream (memory or file).
  
  If \c freesrc is non-zero, the stream will be closed after being read.
  
  The new surface should be freed with SDL_FreeSurface().
  
  \return the new surface, or NULL if there was an error.
proc saveBMP_RW(surface: ptr Surface; dst: ptr RWops; freedst: cint): cint {...}{.
    importc: "SDL_SaveBMP_RW", cdecl.}
Save a surface to a seekable SDL data stream (memory or file).
  
  Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
  BMP directly. Other RGB formats with 8-bit or higher get converted to a
  24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
  surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
  not supported.
  
  If \c freedst is non-zero, the stream will be closed after being written.
  
  \return 0 if successful or -1 if there was an error.
proc setSurfaceRLE(surface: ptr Surface; flag: cint): cint {...}{.
    importc: "SDL_SetSurfaceRLE", cdecl.}
\brief Sets the RLE acceleration hint for a surface.
  
  \return 0 on success, or -1 if the surface is not valid
  
  \note If RLE is enabled, colorkey and alpha blending blits are much faster,
        but the surface must be locked before directly accessing the pixels.
proc setColorKey(surface: ptr Surface; flag: cint; key: Uint32): cint {...}{.
    importc: "SDL_SetColorKey", cdecl.}
\brief Sets the color key (transparent pixel) in a blittable surface.
  
  \param surface The surface to update
  \param flag Non-zero to enable colorkey and 0 to disable colorkey
  \param key The transparent pixel in the native surface format
  
  \return 0 on success, or -1 if the surface is not valid
  
  You can pass SDL_RLEACCEL to enable RLE accelerated blits.
proc hasColorKey(surface: ptr Surface): bool {...}{.importc: "SDL_HasColorKey", cdecl.}
\brief Returns whether the surface has a color key
  
  \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key
proc getColorKey(surface: ptr Surface; key: ptr Uint32): cint {...}{.
    importc: "SDL_GetColorKey", cdecl.}
\brief Gets the color key (transparent pixel) in a blittable surface.
  
  \param surface The surface to update
  \param key A pointer filled in with the transparent pixel in the native
             surface format
  
  \return 0 on success, or -1 if the surface is not valid or colorkey is not
          enabled.
proc setSurfaceColorMod(surface: ptr Surface; r: Uint8; g: Uint8; b: Uint8): cint {...}{.
    importc: "SDL_SetSurfaceColorMod", cdecl.}
\brief Set an additional color value used in blit operations.
  
  \param surface The surface to update.
  \param r The red color value multiplied into blit operations.
  \param g The green color value multiplied into blit operations.
  \param b The blue color value multiplied into blit operations.
  
  \return 0 on success, or -1 if the surface is not valid.
  
  \sa SDL_GetSurfaceColorMod()
proc getSurfaceColorMod(surface: ptr Surface; r: ptr Uint8; g: ptr Uint8; b: ptr Uint8): cint {...}{.
    importc: "SDL_GetSurfaceColorMod", cdecl.}
\brief Get the additional color value used in blit operations.
  
  \param surface The surface to query.
  \param r A pointer filled in with the current red color value.
  \param g A pointer filled in with the current green color value.
  \param b A pointer filled in with the current blue color value.
  
  \return 0 on success, or -1 if the surface is not valid.
  
  \sa SDL_SetSurfaceColorMod()
proc setSurfaceAlphaMod(surface: ptr Surface; alpha: Uint8): cint {...}{.
    importc: "SDL_SetSurfaceAlphaMod", cdecl.}
\brief Set an additional alpha value used in blit operations.
  
  \param surface The surface to update.
  \param alpha The alpha value multiplied into blit operations.
  
  \return 0 on success, or -1 if the surface is not valid.
  
  \sa SDL_GetSurfaceAlphaMod()
proc getSurfaceAlphaMod(surface: ptr Surface; alpha: ptr Uint8): cint {...}{.
    importc: "SDL_GetSurfaceAlphaMod", cdecl.}
\brief Get the additional alpha value used in blit operations.
  
  \param surface The surface to query.
  \param alpha A pointer filled in with the current alpha value.
  
  \return 0 on success, or -1 if the surface is not valid.
  
  \sa SDL_SetSurfaceAlphaMod()
proc setSurfaceBlendMode(surface: ptr Surface; blendMode: BlendMode): cint {...}{.
    importc: "SDL_SetSurfaceBlendMode", cdecl.}
\brief Set the blend mode used for blit operations.
  
  \param surface The surface to update.
  \param blendMode ::SDL_BlendMode to use for blit blending.
  
  \return 0 on success, or -1 if the parameters are not valid.
  
  \sa SDL_GetSurfaceBlendMode()
proc getSurfaceBlendMode(surface: ptr Surface; blendMode: ptr BlendMode): cint {...}{.
    importc: "SDL_GetSurfaceBlendMode", cdecl.}
\brief Get the blend mode used for blit operations.
  
  \param surface   The surface to query.
  \param blendMode A pointer filled in with the current blend mode.
  
  \return 0 on success, or -1 if the surface is not valid.
  
  \sa SDL_SetSurfaceBlendMode()
proc setClipRect(surface: ptr Surface; rect: ptr Rect): bool {...}{.
    importc: "SDL_SetClipRect", cdecl.}
Sets the clipping rectangle for the destination surface in a blit.
  
  If the clip rectangle is NULL, clipping will be disabled.
  
  If the clip rectangle doesn't intersect the surface, the function will
  return SDL_FALSE and blits will be completely clipped.  Otherwise the
  function returns SDL_TRUE and blits to the surface will be clipped to
  the intersection of the surface area and the clipping rectangle.
  
  Note that blits are automatically clipped to the edges of the source
  and destination surfaces.
proc getClipRect(surface: ptr Surface; rect: ptr Rect) {...}{.importc: "SDL_GetClipRect",
    cdecl.}
Gets the clipping rectangle for the destination surface in a blit.
  
  \c rect must be a pointer to a valid rectangle which will be filled
  with the correct values.
proc duplicateSurface(surface: ptr Surface): ptr Surface {...}{.
    importc: "SDL_DuplicateSurface", cdecl.}
Creates a new surface identical to the existing surface
proc convertSurface(src: ptr Surface; fmt: ptr PixelFormat; flags: Uint32): ptr Surface {...}{.
    importc: "SDL_ConvertSurface", cdecl.}
Creates a new surface of the specified format, and then copies and maps
  the given surface to it so the blit of the converted surface will be as
  fast as possible.  If this function fails, it returns NULL.
  
  The \c flags parameter is passed to SDL_CreateRGBSurface() and has those
  semantics.  You can also pass ::SDL_RLEACCEL in the flags parameter and
  SDL will try to RLE accelerate colorkey and alpha blits in the resulting
  surface.
proc convertSurfaceFormat(src: ptr Surface; pixelFormat: Uint32; flags: Uint32): ptr Surface {...}{.
    importc: "SDL_ConvertSurfaceFormat", cdecl.}
proc convertPixels(width: cint; height: cint; srcFormat: Uint32; src: pointer;
                  srcPitch: cint; dstFormat: Uint32; dst: pointer; dstPitch: cint): cint {...}{.
    importc: "SDL_ConvertPixels", cdecl.}
\brief Copy a block of pixels of one format to another format
  
  \return 0 on success, or -1 if there was an error
proc fillRect(dst: ptr Surface; rect: ptr Rect; color: Uint32): cint {...}{.
    importc: "SDL_FillRect", cdecl.}
Performs a fast fill of the given rectangle with \c color.
  
  If \c rect is NULL, the whole surface will be filled with \c color.
  
  The color should be a pixel of the format used by the surface, and
  can be generated by the SDL_MapRGB() function.
  
  \return 0 on success, or -1 on error.
proc fillRects(dst: ptr Surface; rects: ptr Rect; count: cint; color: Uint32): cint {...}{.
    importc: "SDL_FillRects", cdecl.}
proc upperBlit(src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface; dstrect: ptr Rect): cint {...}{.
    importc: "SDL_UpperBlit", cdecl.}
This is the public blit function, SDL_BlitSurface(), and it performs
  rectangle validation and clipping before passing it to SDL_LowerBlit()
proc lowerBlit(src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface; dstrect: ptr Rect): cint {...}{.
    importc: "SDL_LowerBlit", cdecl.}
This is a semi-private blit function and it performs low-level surface
  blitting only.
proc softStretch(src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface; dstrect: ptr Rect): cint {...}{.
    importc: "SDL_SoftStretch", cdecl.}
\brief Perform a fast, low quality, stretch blit between two surfaces of the
         same pixel format.
  
  \note This function uses a static buffer, and is not thread-safe.
proc upperBlitScaled(src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface;
                    dstrect: ptr Rect): cint {...}{.importc: "SDL_UpperBlitScaled", cdecl.}
This is the public scaled blit function, SDL_BlitScaled(), and it performs
  rectangle validation and clipping before passing it to SDL_LowerBlitScaled()
proc lowerBlitScaled(src: ptr Surface; srcrect: ptr Rect; dst: ptr Surface;
                    dstrect: ptr Rect): cint {...}{.importc: "SDL_LowerBlitScaled", cdecl.}
This is a semi-private blit function and it performs low-level surface
  scaled blitting only.
proc setYUVConversionMode(mode: YUV_CONVERSION_MODE) {...}{.
    importc: "SDL_SetYUVConversionMode", cdecl.}
\brief Set the YUV conversion mode
proc getYUVConversionMode(): YUV_CONVERSION_MODE {...}{.
    importc: "SDL_GetYUVConversionMode", cdecl.}
\brief Get the YUV conversion mode
proc getYUVConversionModeForResolution(width: cint; height: cint): YUV_CONVERSION_MODE {...}{.
    importc: "SDL_GetYUVConversionModeForResolution", cdecl.}
\brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
proc getNumVideoDrivers(): cint {...}{.importc: "SDL_GetNumVideoDrivers", cdecl.}
Function prototypes
\brief Get the number of video drivers compiled into SDL
  
  \sa SDL_GetVideoDriver()
proc getVideoDriver(index: cint): cstring {...}{.importc: "SDL_GetVideoDriver", cdecl.}
\brief Get the name of a built in video driver.
  
  \note The video drivers are presented in the order in which they are
        normally checked during initialization.
  
  \sa SDL_GetNumVideoDrivers()
proc videoInit(driverName: cstring): cint {...}{.importc: "SDL_VideoInit", cdecl.}
\brief Initialize the video subsystem, optionally specifying a video driver.
  
  \param driver_name Initialize a specific driver by name, or NULL for the
                     default video driver.
  
  \return 0 on success, -1 on error
  
  This function initializes the video subsystem; setting up a connection
  to the window manager, etc, and determines the available display modes
  and pixel formats, but does not initialize a window or graphics mode.
  
  \sa SDL_VideoQuit()
proc videoQuit() {...}{.importc: "SDL_VideoQuit", cdecl.}
\brief Shuts down the video subsystem.
  
  This function closes all windows, and restores the original video mode.
  
  \sa SDL_VideoInit()
proc getCurrentVideoDriver(): cstring {...}{.importc: "SDL_GetCurrentVideoDriver", cdecl.}
\brief Returns the name of the currently initialized video driver.
  
  \return The name of the current video driver or NULL if no driver
          has been initialized
  
  \sa SDL_GetNumVideoDrivers()
  \sa SDL_GetVideoDriver()
proc getNumVideoDisplays(): cint {...}{.importc: "SDL_GetNumVideoDisplays", cdecl.}
\brief Returns the number of available video displays.
  
  \sa SDL_GetDisplayBounds()
proc getDisplayName(displayIndex: cint): cstring {...}{.importc: "SDL_GetDisplayName",
    cdecl.}
\brief Get the name of a display in UTF-8 encoding
  
  \return The name of a display, or NULL for an invalid display index.
  
  \sa SDL_GetNumVideoDisplays()
proc getDisplayBounds(displayIndex: cint; rect: ptr Rect): cint {...}{.
    importc: "SDL_GetDisplayBounds", cdecl.}
\brief Get the desktop area represented by a display, with the primary
         display located at 0,0
  
  \return 0 on success, or -1 if the index is out of range.
  
  \sa SDL_GetNumVideoDisplays()
proc getDisplayUsableBounds(displayIndex: cint; rect: ptr Rect): cint {...}{.
    importc: "SDL_GetDisplayUsableBounds", cdecl.}
\brief Get the usable desktop area represented by a display, with the
         primary display located at 0,0
  
  This is the same area as SDL_GetDisplayBounds() reports, but with portions
  reserved by the system removed. For example, on Mac OS X, this subtracts
  the area occupied by the menu bar and dock.
  
  Setting a window to be fullscreen generally bypasses these unusable areas,
  so these are good guidelines for the maximum space available to a
  non-fullscreen window.
  
  \return 0 on success, or -1 if the index is out of range.
  
  \sa SDL_GetDisplayBounds()
  \sa SDL_GetNumVideoDisplays()
proc getDisplayDPI(displayIndex: cint; ddpi: ptr cfloat; hdpi: ptr cfloat;
                  vdpi: ptr cfloat): cint {...}{.importc: "SDL_GetDisplayDPI", cdecl.}
\brief Get the dots/pixels-per-inch for a display
  
  \note Diagonal, horizontal and vertical DPI can all be optionally
        returned if the parameter is non-NULL.
  
  \return 0 on success, or -1 if no DPI information is available or the index is out of range.
  
  \sa SDL_GetNumVideoDisplays()
proc getDisplayOrientation(displayIndex: cint): DisplayOrientation {...}{.
    importc: "SDL_GetDisplayOrientation", cdecl.}
\brief Get the orientation of a display
  
  \return The orientation of the display, or SDL_ORIENTATION_UNKNOWN if it isn't available.
  
  \sa SDL_GetNumVideoDisplays()
proc getNumDisplayModes(displayIndex: cint): cint {...}{.
    importc: "SDL_GetNumDisplayModes", cdecl.}
\brief Returns the number of available display modes.
  
  \sa SDL_GetDisplayMode()
proc getDisplayMode(displayIndex: cint; modeIndex: cint; mode: ptr DisplayMode): cint {...}{.
    importc: "SDL_GetDisplayMode", cdecl.}
\brief Fill in information about a specific display mode.
  
  \note The display modes are sorted in this priority:
        \li bits per pixel -> more colors to fewer colors
        \li width -> largest to smallest
        \li height -> largest to smallest
        \li refresh rate -> highest to lowest
  
  \sa SDL_GetNumDisplayModes()
proc getDesktopDisplayMode(displayIndex: cint; mode: ptr DisplayMode): cint {...}{.
    importc: "SDL_GetDesktopDisplayMode", cdecl.}
\brief Fill in information about the desktop display mode.
proc getCurrentDisplayMode(displayIndex: cint; mode: ptr DisplayMode): cint {...}{.
    importc: "SDL_GetCurrentDisplayMode", cdecl.}
\brief Fill in information about the current display mode.
proc getClosestDisplayMode(displayIndex: cint; mode: ptr DisplayMode;
                          closest: ptr DisplayMode): ptr DisplayMode {...}{.
    importc: "SDL_GetClosestDisplayMode", cdecl.}
\brief Get the closest match to the requested display mode.
  
  \param displayIndex The index of display from which mode should be queried.
  \param mode The desired display mode
  \param closest A pointer to a display mode to be filled in with the closest
                 match of the available display modes.
  
  \return The passed in value \c closest, or NULL if no matching video mode
          was available.
  
  The available display modes are scanned, and \c closest is filled in with the
  closest mode matching the requested mode and returned.  The mode format and
  refresh_rate default to the desktop mode if they are 0.  The modes are
  scanned with size being first priority, format being second priority, and
  finally checking the refresh_rate.  If all the available modes are too
  small, then NULL is returned.
  
  \sa SDL_GetNumDisplayModes()
  \sa SDL_GetDisplayMode()
proc getWindowDisplayIndex(window: ptr Window): cint {...}{.
    importc: "SDL_GetWindowDisplayIndex", cdecl.}
\brief Get the display index associated with a window.
  
  \return the display index of the display containing the center of the
          window, or -1 on error.
proc setWindowDisplayMode(window: ptr Window; mode: ptr DisplayMode): cint {...}{.
    importc: "SDL_SetWindowDisplayMode", cdecl.}
\brief Set the display mode used when a fullscreen window is visible.
  
  By default the window's dimensions and the desktop format and refresh rate
  are used.
  
  \param window The window for which the display mode should be set.
  \param mode The mode to use, or NULL for the default mode.
  
  \return 0 on success, or -1 if setting the display mode failed.
  
  \sa SDL_GetWindowDisplayMode()
  \sa SDL_SetWindowFullscreen()
proc getWindowDisplayMode(window: ptr Window; mode: ptr DisplayMode): cint {...}{.
    importc: "SDL_GetWindowDisplayMode", cdecl.}
\brief Fill in information about the display mode used when a fullscreen
         window is visible.
  
  \sa SDL_SetWindowDisplayMode()
  \sa SDL_SetWindowFullscreen()
proc getWindowPixelFormat(window: ptr Window): Uint32 {...}{.
    importc: "SDL_GetWindowPixelFormat", cdecl.}
\brief Get the pixel format associated with the window.
proc createWindow(title: cstring; x: cint; y: cint; w: cint; h: cint; flags: Uint32): ptr Window {...}{.
    importc: "SDL_CreateWindow", cdecl.}
\brief Create a window with the specified position, dimensions, and flags.
  
  \param title The title of the window, in UTF-8 encoding.
  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
               ::SDL_WINDOWPOS_UNDEFINED.
  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
               ::SDL_WINDOWPOS_UNDEFINED.
  \param w     The width of the window, in screen coordinates.
  \param h     The height of the window, in screen coordinates.
  \param flags The flags for the window, a mask of any of the following:
               ::SDL_WINDOW_FULLSCREEN,    ::SDL_WINDOW_OPENGL,
               ::SDL_WINDOW_HIDDEN,        ::SDL_WINDOW_BORDERLESS,
               ::SDL_WINDOW_RESIZABLE,     ::SDL_WINDOW_MAXIMIZED,
               ::SDL_WINDOW_MINIMIZED,     ::SDL_WINDOW_INPUT_GRABBED,
               ::SDL_WINDOW_ALLOW_HIGHDPI, ::SDL_WINDOW_VULKAN.
  
  \return The created window, or NULL if window creation failed.
  
  If the window is created with the SDL_WINDOW_ALLOW_HIGHDPI flag, its size
  in pixels may differ from its size in screen coordinates on platforms with
  high-DPI support (e.g. iOS and Mac OS X). Use SDL_GetWindowSize() to query
  the client area's size in screen coordinates, and SDL_GL_GetDrawableSize(),
  SDL_Vulkan_GetDrawableSize(), or SDL_GetRendererOutputSize() to query the
  drawable size in pixels.
  
  If the window is created with any of the SDL_WINDOW_OPENGL or
  SDL_WINDOW_VULKAN flags, then the corresponding LoadLibrary function
  (SDL_GL_LoadLibrary or SDL_Vulkan_LoadLibrary) is called and the
  corresponding UnloadLibrary function is called by SDL_DestroyWindow().
  
  If SDL_WINDOW_VULKAN is specified and there isn't a working Vulkan driver,
  SDL_CreateWindow() will fail because SDL_Vulkan_LoadLibrary() will fail.
  
  \note On non-Apple devices, SDL requires you to either not link to the
        Vulkan loader or link to a dynamic library version. This limitation
        may be removed in a future version of SDL.
  
  \sa SDL_DestroyWindow()
  \sa SDL_GL_LoadLibrary()
  \sa SDL_Vulkan_LoadLibrary()
proc createWindowFrom(data: pointer): ptr Window {...}{.importc: "SDL_CreateWindowFrom",
    cdecl.}
\brief Create an SDL window from an existing native window.
  
  \param data A pointer to driver-dependent window creation data
  
  \return The created window, or NULL if window creation failed.
  
  \sa SDL_DestroyWindow()
proc getWindowID(window: ptr Window): Uint32 {...}{.importc: "SDL_GetWindowID", cdecl.}
\brief Get the numeric ID of a window, for logging purposes.
proc getWindowFromID(id: Uint32): ptr Window {...}{.importc: "SDL_GetWindowFromID", cdecl.}
\brief Get a window from a stored ID, or NULL if it doesn't exist.
proc getWindowFlags(window: ptr Window): Uint32 {...}{.importc: "SDL_GetWindowFlags", cdecl.}
\brief Get the window flags.
proc setWindowTitle(window: ptr Window; title: cstring) {...}{.
    importc: "SDL_SetWindowTitle", cdecl.}
\brief Set the title of a window, in UTF-8 format.
  
  \sa SDL_GetWindowTitle()
proc getWindowTitle(window: ptr Window): cstring {...}{.importc: "SDL_GetWindowTitle", cdecl.}
\brief Get the title of a window, in UTF-8 format.
  
  \sa SDL_SetWindowTitle()
proc setWindowIcon(window: ptr Window; icon: ptr Surface) {...}{.
    importc: "SDL_SetWindowIcon", cdecl.}
\brief Set the icon for a window.
  
  \param window The window for which the icon should be set.
  \param icon The icon for the window.
proc setWindowData(window: ptr Window; name: cstring; userdata: pointer): pointer {...}{.
    importc: "SDL_SetWindowData", cdecl.}
\brief Associate an arbitrary named pointer with a window.
  
  \param window   The window to associate with the pointer.
  \param name     The name of the pointer.
  \param userdata The associated pointer.
  
  \return The previous value associated with 'name'
  
  \note The name is case-sensitive.
  
  \sa SDL_GetWindowData()
proc getWindowData(window: ptr Window; name: cstring): pointer {...}{.
    importc: "SDL_GetWindowData", cdecl.}
\brief Retrieve the data pointer associated with a window.
  
  \param window   The window to query.
  \param name     The name of the pointer.
  
  \return The value associated with 'name'
  
  \sa SDL_SetWindowData()
proc setWindowPosition(window: ptr Window; x: cint; y: cint) {...}{.
    importc: "SDL_SetWindowPosition", cdecl.}
\brief Set the position of a window.
  
  \param window   The window to reposition.
  \param x        The x coordinate of the window in screen coordinates, or
                  ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
  \param y        The y coordinate of the window in screen coordinates, or
                  ::SDL_WINDOWPOS_CENTERED or ::SDL_WINDOWPOS_UNDEFINED.
  
  \note The window coordinate origin is the upper left of the display.
  
  \sa SDL_GetWindowPosition()
proc getWindowPosition(window: ptr Window; x: ptr cint; y: ptr cint) {...}{.
    importc: "SDL_GetWindowPosition", cdecl.}
\brief Get the position of a window.
  
  \param window   The window to query.
  \param x        Pointer to variable for storing the x position, in screen
                  coordinates. May be NULL.
  \param y        Pointer to variable for storing the y position, in screen
                  coordinates. May be NULL.
  
  \sa SDL_SetWindowPosition()
proc setWindowSize(window: ptr Window; w: cint; h: cint) {...}{.importc: "SDL_SetWindowSize",
    cdecl.}
\brief Set the size of a window's client area.
  
  \param window   The window to resize.
  \param w        The width of the window, in screen coordinates. Must be >0.
  \param h        The height of the window, in screen coordinates. Must be >0.
  
  \note Fullscreen windows automatically match the size of the display mode,
        and you should use SDL_SetWindowDisplayMode() to change their size.
  
  The window size in screen coordinates may differ from the size in pixels, if
  the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
  high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
  SDL_GetRendererOutputSize() to get the real client area size in pixels.
  
  \sa SDL_GetWindowSize()
  \sa SDL_SetWindowDisplayMode()
proc getWindowSize(window: ptr Window; w: ptr cint; h: ptr cint) {...}{.
    importc: "SDL_GetWindowSize", cdecl.}
\brief Get the size of a window's client area.
  
  \param window   The window to query.
  \param w        Pointer to variable for storing the width, in screen
                  coordinates. May be NULL.
  \param h        Pointer to variable for storing the height, in screen
                  coordinates. May be NULL.
  
  The window size in screen coordinates may differ from the size in pixels, if
  the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a platform with
  high-dpi support (e.g. iOS or OS X). Use SDL_GL_GetDrawableSize() or
  SDL_GetRendererOutputSize() to get the real client area size in pixels.
  
  \sa SDL_SetWindowSize()
proc getWindowBordersSize(window: ptr Window; top: ptr cint; left: ptr cint;
                         bottom: ptr cint; right: ptr cint): cint {...}{.
    importc: "SDL_GetWindowBordersSize", cdecl.}
\brief Get the size of a window's borders (decorations) around the client area.
  
  \param window The window to query.
  \param top Pointer to variable for storing the size of the top border. NULL is permitted.
  \param left Pointer to variable for storing the size of the left border. NULL is permitted.
  \param bottom Pointer to variable for storing the size of the bottom border. NULL is permitted.
  \param right Pointer to variable for storing the size of the right border. NULL is permitted.
  
  \return 0 on success, or -1 if getting this information is not supported.
  
  \note if this function fails (returns -1), the size values will be
        initialized to 0, 0, 0, 0 (if a non-NULL pointer is provided), as
        if the window in question was borderless.
proc setWindowMinimumSize(window: ptr Window; minW: cint; minH: cint) {...}{.
    importc: "SDL_SetWindowMinimumSize", cdecl.}
\brief Set the minimum size of a window's client area.
  
  \param window    The window to set a new minimum size.
  \param min_w     The minimum width of the window, must be >0
  \param min_h     The minimum height of the window, must be >0
  
  \note You can't change the minimum size of a fullscreen window, it
        automatically matches the size of the display mode.
  
  \sa SDL_GetWindowMinimumSize()
  \sa SDL_SetWindowMaximumSize()
proc getWindowMinimumSize(window: ptr Window; w: ptr cint; h: ptr cint) {...}{.
    importc: "SDL_GetWindowMinimumSize", cdecl.}
\brief Get the minimum size of a window's client area.
  
  \param window   The window to query.
  \param w        Pointer to variable for storing the minimum width, may be NULL
  \param h        Pointer to variable for storing the minimum height, may be NULL
  
  \sa SDL_GetWindowMaximumSize()
  \sa SDL_SetWindowMinimumSize()
proc setWindowMaximumSize(window: ptr Window; maxW: cint; maxH: cint) {...}{.
    importc: "SDL_SetWindowMaximumSize", cdecl.}
\brief Set the maximum size of a window's client area.
  
  \param window    The window to set a new maximum size.
  \param max_w     The maximum width of the window, must be >0
  \param max_h     The maximum height of the window, must be >0
  
  \note You can't change the maximum size of a fullscreen window, it
        automatically matches the size of the display mode.
  
  \sa SDL_GetWindowMaximumSize()
  \sa SDL_SetWindowMinimumSize()
proc getWindowMaximumSize(window: ptr Window; w: ptr cint; h: ptr cint) {...}{.
    importc: "SDL_GetWindowMaximumSize", cdecl.}
\brief Get the maximum size of a window's client area.
  
  \param window   The window to query.
  \param w        Pointer to variable for storing the maximum width, may be NULL
  \param h        Pointer to variable for storing the maximum height, may be NULL
  
  \sa SDL_GetWindowMinimumSize()
  \sa SDL_SetWindowMaximumSize()
proc setWindowBordered(window: ptr Window; bordered: bool) {...}{.
    importc: "SDL_SetWindowBordered", cdecl.}
\brief Set the border state of a window.
  
  This will add or remove the window's SDL_WINDOW_BORDERLESS flag and
  add or remove the border from the actual window. This is a no-op if the
  window's border already matches the requested state.
  
  \param window The window of which to change the border state.
  \param bordered SDL_FALSE to remove border, SDL_TRUE to add border.
  
  \note You can't change the border state of a fullscreen window.
  
  \sa SDL_GetWindowFlags()
proc setWindowResizable(window: ptr Window; resizable: bool) {...}{.
    importc: "SDL_SetWindowResizable", cdecl.}
\brief Set the user-resizable state of a window.
  
  This will add or remove the window's SDL_WINDOW_RESIZABLE flag and
  allow/disallow user resizing of the window. This is a no-op if the
  window's resizable state already matches the requested state.
  
  \param window The window of which to change the resizable state.
  \param resizable SDL_TRUE to allow resizing, SDL_FALSE to disallow.
  
  \note You can't change the resizable state of a fullscreen window.
  
  \sa SDL_GetWindowFlags()
proc showWindow(window: ptr Window) {...}{.importc: "SDL_ShowWindow", cdecl.}
\brief Show a window.
  
  \sa SDL_HideWindow()
proc hideWindow(window: ptr Window) {...}{.importc: "SDL_HideWindow", cdecl.}
\brief Hide a window.
  
  \sa SDL_ShowWindow()
proc raiseWindow(window: ptr Window) {...}{.importc: "SDL_RaiseWindow", cdecl.}
\brief Raise a window above other windows and set the input focus.
proc maximizeWindow(window: ptr Window) {...}{.importc: "SDL_MaximizeWindow", cdecl.}
\brief Make a window as large as possible.
  
  \sa SDL_RestoreWindow()
proc minimizeWindow(window: ptr Window) {...}{.importc: "SDL_MinimizeWindow", cdecl.}
\brief Minimize a window to an iconic representation.
  
  \sa SDL_RestoreWindow()
proc restoreWindow(window: ptr Window) {...}{.importc: "SDL_RestoreWindow", cdecl.}
\brief Restore the size and position of a minimized or maximized window.
  
  \sa SDL_MaximizeWindow()
  \sa SDL_MinimizeWindow()
proc setWindowFullscreen(window: ptr Window; flags: Uint32): cint {...}{.
    importc: "SDL_SetWindowFullscreen", cdecl.}
\brief Set a window's fullscreen state.
  
  \return 0 on success, or -1 if setting the display mode failed.
  
  \sa SDL_SetWindowDisplayMode()
  \sa SDL_GetWindowDisplayMode()
proc getWindowSurface(window: ptr Window): ptr Surface {...}{.
    importc: "SDL_GetWindowSurface", cdecl.}
\brief Get the SDL surface associated with the window.
  
  \return The window's framebuffer surface, or NULL on error.
  
  A new surface will be created with the optimal format for the window,
  if necessary. This surface will be freed when the window is destroyed.
  
  \note You may not combine this with 3D or the rendering API on this window.
  
  \sa SDL_UpdateWindowSurface()
  \sa SDL_UpdateWindowSurfaceRects()
proc updateWindowSurface(window: ptr Window): cint {...}{.
    importc: "SDL_UpdateWindowSurface", cdecl.}
\brief Copy the window surface to the screen.
  
  \return 0 on success, or -1 on error.
  
  \sa SDL_GetWindowSurface()
  \sa SDL_UpdateWindowSurfaceRects()
proc updateWindowSurfaceRects(window: ptr Window; rects: ptr Rect; numrects: cint): cint {...}{.
    importc: "SDL_UpdateWindowSurfaceRects", cdecl.}
\brief Copy a number of rectangles on the window surface to the screen.
  
  \return 0 on success, or -1 on error.
  
  \sa SDL_GetWindowSurface()
  \sa SDL_UpdateWindowSurface()
proc setWindowGrab(window: ptr Window; grabbed: bool) {...}{.importc: "SDL_SetWindowGrab",
    cdecl.}
\brief Set a window's input grab mode.
  
  \param window The window for which the input grab mode should be set.
  \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input.
  
  If the caller enables a grab while another window is currently grabbed,
  the other window loses its grab in favor of the caller's window.
  
  \sa SDL_GetWindowGrab()
proc getWindowGrab(window: ptr Window): bool {...}{.importc: "SDL_GetWindowGrab", cdecl.}
\brief Get a window's input grab mode.
  
  \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise.
  
  \sa SDL_SetWindowGrab()
proc getGrabbedWindow(): ptr Window {...}{.importc: "SDL_GetGrabbedWindow", cdecl.}
\brief Get the window that currently has an input grab enabled.
  
  \return This returns the window if input is grabbed, and NULL otherwise.
  
  \sa SDL_SetWindowGrab()
proc setWindowBrightness(window: ptr Window; brightness: cfloat): cint {...}{.
    importc: "SDL_SetWindowBrightness", cdecl.}
\brief Set the brightness (gamma correction) for a window.
  
  \return 0 on success, or -1 if setting the brightness isn't supported.
  
  \sa SDL_GetWindowBrightness()
  \sa SDL_SetWindowGammaRamp()
proc getWindowBrightness(window: ptr Window): cfloat {...}{.
    importc: "SDL_GetWindowBrightness", cdecl.}
\brief Get the brightness (gamma correction) for a window.
  
  \return The last brightness value passed to SDL_SetWindowBrightness()
  
  \sa SDL_SetWindowBrightness()
proc setWindowOpacity(window: ptr Window; opacity: cfloat): cint {...}{.
    importc: "SDL_SetWindowOpacity", cdecl.}
\brief Set the opacity for a window
  
  \param window The window which will be made transparent or opaque
  \param opacity Opacity (0.0f - transparent, 1.0f - opaque) This will be
                 clamped internally between 0.0f and 1.0f.
  
  \return 0 on success, or -1 if setting the opacity isn't supported.
  
  \sa SDL_GetWindowOpacity()
proc getWindowOpacity(window: ptr Window; outOpacity: ptr cfloat): cint {...}{.
    importc: "SDL_GetWindowOpacity", cdecl.}
\brief Get the opacity of a window.
  
  If transparency isn't supported on this platform, opacity will be reported
  as 1.0f without error.
  
  \param window The window in question.
  \param out_opacity Opacity (0.0f - transparent, 1.0f - opaque)
  
  \return 0 on success, or -1 on error (invalid window, etc).
  
  \sa SDL_SetWindowOpacity()
proc setWindowModalFor(modalWindow: ptr Window; parentWindow: ptr Window): cint {...}{.
    importc: "SDL_SetWindowModalFor", cdecl.}
\brief Sets the window as a modal for another window (TODO: reconsider this function and/or its name)
  
  \param modal_window The window that should be modal
  \param parent_window The parent window
  
  \return 0 on success, or -1 otherwise.
proc setWindowInputFocus(window: ptr Window): cint {...}{.
    importc: "SDL_SetWindowInputFocus", cdecl.}
\brief Explicitly sets input focus to the window.
  
  You almost certainly want SDL_RaiseWindow() instead of this function. Use
  this with caution, as you might give focus to a window that's completely
  obscured by other windows.
  
  \param window The window that should get the input focus
  
  \return 0 on success, or -1 otherwise.
  \sa SDL_RaiseWindow()
proc setWindowGammaRamp(window: ptr Window; red: ptr Uint16; green: ptr Uint16;
                       blue: ptr Uint16): cint {...}{.importc: "SDL_SetWindowGammaRamp",
    cdecl.}
\brief Set the gamma ramp for a window.
  
  \param window The window for which the gamma ramp should be set.
  \param red The translation table for the red channel, or NULL.
  \param green The translation table for the green channel, or NULL.
  \param blue The translation table for the blue channel, or NULL.
  
  \return 0 on success, or -1 if gamma ramps are unsupported.
  
  Set the gamma translation table for the red, green, and blue channels
  of the video hardware.  Each table is an array of 256 16-bit quantities,
  representing a mapping between the input and output for that channel.
  The input is the index into the array, and the output is the 16-bit
  gamma value at that index, scaled to the output color precision.
  
  \sa SDL_GetWindowGammaRamp()
proc getWindowGammaRamp(window: ptr Window; red: ptr Uint16; green: ptr Uint16;
                       blue: ptr Uint16): cint {...}{.importc: "SDL_GetWindowGammaRamp",
    cdecl.}
\brief Get the gamma ramp for a window.
  
  \param window The window from which the gamma ramp should be queried.
  \param red   A pointer to a 256 element array of 16-bit quantities to hold
               the translation table for the red channel, or NULL.
  \param green A pointer to a 256 element array of 16-bit quantities to hold
               the translation table for the green channel, or NULL.
  \param blue  A pointer to a 256 element array of 16-bit quantities to hold
               the translation table for the blue channel, or NULL.
  
  \return 0 on success, or -1 if gamma ramps are unsupported.
  
  \sa SDL_SetWindowGammaRamp()
proc setWindowHitTest(window: ptr Window; callback: HitTest; callbackData: pointer): cint {...}{.
    importc: "SDL_SetWindowHitTest", cdecl.}
\brief Provide a callback that decides if a window region has special properties.
  
  Normally windows are dragged and resized by decorations provided by the
  system window manager (a title bar, borders, etc), but for some apps, it
  makes sense to drag them from somewhere else inside the window itself; for
  example, one might have a borderless window that wants to be draggable
  from any part, or simulate its own title bar, etc.
  
  This function lets the app provide a callback that designates pieces of
  a given window as special. This callback is run during event processing
  if we need to tell the OS to treat a region of the window specially; the
  use of this callback is known as "hit testing."
  
  Mouse input may not be delivered to your application if it is within
  a special area; the OS will often apply that input to moving the window or
  resizing the window and not deliver it to the application.
  
  Specifying NULL for a callback disables hit-testing. Hit-testing is
  disabled by default.
  
  Platforms that don't support this functionality will return -1
  unconditionally, even if you're attempting to disable hit-testing.
  
  Your callback may fire at any time, and its firing does not indicate any
  specific behavior (for example, on Windows, this certainly might fire
  when the OS is deciding whether to drag your window, but it fires for lots
  of other reasons, too, some unrelated to anything you probably care about
  _and when the mouse isn't actually at the location it is testing_).
  Since this can fire at any time, you should try to keep your callback
  efficient, devoid of allocations, etc.
  
  \param window The window to set hit-testing on.
  \param callback The callback to call when doing a hit-test.
  \param callback_data An app-defined void pointer passed to the callback.
  \return 0 on success, -1 on error (including unsupported).
proc destroyWindow(window: ptr Window) {...}{.importc: "SDL_DestroyWindow", cdecl.}
\brief Destroy a window.
proc isScreenSaverEnabled(): bool {...}{.importc: "SDL_IsScreenSaverEnabled", cdecl.}
\brief Returns whether the screensaver is currently enabled (default off).
  
  \sa SDL_EnableScreenSaver()
  \sa SDL_DisableScreenSaver()
proc enableScreenSaver() {...}{.importc: "SDL_EnableScreenSaver", cdecl.}
\brief Allow the screen to be blanked by a screensaver
  
  \sa SDL_IsScreenSaverEnabled()
  \sa SDL_DisableScreenSaver()
proc disableScreenSaver() {...}{.importc: "SDL_DisableScreenSaver", cdecl.}
\brief Prevent the screen from being blanked by a screensaver
  
  \sa SDL_IsScreenSaverEnabled()
  \sa SDL_EnableScreenSaver()
proc gL_LoadLibrary(path: cstring): cint {...}{.importc: "SDL_GL_LoadLibrary", cdecl.}
\name OpenGL support functions
@{
\brief Dynamically load an OpenGL library.
  
  \param path The platform dependent OpenGL library name, or NULL to open the
              default OpenGL library.
  
  \return 0 on success, or -1 if the library couldn't be loaded.
  
  This should be done after initializing the video driver, but before
  creating any OpenGL windows.  If no OpenGL library is loaded, the default
  library will be loaded upon creation of the first OpenGL window.
  
  \note If you do this, you need to retrieve all of the GL functions used in
        your program from the dynamic library using SDL_GL_GetProcAddress().
  
  \sa SDL_GL_GetProcAddress()
  \sa SDL_GL_UnloadLibrary()
proc gL_GetProcAddress(`proc`: cstring): pointer {...}{.importc: "SDL_GL_GetProcAddress",
    cdecl.}
\brief Get the address of an OpenGL function.
proc gL_UnloadLibrary() {...}{.importc: "SDL_GL_UnloadLibrary", cdecl.}
\brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary().
  
  \sa SDL_GL_LoadLibrary()
proc gL_ExtensionSupported(extension: cstring): bool {...}{.
    importc: "SDL_GL_ExtensionSupported", cdecl.}
\brief Return true if an OpenGL extension is supported for the current
         context.
proc gL_ResetAttributes() {...}{.importc: "SDL_GL_ResetAttributes", cdecl.}
\brief Reset all previously set OpenGL context attributes to their default values
proc gL_SetAttribute(attr: GLattr; value: cint): cint {...}{.
    importc: "SDL_GL_SetAttribute", cdecl.}
\brief Set an OpenGL window attribute before window creation.
  
  \return 0 on success, or -1 if the attribute could not be set.
proc gL_GetAttribute(attr: GLattr; value: ptr cint): cint {...}{.
    importc: "SDL_GL_GetAttribute", cdecl.}
\brief Get the actual value for an attribute from the current context.
  
  \return 0 on success, or -1 if the attribute could not be retrieved.
          The integer at \c value will be modified in either case.
proc gL_CreateContext(window: ptr Window): GLContext {...}{.
    importc: "SDL_GL_CreateContext", cdecl.}
\brief Create an OpenGL context for use with an OpenGL window, and make it
         current.
  
  \sa SDL_GL_DeleteContext()
proc gL_MakeCurrent(window: ptr Window; context: GLContext): cint {...}{.
    importc: "SDL_GL_MakeCurrent", cdecl.}
\brief Set up an OpenGL context for rendering into an OpenGL window.
  
  \note The context must have been created with a compatible window.
proc gL_GetCurrentWindow(): ptr Window {...}{.importc: "SDL_GL_GetCurrentWindow", cdecl.}
\brief Get the currently active OpenGL window.
proc gL_GetCurrentContext(): GLContext {...}{.importc: "SDL_GL_GetCurrentContext", cdecl.}
\brief Get the currently active OpenGL context.
proc gL_GetDrawableSize(window: ptr Window; w: ptr cint; h: ptr cint) {...}{.
    importc: "SDL_GL_GetDrawableSize", cdecl.}
\brief Get the size of a window's underlying drawable in pixels (for use
         with glViewport).
  
  \param window   Window from which the drawable size should be queried
  \param w        Pointer to variable for storing the width in pixels, may be NULL
  \param h        Pointer to variable for storing the height in pixels, may be NULL
 
 This may differ from SDL_GetWindowSize() if we're rendering to a high-DPI
 drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a
 platform with high-DPI support (Apple calls this "Retina"), and not disabled
 by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint.
  
  \sa SDL_GetWindowSize()
  \sa SDL_CreateWindow()
proc gL_SetSwapInterval(interval: cint): cint {...}{.importc: "SDL_GL_SetSwapInterval",
    cdecl.}
\brief Set the swap interval for the current OpenGL context.
  
  \param interval 0 for immediate updates, 1 for updates synchronized with the
                  vertical retrace. If the system supports it, you may
                  specify -1 to allow late swaps to happen immediately
                  instead of waiting for the next retrace.
  
  \return 0 on success, or -1 if setting the swap interval is not supported.
  
  \sa SDL_GL_GetSwapInterval()
proc gL_GetSwapInterval(): cint {...}{.importc: "SDL_GL_GetSwapInterval", cdecl.}
\brief Get the swap interval for the current OpenGL context.
  
  \return 0 if there is no vertical retrace synchronization, 1 if the buffer
          swap is synchronized with the vertical retrace, and -1 if late
          swaps happen immediately instead of waiting for the next retrace.
          If the system can't determine the swap interval, or there isn't a
          valid current context, this will return 0 as a safe default.
  
  \sa SDL_GL_SetSwapInterval()
proc gL_SwapWindow(window: ptr Window) {...}{.importc: "SDL_GL_SwapWindow", cdecl.}
\brief Swap the OpenGL buffers for a window, if double-buffering is
        supported.
proc gL_DeleteContext(context: GLContext) {...}{.importc: "SDL_GL_DeleteContext", cdecl.}
\brief Delete an OpenGL context.
  
  \sa SDL_GL_CreateContext()
proc getKeyboardFocus(): ptr Window {...}{.importc: "SDL_GetKeyboardFocus", cdecl.}
Function prototypes
\brief Get the window which currently has keyboard focus.
proc getKeyboardState(numkeys: ptr cint): ptr Uint8 {...}{.importc: "SDL_GetKeyboardState",
    cdecl.}
\brief Get a snapshot of the current state of the keyboard.
  
  \param numkeys if non-NULL, receives the length of the returned array.
  
  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
  
  \b Example:
  \code
  const Uint8state = SDL_GetKeyboardState(NULL);
  if ( state[SDL_SCANCODE_RETURN] )   {
      printf("<RETURN> is pressed.\n");
  }
  \endcode
proc getModState(): Keymod {...}{.importc: "SDL_GetModState", cdecl.}
\brief Get the current key modifier state for the keyboard.
proc setModState(modstate: Keymod) {...}{.importc: "SDL_SetModState", cdecl.}
\brief Set the current key modifier state for the keyboard.
  
  \note This does not change the keyboard state, only the key modifier flags.
proc getKeyFromScancode(scancode: Scancode): Keycode {...}{.
    importc: "SDL_GetKeyFromScancode", cdecl.}
\brief Get the key code corresponding to the given scancode according
         to the current keyboard layout.
  
  See ::SDL_Keycode for details.
  
  \sa SDL_GetKeyName()
proc getScancodeFromKey(key: Keycode): Scancode {...}{.importc: "SDL_GetScancodeFromKey",
    cdecl.}
\brief Get the scancode corresponding to the given key code according to the
         current keyboard layout.
  
  See ::SDL_Scancode for details.
  
  \sa SDL_GetScancodeName()
proc getScancodeName(scancode: Scancode): cstring {...}{.importc: "SDL_GetScancodeName",
    cdecl.}
\brief Get a human-readable name for a scancode.
  
  \return A pointer to the name for the scancode.
          If the scancode doesn't have a name, this function returns
          an empty string ("").
  
  \sa SDL_Scancode
proc getScancodeFromName(name: cstring): Scancode {...}{.
    importc: "SDL_GetScancodeFromName", cdecl.}
\brief Get a scancode from a human-readable name
  
  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
  
  \sa SDL_Scancode
proc getKeyName(key: Keycode): cstring {...}{.importc: "SDL_GetKeyName", cdecl.}
\brief Get a human-readable name for a key.
  
  \return A pointer to a UTF-8 string that stays valid at least until the next
          call to this function. If you need it around any longer, you must
          copy it.  If the key doesn't have a name, this function returns an
          empty string ("").
  
  \sa SDL_Keycode
proc getKeyFromName(name: cstring): Keycode {...}{.importc: "SDL_GetKeyFromName", cdecl.}
\brief Get a key code from a human-readable name
  
  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
  
  \sa SDL_Keycode
proc startTextInput() {...}{.importc: "SDL_StartTextInput", cdecl.}
\brief Start accepting Unicode text input events.
         This function will show the on-screen keyboard if supported.
  
  \sa SDL_StopTextInput()
  \sa SDL_SetTextInputRect()
  \sa SDL_HasScreenKeyboardSupport()
proc isTextInputActive(): bool {...}{.importc: "SDL_IsTextInputActive", cdecl.}
\brief Return whether or not Unicode text input events are enabled.
  
  \sa SDL_StartTextInput()
  \sa SDL_StopTextInput()
proc stopTextInput() {...}{.importc: "SDL_StopTextInput", cdecl.}
\brief Stop receiving any text input events.
         This function will hide the on-screen keyboard if supported.
  
  \sa SDL_StartTextInput()
  \sa SDL_HasScreenKeyboardSupport()
proc setTextInputRect(rect: ptr Rect) {...}{.importc: "SDL_SetTextInputRect", cdecl.}
\brief Set the rectangle used to type Unicode text inputs.
         This is used as a hint for IME and on-screen keyboard placement.
  
  \sa SDL_StartTextInput()
proc hasScreenKeyboardSupport(): bool {...}{.importc: "SDL_HasScreenKeyboardSupport",
                                     cdecl.}
\brief Returns whether the platform has some screen keyboard support.
  
  \return SDL_TRUE if some keyboard support is available else SDL_FALSE.
  
  \note Not all screen keyboard functions are supported on all platforms.
  
  \sa SDL_IsScreenKeyboardShown()
proc isScreenKeyboardShown(window: ptr Window): bool {...}{.
    importc: "SDL_IsScreenKeyboardShown", cdecl.}
\brief Returns whether the screen keyboard is shown for given window.
  
  \param window The window for which screen keyboard should be queried.
  
  \return SDL_TRUE if screen keyboard is shown else SDL_FALSE.
  
  \sa SDL_HasScreenKeyboardSupport()
proc getMouseFocus(): ptr Window {...}{.importc: "SDL_GetMouseFocus", cdecl.}
Function prototypes
\brief Get the window which currently has mouse focus.
proc getMouseState(x: ptr cint; y: ptr cint): Uint32 {...}{.importc: "SDL_GetMouseState", cdecl.}
\brief Retrieve the current state of the mouse.
  
  The current button state is returned as a button bitmask, which can
  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
  mouse cursor position relative to the focus window for the currently
  selected mouse.  You can pass NULL for either x or y.
proc getGlobalMouseState(x: ptr cint; y: ptr cint): Uint32 {...}{.
    importc: "SDL_GetGlobalMouseState", cdecl.}
\brief Get the current state of the mouse, in relation to the desktop
  
  This works just like SDL_GetMouseState(), but the coordinates will be
  reported relative to the top-left of the desktop. This can be useful if
  you need to track the mouse outside of a specific window and
  SDL_CaptureMouse() doesn't fit your needs. For example, it could be
  useful if you need to track the mouse while dragging a window, where
  coordinates relative to a window might not be in sync at all times.
  
  \note SDL_GetMouseState() returns the mouse position as SDL understands
        it from the last pump of the event queue. This function, however,
        queries the OS for the current mouse position, and as such, might
        be a slightly less efficient function. Unless you know what you're
        doing and have a good reason to use this function, you probably want
        SDL_GetMouseState() instead.
  
  \param x Returns the current X coord, relative to the desktop. Can be NULL.
  \param y Returns the current Y coord, relative to the desktop. Can be NULL.
  \return The current button state as a bitmask, which can be tested using the SDL_BUTTON(X) macros.
  
  \sa SDL_GetMouseState
proc getRelativeMouseState(x: ptr cint; y: ptr cint): Uint32 {...}{.
    importc: "SDL_GetRelativeMouseState", cdecl.}
\brief Retrieve the relative state of the mouse.
  
  The current button state is returned as a button bitmask, which can
  be tested using the SDL_BUTTON(X) macros, and x and y are set to the
  mouse deltas since the last call to SDL_GetRelativeMouseState().
proc warpMouseInWindow(window: ptr Window; x: cint; y: cint) {...}{.
    importc: "SDL_WarpMouseInWindow", cdecl.}
\brief Moves the mouse to the given position within the window.
  
  \param window The window to move the mouse into, or NULL for the current mouse focus
  \param x The x coordinate within the window
  \param y The y coordinate within the window
  
  \note This function generates a mouse motion event
proc warpMouseGlobal(x: cint; y: cint): cint {...}{.importc: "SDL_WarpMouseGlobal", cdecl.}
\brief Moves the mouse to the given position in global screen space.
  
  \param x The x coordinate
  \param y The y coordinate
  \return 0 on success, -1 on error (usually: unsupported by a platform).
  
  \note This function generates a mouse motion event
proc setRelativeMouseMode(enabled: bool): cint {...}{.
    importc: "SDL_SetRelativeMouseMode", cdecl.}
\brief Set relative mouse mode.
  
  \param enabled Whether or not to enable relative mode
  
  \return 0 on success, or -1 if relative mode is not supported.
  
  While the mouse is in relative mode, the cursor is hidden, and the
  driver will try to report continuous motion in the current window.
  Only relative motion events will be delivered, the mouse position
  will not change.
  
  \note This function will flush any pending mouse motion.
  
  \sa SDL_GetRelativeMouseMode()
proc captureMouse(enabled: bool): cint {...}{.importc: "SDL_CaptureMouse", cdecl.}
\brief Capture the mouse, to track input outside an SDL window.
  
  \param enabled Whether or not to enable capturing
  
  Capturing enables your app to obtain mouse events globally, instead of
  just within your window. Not all video targets support this function.
  When capturing is enabled, the current window will get all mouse events,
  but unlike relative mode, no change is made to the cursor and it is
  not restrained to your window.
  
  This function may also deny mouse input to other windows--both those in
  your application and others on the system--so you should use this
  function sparingly, and in small bursts. For example, you might want to
  track the mouse while the user is dragging something, until the user
  releases a mouse button. It is not recommended that you capture the mouse
  for long periods of time, such as the entire time your app is running.
  
  While captured, mouse events still report coordinates relative to the
  current (foreground) window, but those coordinates may be outside the
  bounds of the window (including negative values). Capturing is only
  allowed for the foreground window. If the window loses focus while
  capturing, the capture will be disabled automatically.
  
  While capturing is enabled, the current window will have the
  SDL_WINDOW_MOUSE_CAPTURE flag set.
  
  \return 0 on success, or -1 if not supported.
proc getRelativeMouseMode(): bool {...}{.importc: "SDL_GetRelativeMouseMode", cdecl.}
\brief Query whether relative mouse mode is enabled.
  
  \sa SDL_SetRelativeMouseMode()
proc createCursor(data: ptr Uint8; mask: ptr Uint8; w: cint; h: cint; hotX: cint; hotY: cint): ptr Cursor {...}{.
    importc: "SDL_CreateCursor", cdecl.}
\brief Create a cursor, using the specified bitmap data and
         mask (in MSB format).
  
  The cursor width must be a multiple of 8 bits.
  
  The cursor is created in black and white according to the following:
  <table>
  <tr><td> data </td><td> mask </td><td> resulting pixel on screen </td></tr>
  <tr><td>  0   </td><td>  1   </td><td> White </td></tr>
  <tr><td>  1   </td><td>  1   </td><td> Black </td></tr>
  <tr><td>  0   </td><td>  0   </td><td> Transparent </td></tr>
  <tr><td>  1   </td><td>  0   </td><td> Inverted color if possible, black
                                         if not. </td></tr>
  </table>
  
  \sa SDL_FreeCursor()
proc createColorCursor(surface: ptr Surface; hotX: cint; hotY: cint): ptr Cursor {...}{.
    importc: "SDL_CreateColorCursor", cdecl.}
\brief Create a color cursor.
  
  \sa SDL_FreeCursor()
proc createSystemCursor(id: SystemCursor): ptr Cursor {...}{.
    importc: "SDL_CreateSystemCursor", cdecl.}
\brief Create a system cursor.
  
  \sa SDL_FreeCursor()
proc setCursor(cursor: ptr Cursor) {...}{.importc: "SDL_SetCursor", cdecl.}
\brief Set the active cursor.
proc getCursor(): ptr Cursor {...}{.importc: "SDL_GetCursor", cdecl.}
\brief Return the active cursor.
proc getDefaultCursor(): ptr Cursor {...}{.importc: "SDL_GetDefaultCursor", cdecl.}
\brief Return the default cursor.
proc freeCursor(cursor: ptr Cursor) {...}{.importc: "SDL_FreeCursor", cdecl.}
\brief Frees a cursor created with SDL_CreateCursor() or similar functions.
  
  \sa SDL_CreateCursor()
  \sa SDL_CreateColorCursor()
  \sa SDL_CreateSystemCursor()
proc showCursor(toggle: cint): cint {...}{.importc: "SDL_ShowCursor", cdecl.}
\brief Toggle whether or not the cursor is shown.
  
  \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current
                state.
  
  \return 1 if the cursor is shown, or 0 if the cursor is hidden.
proc lockJoysticks() {...}{.importc: "SDL_LockJoysticks", cdecl.}
Function prototypes
Locking for multi-threaded access to the joystick API
 
 If you are using the joystick API or handling events from multiple threads
 you should use these locking functions to protect access to the joysticks.
 
 In particular, you are guaranteed that the joystick list won't change, so
 the API functions that take a joystick index will be valid, and joystick
 and game controller events will not be delivered.
proc unlockJoysticks() {...}{.importc: "SDL_UnlockJoysticks", cdecl.}
proc numJoysticks(): cint {...}{.importc: "SDL_NumJoysticks", cdecl.}
Count the number of joysticks attached to the system right now
proc joystickNameForIndex(deviceIndex: cint): cstring {...}{.
    importc: "SDL_JoystickNameForIndex", cdecl.}
Get the implementation dependent name of a joystick.
  This can be called before any joysticks are opened.
  If no name can be found, this function returns NULL.
proc joystickGetDevicePlayerIndex(deviceIndex: cint): cint {...}{.
    importc: "SDL_JoystickGetDevicePlayerIndex", cdecl.}
Get the player index of a joystick, or -1 if it's not available
  This can be called before any joysticks are opened.
proc joystickGetDeviceGUID(deviceIndex: cint): JoystickGUID {...}{.
    importc: "SDL_JoystickGetDeviceGUID", cdecl.}
Return the GUID for the joystick at this index
  This can be called before any joysticks are opened.
proc joystickGetDeviceVendor(deviceIndex: cint): Uint16 {...}{.
    importc: "SDL_JoystickGetDeviceVendor", cdecl.}
Get the USB vendor ID of a joystick, if available.
  This can be called before any joysticks are opened.
  If the vendor ID isn't available this function returns 0.
proc joystickGetDeviceProduct(deviceIndex: cint): Uint16 {...}{.
    importc: "SDL_JoystickGetDeviceProduct", cdecl.}
Get the USB product ID of a joystick, if available.
  This can be called before any joysticks are opened.
  If the product ID isn't available this function returns 0.
proc joystickGetDeviceProductVersion(deviceIndex: cint): Uint16 {...}{.
    importc: "SDL_JoystickGetDeviceProductVersion", cdecl.}
Get the product version of a joystick, if available.
  This can be called before any joysticks are opened.
  If the product version isn't available this function returns 0.
proc joystickGetDeviceType(deviceIndex: cint): JoystickType {...}{.
    importc: "SDL_JoystickGetDeviceType", cdecl.}
Get the type of a joystick, if available.
  This can be called before any joysticks are opened.
proc joystickGetDeviceInstanceID(deviceIndex: cint): JoystickID {...}{.
    importc: "SDL_JoystickGetDeviceInstanceID", cdecl.}
Get the instance ID of a joystick.
  This can be called before any joysticks are opened.
  If the index is out of range, this function will return -1.
proc joystickOpen(deviceIndex: cint): ptr Joystick {...}{.importc: "SDL_JoystickOpen", cdecl.}
Open a joystick for use.
  The index passed as an argument refers to the N'th joystick on the system.
  This index is not the value which will identify this joystick in future
  joystick events.  The joystick's instance id (::SDL_JoystickID) will be used
  there instead.
  
  \return A joystick identifier, or NULL if an error occurred.
proc joystickFromInstanceID(instanceId: JoystickID): ptr Joystick {...}{.
    importc: "SDL_JoystickFromInstanceID", cdecl.}
Return the SDL_Joystick associated with an instance id.
proc joystickFromPlayerIndex(playerIndex: cint): ptr Joystick {...}{.
    importc: "SDL_JoystickFromPlayerIndex", cdecl.}
Return the SDL_Joystick associated with a player index.
proc joystickName(joystick: ptr Joystick): cstring {...}{.importc: "SDL_JoystickName", cdecl.}
Return the name for this currently opened joystick.
  If no name can be found, this function returns NULL.
proc joystickGetPlayerIndex(joystick: ptr Joystick): cint {...}{.
    importc: "SDL_JoystickGetPlayerIndex", cdecl.}
Get the player index of an opened joystick, or -1 if it's not available
  
  For XInput controllers this returns the XInput user index.
proc joystickSetPlayerIndex(joystick: ptr Joystick; playerIndex: cint) {...}{.
    importc: "SDL_JoystickSetPlayerIndex", cdecl.}
Set the player index of an opened joystick
proc joystickGetGUID(joystick: ptr Joystick): JoystickGUID {...}{.
    importc: "SDL_JoystickGetGUID", cdecl.}
Return the GUID for this opened joystick
proc joystickGetVendor(joystick: ptr Joystick): Uint16 {...}{.
    importc: "SDL_JoystickGetVendor", cdecl.}
Get the USB vendor ID of an opened joystick, if available.
  If the vendor ID isn't available this function returns 0.
proc joystickGetProduct(joystick: ptr Joystick): Uint16 {...}{.
    importc: "SDL_JoystickGetProduct", cdecl.}
Get the USB product ID of an opened joystick, if available.
  If the product ID isn't available this function returns 0.
proc joystickGetProductVersion(joystick: ptr Joystick): Uint16 {...}{.
    importc: "SDL_JoystickGetProductVersion", cdecl.}
Get the product version of an opened joystick, if available.
  If the product version isn't available this function returns 0.
proc joystickGetType(joystick: ptr Joystick): JoystickType {...}{.
    importc: "SDL_JoystickGetType", cdecl.}
Get the type of an opened joystick.
proc joystickGetGUIDString(guid: JoystickGUID; pszGUID: cstring; cbGUID: cint) {...}{.
    importc: "SDL_JoystickGetGUIDString", cdecl.}
Return a string representation for this guid. pszGUID must point to at least 33 bytes
  (32 for the string plus a NULL terminator).
proc joystickGetGUIDFromString(pchGUID: cstring): JoystickGUID {...}{.
    importc: "SDL_JoystickGetGUIDFromString", cdecl.}
Convert a string into a joystick guid
proc joystickGetAttached(joystick: ptr Joystick): bool {...}{.
    importc: "SDL_JoystickGetAttached", cdecl.}
Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not.
proc joystickInstanceID(joystick: ptr Joystick): JoystickID {...}{.
    importc: "SDL_JoystickInstanceID", cdecl.}
Get the instance ID of an opened joystick or -1 if the joystick is invalid.
proc joystickNumAxes(joystick: ptr Joystick): cint {...}{.importc: "SDL_JoystickNumAxes",
    cdecl.}
Get the number of general axis controls on a joystick.
proc joystickNumBalls(joystick: ptr Joystick): cint {...}{.
    importc: "SDL_JoystickNumBalls", cdecl.}
Get the number of trackballs on a joystick.
  
  Joystick trackballs have only relative motion events associated
  with them and their state cannot be polled.
proc joystickNumHats(joystick: ptr Joystick): cint {...}{.importc: "SDL_JoystickNumHats",
    cdecl.}
Get the number of POV hats on a joystick.
proc joystickNumButtons(joystick: ptr Joystick): cint {...}{.
    importc: "SDL_JoystickNumButtons", cdecl.}
Get the number of buttons on a joystick.
proc joystickUpdate() {...}{.importc: "SDL_JoystickUpdate", cdecl.}
Update the current state of the open joysticks.
  
  This is called automatically by the event loop if any joystick
  events are enabled.
proc joystickEventState(state: cint): cint {...}{.importc: "SDL_JoystickEventState", cdecl.}
Enable/disable joystick event polling.
  
  If joystick events are disabled, you must call SDL_JoystickUpdate()
  yourself and check the state of the joystick when you want joystick
  information.
  
  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
proc joystickGetAxis(joystick: ptr Joystick; axis: cint): Sint16 {...}{.
    importc: "SDL_JoystickGetAxis", cdecl.}
Get the current state of an axis control on a joystick.
  
  The state is a value ranging from -32768 to 32767.
  
  The axis indices start at index 0.
proc joystickGetAxisInitialState(joystick: ptr Joystick; axis: cint; state: ptr Sint16): bool {...}{.
    importc: "SDL_JoystickGetAxisInitialState", cdecl.}
Get the initial state of an axis control on a joystick.
  
  The state is a value ranging from -32768 to 32767.
  
  The axis indices start at index 0.
  
  \return SDL_TRUE if this axis has any initial value, or SDL_FALSE if not.
proc joystickGetHat(joystick: ptr Joystick; hat: cint): Uint8 {...}{.
    importc: "SDL_JoystickGetHat", cdecl.}
@}
Get the current state of a POV hat on a joystick.
  
  The hat indices start at index 0.
  
  \return The return value is one of the following positions:
           - ::SDL_HAT_CENTERED
           - ::SDL_HAT_UP
           - ::SDL_HAT_RIGHT
           - ::SDL_HAT_DOWN
           - ::SDL_HAT_LEFT
           - ::SDL_HAT_RIGHTUP
           - ::SDL_HAT_RIGHTDOWN
           - ::SDL_HAT_LEFTUP
           - ::SDL_HAT_LEFTDOWN
proc joystickGetBall(joystick: ptr Joystick; ball: cint; dx: ptr cint; dy: ptr cint): cint {...}{.
    importc: "SDL_JoystickGetBall", cdecl.}
Get the ball axis change since the last poll.
  
  \return 0, or -1 if you passed it invalid parameters.
  
  The ball indices start at index 0.
proc joystickGetButton(joystick: ptr Joystick; button: cint): Uint8 {...}{.
    importc: "SDL_JoystickGetButton", cdecl.}
Get the current state of a button on a joystick.
  
  The button indices start at index 0.
proc joystickRumble(joystick: ptr Joystick; lowFrequencyRumble: Uint16;
                   highFrequencyRumble: Uint16; durationMs: Uint32): cint {...}{.
    importc: "SDL_JoystickRumble", cdecl.}
Trigger a rumble effect
  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
  
  \param joystick The joystick to vibrate
  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
  \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
  \param duration_ms The duration of the rumble effect, in milliseconds
  
  \return 0, or -1 if rumble isn't supported on this joystick
proc joystickClose(joystick: ptr Joystick) {...}{.importc: "SDL_JoystickClose", cdecl.}
Close a joystick previously opened with SDL_JoystickOpen().
proc joystickCurrentPowerLevel(joystick: ptr Joystick): JoystickPowerLevel {...}{.
    importc: "SDL_JoystickCurrentPowerLevel", cdecl.}
Return the battery level of this joystick
proc gameControllerAddMappingsFromRW(rw: ptr RWops; freerw: cint): cint {...}{.
    importc: "SDL_GameControllerAddMappingsFromRW", cdecl.}
To count the number of game controllers in the system for the following:
  int nJoysticks = SDL_NumJoysticks();
  int nGameControllers = 0;
  for (int i = 0; i < nJoysticks; i++) {
      if (SDL_IsGameController(i)) {
          nGameControllers++;
      }
  }
  
  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping() you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
  guid,name,mappings
  
  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
  Under Windows there is a reserved GUID of "xinput" that covers any XInput devices.
  The mapping format for joystick is:
      bX - a joystick button, index X
      hX.Y - hat X with value Y
      aX - axis X of the joystick
  Buttons can be used as a controller axis and vice versa.
  
  This string shows an example of a valid mapping for a controller
  "03000000341a00003608000000000000,PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
Load a set of mappings from a seekable SDL data stream (memory or file), filtered by the current SDL_GetPlatform()
  A community sourced database of controllers is available at https:raw.github.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt
  
  If \c freerw is non-zero, the stream will be closed after being read.
 
 \return number of mappings added, -1 on error
proc gameControllerAddMapping(mappingString: cstring): cint {...}{.
    importc: "SDL_GameControllerAddMapping", cdecl.}
Add or update an existing mapping configuration
 
 \return 1 if mapping is added, 0 if updated, -1 on error
proc gameControllerNumMappings(): cint {...}{.importc: "SDL_GameControllerNumMappings",
                                      cdecl.}
Get the number of mappings installed
  
  \return the number of mappings
proc gameControllerMappingForIndex(mappingIndex: cint): cstring {...}{.
    importc: "SDL_GameControllerMappingForIndex", cdecl.}
Get the mapping at a particular index.
  
  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if the index is out of range.
proc gameControllerMappingForGUID(guid: JoystickGUID): cstring {...}{.
    importc: "SDL_GameControllerMappingForGUID", cdecl.}
Get a mapping string for a GUID
  
  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
proc gameControllerMapping(gamecontroller: ptr GameController): cstring {...}{.
    importc: "SDL_GameControllerMapping", cdecl.}
Get a mapping string for an open GameController
  
  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
proc isGameController(joystickIndex: cint): bool {...}{.importc: "SDL_IsGameController",
    cdecl.}
Is the joystick on this index supported by the game controller interface?
proc gameControllerNameForIndex(joystickIndex: cint): cstring {...}{.
    importc: "SDL_GameControllerNameForIndex", cdecl.}
Get the implementation dependent name of a game controller.
  This can be called before any controllers are opened.
  If no name can be found, this function returns NULL.
proc gameControllerTypeForIndex(joystickIndex: cint): GameControllerType {...}{.
    importc: "SDL_GameControllerTypeForIndex", cdecl.}
Get the type of a game controller.
  This can be called before any controllers are opened.
proc gameControllerMappingForDeviceIndex(joystickIndex: cint): cstring {...}{.
    importc: "SDL_GameControllerMappingForDeviceIndex", cdecl.}
Get the mapping of a game controller.
  This can be called before any controllers are opened.
  
  \return the mapping string.  Must be freed with SDL_free().  Returns NULL if no mapping is available
proc gameControllerOpen(joystickIndex: cint): ptr GameController {...}{.
    importc: "SDL_GameControllerOpen", cdecl.}
Open a game controller for use.
  The index passed as an argument refers to the N'th game controller on the system.
  This index is not the value which will identify this controller in future
  controller events.  The joystick's instance id (::SDL_JoystickID) will be
  used there instead.
  
  \return A controller identifier, or NULL if an error occurred.
proc gameControllerFromInstanceID(joyid: JoystickID): ptr GameController {...}{.
    importc: "SDL_GameControllerFromInstanceID", cdecl.}
Return the SDL_GameController associated with an instance id.
proc gameControllerFromPlayerIndex(playerIndex: cint): ptr GameController {...}{.
    importc: "SDL_GameControllerFromPlayerIndex", cdecl.}
Return the SDL_GameController associated with a player index.
proc gameControllerName(gamecontroller: ptr GameController): cstring {...}{.
    importc: "SDL_GameControllerName", cdecl.}
Return the name for this currently opened controller
proc gameControllerGetType(gamecontroller: ptr GameController): GameControllerType {...}{.
    importc: "SDL_GameControllerGetType", cdecl.}
Return the type of this currently opened controller
proc gameControllerGetPlayerIndex(gamecontroller: ptr GameController): cint {...}{.
    importc: "SDL_GameControllerGetPlayerIndex", cdecl.}
Get the player index of an opened game controller, or -1 if it's not available
  
  For XInput controllers this returns the XInput user index.
proc gameControllerSetPlayerIndex(gamecontroller: ptr GameController;
                                 playerIndex: cint) {...}{.
    importc: "SDL_GameControllerSetPlayerIndex", cdecl.}
Set the player index of an opened game controller
proc gameControllerGetVendor(gamecontroller: ptr GameController): Uint16 {...}{.
    importc: "SDL_GameControllerGetVendor", cdecl.}
Get the USB vendor ID of an opened controller, if available.
  If the vendor ID isn't available this function returns 0.
proc gameControllerGetProduct(gamecontroller: ptr GameController): Uint16 {...}{.
    importc: "SDL_GameControllerGetProduct", cdecl.}
Get the USB product ID of an opened controller, if available.
  If the product ID isn't available this function returns 0.
proc gameControllerGetProductVersion(gamecontroller: ptr GameController): Uint16 {...}{.
    importc: "SDL_GameControllerGetProductVersion", cdecl.}
Get the product version of an opened controller, if available.
  If the product version isn't available this function returns 0.
proc gameControllerGetAttached(gamecontroller: ptr GameController): bool {...}{.
    importc: "SDL_GameControllerGetAttached", cdecl.}
Returns SDL_TRUE if the controller has been opened and currently connected,
  or SDL_FALSE if it has not.
proc gameControllerGetJoystick(gamecontroller: ptr GameController): ptr Joystick {...}{.
    importc: "SDL_GameControllerGetJoystick", cdecl.}
Get the underlying joystick object used by a controller
proc gameControllerEventState(state: cint): cint {...}{.
    importc: "SDL_GameControllerEventState", cdecl.}
Enable/disable controller event polling.
  
  If controller events are disabled, you must call SDL_GameControllerUpdate()
  yourself and check the state of the controller when you want controller
  information.
  
  The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE.
proc gameControllerUpdate() {...}{.importc: "SDL_GameControllerUpdate", cdecl.}
Update the current state of the open game controllers.
  
  This is called automatically by the event loop if any game controller
  events are enabled.
proc gameControllerGetAxisFromString(pchString: cstring): GameControllerAxis {...}{.
    importc: "SDL_GameControllerGetAxisFromString", cdecl.}
turn this string into a axis mapping
proc gameControllerGetStringForAxis(axis: GameControllerAxis): cstring {...}{.
    importc: "SDL_GameControllerGetStringForAxis", cdecl.}
turn this axis enum into a string mapping
proc gameControllerGetBindForAxis(gamecontroller: ptr GameController;
                                 axis: GameControllerAxis): GameControllerButtonBind {...}{.
    importc: "SDL_GameControllerGetBindForAxis", cdecl.}
Get the SDL joystick layer binding for this controller button mapping
proc gameControllerGetAxis(gamecontroller: ptr GameController;
                          axis: GameControllerAxis): Sint16 {...}{.
    importc: "SDL_GameControllerGetAxis", cdecl.}
Get the current state of an axis control on a game controller.
  
  The state is a value ranging from -32768 to 32767 (except for the triggers,
  which range from 0 to 32767).
  
  The axis indices start at index 0.
proc gameControllerGetButtonFromString(pchString: cstring): GameControllerButton {...}{.
    importc: "SDL_GameControllerGetButtonFromString", cdecl.}
turn this string into a button mapping
proc gameControllerGetStringForButton(button: GameControllerButton): cstring {...}{.
    importc: "SDL_GameControllerGetStringForButton", cdecl.}
turn this button enum into a string mapping
proc gameControllerGetBindForButton(gamecontroller: ptr GameController;
                                   button: GameControllerButton): GameControllerButtonBind {...}{.
    importc: "SDL_GameControllerGetBindForButton", cdecl.}
Get the SDL joystick layer binding for this controller button mapping
proc gameControllerGetButton(gamecontroller: ptr GameController;
                            button: GameControllerButton): Uint8 {...}{.
    importc: "SDL_GameControllerGetButton", cdecl.}
Get the current state of a button on a game controller.
  
  The button indices start at index 0.
proc gameControllerRumble(gamecontroller: ptr GameController;
                         lowFrequencyRumble: Uint16; highFrequencyRumble: Uint16;
                         durationMs: Uint32): cint {...}{.
    importc: "SDL_GameControllerRumble", cdecl.}
Trigger a rumble effect
  Each call to this function cancels any previous rumble effect, and calling it with 0 intensity stops any rumbling.
  
  \param gamecontroller The controller to vibrate
  \param low_frequency_rumble The intensity of the low frequency (left) rumble motor, from 0 to 0xFFFF
  \param high_frequency_rumble The intensity of the high frequency (right) rumble motor, from 0 to 0xFFFF
  \param duration_ms The duration of the rumble effect, in milliseconds
  
  \return 0, or -1 if rumble isn't supported on this joystick
proc gameControllerClose(gamecontroller: ptr GameController) {...}{.
    importc: "SDL_GameControllerClose", cdecl.}
Close a controller previously opened with SDL_GameControllerOpen().
proc getNumTouchDevices(): cint {...}{.importc: "SDL_GetNumTouchDevices", cdecl.}
Function prototypes
\brief Get the number of registered touch devices.
proc getTouchDevice(index: cint): TouchID {...}{.importc: "SDL_GetTouchDevice", cdecl.}
\brief Get the touch ID with the given index, or 0 if the index is invalid.
proc getTouchDeviceType(touchID: TouchID): TouchDeviceType {...}{.
    importc: "SDL_GetTouchDeviceType", cdecl.}
\brief Get the type of the given touch device.
proc getNumTouchFingers(touchID: TouchID): cint {...}{.importc: "SDL_GetNumTouchFingers",
    cdecl.}
\brief Get the number of active fingers for a given touch device.
proc getTouchFinger(touchID: TouchID; index: cint): ptr Finger {...}{.
    importc: "SDL_GetTouchFinger", cdecl.}
\brief Get the finger object of the given touch, with the given index.
proc recordGesture(touchId: TouchID): cint {...}{.importc: "SDL_RecordGesture", cdecl.}
Function prototypes
\brief Begin Recording a gesture on the specified touch, or all touches (-1)
proc saveAllDollarTemplates(dst: ptr RWops): cint {...}{.
    importc: "SDL_SaveAllDollarTemplates", cdecl.}
\brief Save all currently loaded Dollar Gesture templates
proc saveDollarTemplate(gestureId: GestureID; dst: ptr RWops): cint {...}{.
    importc: "SDL_SaveDollarTemplate", cdecl.}
\brief Save a currently loaded Dollar Gesture template
proc loadDollarTemplates(touchId: TouchID; src: ptr RWops): cint {...}{.
    importc: "SDL_LoadDollarTemplates", cdecl.}
\brief Load Dollar Gesture templates from a file
proc pumpEvents() {...}{.importc: "SDL_PumpEvents", cdecl.}
Function prototypes
Pumps the event loop, gathering events from the input devices.
  
  This function updates the event queue and internal input device state.
  
  This should only be run in the thread that sets the video mode.
proc peepEvents(events: ptr Event; numevents: cint; action: eventaction;
               minType: Uint32; maxType: Uint32): cint {...}{.importc: "SDL_PeepEvents",
    cdecl.}
Checks the event queue for messages and optionally returns them.
  
  If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to
  the back of the event queue.
  
  If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front
  of the event queue, within the specified minimum and maximum type,
  will be returned and will not be removed from the queue.
  
  If \c action is ::SDL_GETEVENT, up to \c numevents events at the front
  of the event queue, within the specified minimum and maximum type,
  will be returned and will be removed from the queue.
  
  \return The number of events actually stored, or -1 if there was an error.
  
  This function is thread-safe.
proc hasEvent(kind: Uint32): bool {...}{.importc: "SDL_HasEvent", cdecl.}
@}
Checks to see if certain event types are in the event queue.
proc hasEvents(minType: Uint32; maxType: Uint32): bool {...}{.importc: "SDL_HasEvents", cdecl.}
proc flushEvent(kind: Uint32) {...}{.importc: "SDL_FlushEvent", cdecl.}
This function clears events from the event queue
  This function only affects currently queued events. If you want to make
  sure that all pending OS events are flushed, you can call SDL_PumpEvents()
  on the main thread immediately before the flush call.
proc flushEvents(minType: Uint32; maxType: Uint32) {...}{.importc: "SDL_FlushEvents", cdecl.}
proc pollEvent(event: ptr Event): cint {...}{.importc: "SDL_PollEvent", cdecl.}
\brief Polls for currently pending events.
  
  \return 1 if there are any pending events, or 0 if there are none available.
  
  \param event If not NULL, the next event is removed from the queue and
               stored in that area.
proc waitEvent(event: ptr Event): cint {...}{.importc: "SDL_WaitEvent", cdecl.}
\brief Waits indefinitely for the next available event.
  
  \return 1, or 0 if there was an error while waiting for events.
  
  \param event If not NULL, the next event is removed from the queue and
               stored in that area.
proc waitEventTimeout(event: ptr Event; timeout: cint): cint {...}{.
    importc: "SDL_WaitEventTimeout", cdecl.}
\brief Waits until the specified timeout (in milliseconds) for the next
         available event.
  
  \return 1, or 0 if there was an error while waiting for events.
  
  \param event If not NULL, the next event is removed from the queue and
               stored in that area.
  \param timeout The timeout (in milliseconds) to wait for next event.
proc pushEvent(event: ptr Event): cint {...}{.importc: "SDL_PushEvent", cdecl.}
\brief Add an event to the event queue.
  
  \return 1 on success, 0 if the event was filtered, or -1 if the event queue
          was full or there was some other error.
proc setEventFilter(filter: EventFilter; userdata: pointer) {...}{.
    importc: "SDL_SetEventFilter", cdecl.}
Sets up a filter to process all events before they change internal state and
  are posted to the internal event queue.
  
  The filter is prototyped as:
  \code
      int SDL_EventFilter(voiduserdata, SDL_Event event);
  \endcode
  
  If the filter returns 1, then the event will be added to the internal queue.
  If it returns 0, then the event will be dropped from the queue, but the
  internal state will still be updated.  This allows selective filtering of
  dynamically arriving events.
  
  \warning  Be very careful of what you do in the event filter function, as
            it may run in a different thread!
  
  There is one caveat when dealing with the ::SDL_QuitEvent event type.  The
  event filter is only called when the window manager desires to close the
  application window.  If the event filter returns 1, then the window will
  be closed, otherwise the window will remain open if possible.
  
  If the quit event is generated by an interrupt signal, it will bypass the
  internal queue and be delivered to the application at the next event poll.
proc getEventFilter(filter: ptr EventFilter; userdata: ptr pointer): bool {...}{.
    importc: "SDL_GetEventFilter", cdecl.}
Return the current event filter - can be used to "chain" filters.
  If there is no event filter set, this function returns SDL_FALSE.
proc addEventWatch(filter: EventFilter; userdata: pointer) {...}{.
    importc: "SDL_AddEventWatch", cdecl.}
Add a function which is called when an event is added to the queue.
proc delEventWatch(filter: EventFilter; userdata: pointer) {...}{.
    importc: "SDL_DelEventWatch", cdecl.}
Remove an event watch function added with SDL_AddEventWatch()
proc filterEvents(filter: EventFilter; userdata: pointer) {...}{.
    importc: "SDL_FilterEvents", cdecl.}
Run the filter function on the current event queue, removing any
  events for which the filter returns 0.
proc eventState(kind: Uint32; state: cint): Uint8 {...}{.importc: "SDL_EventState", cdecl.}
This function allows you to set the state of processing certain events.
   - If \c state is set to ::SDL_IGNORE, that event will be automatically
     dropped from the event queue and will not be filtered.
   - If \c state is set to ::SDL_ENABLE, that event will be processed
     normally.
   - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the
     current processing state of the specified event.
proc registerEvents(numevents: cint): Uint32 {...}{.importc: "SDL_RegisterEvents", cdecl.}
This function allocates a set of user-defined events, and returns
  the beginning event number for that set of events.
  
  If there aren't enough user-defined events left, this function
  returns (Uint32)-1
proc getBasePath(): cstring {...}{.importc: "SDL_GetBasePath", cdecl.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief Get the path where the application resides.
 
 Get the "base path". This is the directory where the application was run
  from, which is probably the installation directory, and may or may not
  be the process's current working directory.
 
 This returns an absolute path in UTF-8 encoding, and is guaranteed to
  end with a path separator ('\\' on Windows, '/' most other places).
 
 The pointer returned by this function is owned by you. Please call
  SDL_free() on the pointer when you are done with it, or it will be a
  memory leak. This is not necessarily a fast call, though, so you should
  call this once near startup and save the string if you need it.
 
 Some platforms can't determine the application's path, and on other
  platforms, this might be meaningless. In such cases, this function will
  return NULL.
  
  \return String of base dir in UTF-8 encoding, or NULL on error.
 
 \sa SDL_GetPrefPath
proc getPrefPath(org: cstring; app: cstring): cstring {...}{.importc: "SDL_GetPrefPath",
    cdecl.}
\brief Get the user-and-app-specific path where files can be written.
 
 Get the "pref dir". This is meant to be where users can write personal
  files (preferences and save games, etc) that are specific to your
  application. This directory is unique per user, per application.
 
 This function will decide the appropriate location in the native filesystem,
  create the directory if necessary, and return a string of the absolute
  path to the directory in UTF-8 encoding.
 
 On Windows, the string might look like:
  "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\"
 
 On Linux, the string might look like:
  "/home/bob/.local/share/My Program Name/"
 
 On Mac OS X, the string might look like:
  "/Users/bob/Library/Application Support/My Program Name/"
 
 (etc.)
 
 You specify the name of your organization (if it's not a real organization,
  your name or an Internet domain you own might do) and the name of your
  application. These should be untranslated proper names.
 
 Both the org and app strings may become part of a directory name, so
  please follow these rules:
    
    - Try to use the same org string (including case-sensitivity) for
      all your applications that use this function.
    - Always use a unique app string for each one, and make sure it never
      changes for an app once you've decided on it.
    - Unicode characters are legal, as long as it's UTF-8 encoded, but...
    - ...only use letters, numbers, and spaces. Avoid punctuation like
      "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient.
 
 This returns an absolute path in UTF-8 encoding, and is guaranteed to
  end with a path separator ('\\' on Windows, '/' most other places).
 
 The pointer returned by this function is owned by you. Please call
  SDL_free() on the pointer when you are done with it, or it will be a
  memory leak. This is not necessarily a fast call, though, so you should
  call this once near startup and save the string if you need it.
 
 You should assume the path returned by this function is the only safe
  place to write files (and that SDL_GetBasePath(), while it might be
  writable, or even the parent of the returned path, aren't where you
  should be writing things).
 
 Some platforms can't determine the pref path, and on other
  platforms, this might be meaningless. In such cases, this function will
  return NULL.
   
   \param org The name of your organization.
   \param app The name of your application.
  \return UTF-8 string of user dir in platform-dependent notation. NULL
          if there's a problem (creating directory failed, etc).
 
 \sa SDL_GetBasePath
proc numHaptics(): cint {...}{.importc: "SDL_NumHaptics", cdecl.}
Function prototypes
\brief Count the number of haptic devices attached to the system.
  
  \return Number of haptic devices detected on the system.
proc hapticName(deviceIndex: cint): cstring {...}{.importc: "SDL_HapticName", cdecl.}
\brief Get the implementation dependent name of a haptic device.
  
  This can be called before any joysticks are opened.
  If no name can be found, this function returns NULL.
  
  \param device_index Index of the device to get its name.
  \return Name of the device or NULL on error.
  
  \sa SDL_NumHaptics
proc hapticOpen(deviceIndex: cint): ptr Haptic {...}{.importc: "SDL_HapticOpen", cdecl.}
\brief Opens a haptic device for use.
  
  The index passed as an argument refers to the N'th haptic device on this
  system.
  
  When opening a haptic device, its gain will be set to maximum and
  autocenter will be disabled.  To modify these values use
  SDL_HapticSetGain() and SDL_HapticSetAutocenter().
  
  \param device_index Index of the device to open.
  \return Device identifier or NULL on error.
  
  \sa SDL_HapticIndex
  \sa SDL_HapticOpenFromMouse
  \sa SDL_HapticOpenFromJoystick
  \sa SDL_HapticClose
  \sa SDL_HapticSetGain
  \sa SDL_HapticSetAutocenter
  \sa SDL_HapticPause
  \sa SDL_HapticStopAll
proc hapticOpened(deviceIndex: cint): cint {...}{.importc: "SDL_HapticOpened", cdecl.}
\brief Checks if the haptic device at index has been opened.
  
  \param device_index Index to check to see if it has been opened.
  \return 1 if it has been opened or 0 if it hasn't.
  
  \sa SDL_HapticOpen
  \sa SDL_HapticIndex
proc hapticIndex(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticIndex", cdecl.}
\brief Gets the index of a haptic device.
  
  \param haptic Haptic device to get the index of.
  \return The index of the haptic device or -1 on error.
  
  \sa SDL_HapticOpen
  \sa SDL_HapticOpened
proc mouseIsHaptic(): cint {...}{.importc: "SDL_MouseIsHaptic", cdecl.}
\brief Gets whether or not the current mouse has haptic capabilities.
  
  \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't.
  
  \sa SDL_HapticOpenFromMouse
proc hapticOpenFromMouse(): ptr Haptic {...}{.importc: "SDL_HapticOpenFromMouse", cdecl.}
\brief Tries to open a haptic device from the current mouse.
  
  \return The haptic device identifier or NULL on error.
  
  \sa SDL_MouseIsHaptic
  \sa SDL_HapticOpen
proc joystickIsHaptic(joystick: ptr Joystick): cint {...}{.
    importc: "SDL_JoystickIsHaptic", cdecl.}
\brief Checks to see if a joystick has haptic features.
  
  \param joystick Joystick to test for haptic capabilities.
  \return SDL_TRUE if the joystick is haptic, SDL_FALSE if it isn't
          or -1 if an error occurred.
  
  \sa SDL_HapticOpenFromJoystick
proc hapticOpenFromJoystick(joystick: ptr Joystick): ptr Haptic {...}{.
    importc: "SDL_HapticOpenFromJoystick", cdecl.}
\brief Opens a haptic device for use from a joystick device.
  
  You must still close the haptic device separately.  It will not be closed
  with the joystick.
  
  When opening from a joystick you should first close the haptic device before
  closing the joystick device.  If not, on some implementations the haptic
  device will also get unallocated and you'll be unable to use force feedback
  on that device.
  
  \param joystick Joystick to create a haptic device from.
  \return A valid haptic device identifier on success or NULL on error.
  
  \sa SDL_HapticOpen
  \sa SDL_HapticClose
proc hapticClose(haptic: ptr Haptic) {...}{.importc: "SDL_HapticClose", cdecl.}
\brief Closes a haptic device previously opened with SDL_HapticOpen().
  
  \param haptic Haptic device to close.
proc hapticNumEffects(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticNumEffects",
    cdecl.}
\brief Returns the number of effects a haptic device can store.
  
  On some platforms this isn't fully supported, and therefore is an
  approximation.  Always check to see if your created effect was actually
  created and do not rely solely on SDL_HapticNumEffects().
  
  \param haptic The haptic device to query effect max.
  \return The number of effects the haptic device can store or
          -1 on error.
  
  \sa SDL_HapticNumEffectsPlaying
  \sa SDL_HapticQuery
proc hapticNumEffectsPlaying(haptic: ptr Haptic): cint {...}{.
    importc: "SDL_HapticNumEffectsPlaying", cdecl.}
\brief Returns the number of effects a haptic device can play at the same
         time.
  
  This is not supported on all platforms, but will always return a value.
  Added here for the sake of completeness.
  
  \param haptic The haptic device to query maximum playing effects.
  \return The number of effects the haptic device can play at the same time
          or -1 on error.
  
  \sa SDL_HapticNumEffects
  \sa SDL_HapticQuery
proc hapticQuery(haptic: ptr Haptic): cuint {...}{.importc: "SDL_HapticQuery", cdecl.}
\brief Gets the haptic device's supported features in bitwise manner.
  
  Example:
  \code
  if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) {
      printf("We have constant haptic effect!\n");
  }
  \endcode
  
  \param haptic The haptic device to query.
  \return Haptic features in bitwise manner (OR'd).
  
  \sa SDL_HapticNumEffects
  \sa SDL_HapticEffectSupported
proc hapticNumAxes(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticNumAxes", cdecl.}
\brief Gets the number of haptic axes the device has.
  
  \sa SDL_HapticDirection
proc hapticEffectSupported(haptic: ptr Haptic; effect: ptr HapticEffect): cint {...}{.
    importc: "SDL_HapticEffectSupported", cdecl.}
\brief Checks to see if effect is supported by haptic.
  
  \param haptic Haptic device to check on.
  \param effect Effect to check to see if it is supported.
  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
  
  \sa SDL_HapticQuery
  \sa SDL_HapticNewEffect
proc hapticNewEffect(haptic: ptr Haptic; effect: ptr HapticEffect): cint {...}{.
    importc: "SDL_HapticNewEffect", cdecl.}
\brief Creates a new haptic effect on the device.
  
  \param haptic Haptic device to create the effect on.
  \param effect Properties of the effect to create.
  \return The identifier of the effect on success or -1 on error.
  
  \sa SDL_HapticUpdateEffect
  \sa SDL_HapticRunEffect
  \sa SDL_HapticDestroyEffect
proc hapticUpdateEffect(haptic: ptr Haptic; effect: cint; data: ptr HapticEffect): cint {...}{.
    importc: "SDL_HapticUpdateEffect", cdecl.}
\brief Updates the properties of an effect.
  
  Can be used dynamically, although behavior when dynamically changing
  direction may be strange.  Specifically the effect may reupload itself
  and start playing from the start.  You cannot change the type either when
  running SDL_HapticUpdateEffect().
  
  \param haptic Haptic device that has the effect.
  \param effect Identifier of the effect to update.
  \param data New effect properties to use.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticNewEffect
  \sa SDL_HapticRunEffect
  \sa SDL_HapticDestroyEffect
proc hapticRunEffect(haptic: ptr Haptic; effect: cint; iterations: Uint32): cint {...}{.
    importc: "SDL_HapticRunEffect", cdecl.}
\brief Runs the haptic effect on its associated haptic device.
  
  If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over
  repeating the envelope (attack and fade) every time.  If you only want the
  effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length
  parameter.
  
  \param haptic Haptic device to run the effect on.
  \param effect Identifier of the haptic effect to run.
  \param iterations Number of iterations to run the effect. Use
         ::SDL_HAPTIC_INFINITY for infinity.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticStopEffect
  \sa SDL_HapticDestroyEffect
  \sa SDL_HapticGetEffectStatus
proc hapticStopEffect(haptic: ptr Haptic; effect: cint): cint {...}{.
    importc: "SDL_HapticStopEffect", cdecl.}
\brief Stops the haptic effect on its associated haptic device.
  
  \param haptic Haptic device to stop the effect on.
  \param effect Identifier of the effect to stop.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticRunEffect
  \sa SDL_HapticDestroyEffect
proc hapticDestroyEffect(haptic: ptr Haptic; effect: cint) {...}{.
    importc: "SDL_HapticDestroyEffect", cdecl.}
\brief Destroys a haptic effect on the device.
  
  This will stop the effect if it's running.  Effects are automatically
  destroyed when the device is closed.
  
  \param haptic Device to destroy the effect on.
  \param effect Identifier of the effect to destroy.
  
  \sa SDL_HapticNewEffect
proc hapticGetEffectStatus(haptic: ptr Haptic; effect: cint): cint {...}{.
    importc: "SDL_HapticGetEffectStatus", cdecl.}
\brief Gets the status of the current effect on the haptic device.
  
  Device must support the ::SDL_HAPTIC_STATUS feature.
  
  \param haptic Haptic device to query the effect status on.
  \param effect Identifier of the effect to query its status.
  \return 0 if it isn't playing, 1 if it is playing or -1 on error.
  
  \sa SDL_HapticRunEffect
  \sa SDL_HapticStopEffect
proc hapticSetGain(haptic: ptr Haptic; gain: cint): cint {...}{.
    importc: "SDL_HapticSetGain", cdecl.}
\brief Sets the global gain of the device.
  
  Device must support the ::SDL_HAPTIC_GAIN feature.
  
  The user may specify the maximum gain by setting the environment variable
  SDL_HAPTIC_GAIN_MAX which should be between 0 and 100.  All calls to
  SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the
  maximum.
  
  \param haptic Haptic device to set the gain on.
  \param gain Value to set the gain to, should be between 0 and 100.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticQuery
proc hapticSetAutocenter(haptic: ptr Haptic; autocenter: cint): cint {...}{.
    importc: "SDL_HapticSetAutocenter", cdecl.}
\brief Sets the global autocenter of the device.
  
  Autocenter should be between 0 and 100.  Setting it to 0 will disable
  autocentering.
  
  Device must support the ::SDL_HAPTIC_AUTOCENTER feature.
  
  \param haptic Haptic device to set autocentering on.
  \param autocenter Value to set autocenter to, 0 disables autocentering.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticQuery
proc hapticPause(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticPause", cdecl.}
\brief Pauses a haptic device.
  
  Device must support the ::SDL_HAPTIC_PAUSE feature.  Call
  SDL_HapticUnpause() to resume playback.
  
  Do not modify the effects nor add new ones while the device is paused.
  That can cause all sorts of weird errors.
  
  \param haptic Haptic device to pause.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticUnpause
proc hapticUnpause(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticUnpause", cdecl.}
\brief Unpauses a haptic device.
  
  Call to unpause after SDL_HapticPause().
  
  \param haptic Haptic device to unpause.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticPause
proc hapticStopAll(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticStopAll", cdecl.}
\brief Stops all the currently playing effects on a haptic device.
  
  \param haptic Haptic device to stop.
  \return 0 on success or -1 on error.
proc hapticRumbleSupported(haptic: ptr Haptic): cint {...}{.
    importc: "SDL_HapticRumbleSupported", cdecl.}
\brief Checks to see if rumble is supported on a haptic device.
  
  \param haptic Haptic device to check to see if it supports rumble.
  \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error.
  
  \sa SDL_HapticRumbleInit
  \sa SDL_HapticRumblePlay
  \sa SDL_HapticRumbleStop
proc hapticRumbleInit(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticRumbleInit",
    cdecl.}
\brief Initializes the haptic device for simple rumble playback.
  
  \param haptic Haptic device to initialize for simple rumble playback.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticOpen
  \sa SDL_HapticRumbleSupported
  \sa SDL_HapticRumblePlay
  \sa SDL_HapticRumbleStop
proc hapticRumblePlay(haptic: ptr Haptic; strength: cfloat; length: Uint32): cint {...}{.
    importc: "SDL_HapticRumblePlay", cdecl.}
\brief Runs simple rumble on a haptic device
  
  \param haptic Haptic device to play rumble effect on.
  \param strength Strength of the rumble to play as a 0-1 float value.
  \param length Length of the rumble to play in milliseconds.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticRumbleSupported
  \sa SDL_HapticRumbleInit
  \sa SDL_HapticRumbleStop
proc hapticRumbleStop(haptic: ptr Haptic): cint {...}{.importc: "SDL_HapticRumbleStop",
    cdecl.}
\brief Stops the simple rumble on a haptic device.
  
  \param haptic Haptic to stop the rumble on.
  \return 0 on success or -1 on error.
  
  \sa SDL_HapticRumbleSupported
  \sa SDL_HapticRumbleInit
  \sa SDL_HapticRumblePlay
proc setHintWithPriority(name: cstring; value: cstring; priority: HintPriority): bool {...}{.
    importc: "SDL_SetHintWithPriority", cdecl.}
\brief Set a hint with a specific priority
  
  The priority controls the behavior when setting a hint that already
  has a value.  Hints will replace existing hints of their priority and
  lower.  Environment variables are considered to have override priority.
  
  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
proc setHint(name: cstring; value: cstring): bool {...}{.importc: "SDL_SetHint", cdecl.}
\brief Set a hint with normal priority
  
  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
proc getHint(name: cstring): cstring {...}{.importc: "SDL_GetHint", cdecl.}
\brief Get a hint
  
  \return The string value of a hint variable.
proc getHintBoolean(name: cstring; defaultValue: bool): bool {...}{.
    importc: "SDL_GetHintBoolean", cdecl.}
\brief Get a hint
  
  \return The boolean value of a hint variable.
proc addHintCallback(name: cstring; callback: HintCallback; userdata: pointer) {...}{.
    importc: "SDL_AddHintCallback", cdecl.}
\brief Add a function to watch a particular hint
  
  \param name The hint to watch
  \param callback The function to call when the hint value changes
  \param userdata A pointer to pass to the callback function
proc delHintCallback(name: cstring; callback: HintCallback; userdata: pointer) {...}{.
    importc: "SDL_DelHintCallback", cdecl.}
\brief Remove a function watching a particular hint
  
  \param name The hint being watched
  \param callback The function being called when the hint value changes
  \param userdata A pointer being passed to the callback function
proc clearHints() {...}{.importc: "SDL_ClearHints", cdecl.}
\brief  Clear all hints
  
  This function is called during SDL_Quit() to free stored hints.
proc loadObject(sofile: cstring): pointer {...}{.importc: "SDL_LoadObject", cdecl.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
This function dynamically loads a shared object and returns a pointer
  to the object handle (or NULL if there was an error).
  The 'sofile' parameter is a system dependent name of the object file.
proc loadFunction(handle: pointer; name: cstring): pointer {...}{.
    importc: "SDL_LoadFunction", cdecl.}
Given an object handle, this function looks up the address of the
  named function in the shared object and returns it.  This address
  is no longer valid after calling SDL_UnloadObject().
proc unloadObject(handle: pointer) {...}{.importc: "SDL_UnloadObject", cdecl.}
Unload a shared object from memory.
proc logSetAllPriority(priority: LogPriority) {...}{.importc: "SDL_LogSetAllPriority",
    cdecl.}
\brief Set the priority of all log categories
proc logSetPriority(category: cint; priority: LogPriority) {...}{.
    importc: "SDL_LogSetPriority", cdecl.}
\brief Set the priority of a particular log category
proc logGetPriority(category: cint): LogPriority {...}{.importc: "SDL_LogGetPriority",
    cdecl.}
\brief Get the priority of a particular log category
proc logResetPriorities() {...}{.importc: "SDL_LogResetPriorities", cdecl.}
\brief Reset all priorities to default.
  
  \note This is called in SDL_Quit().
proc logVerbose(category: cint; fmt: cstring) {...}{.importc: "SDL_LogVerbose", cdecl,
    varargs.}
\brief Log a message with SDL_LOG_PRIORITY_VERBOSE
proc logDebug(category: cint; fmt: cstring) {...}{.importc: "SDL_LogDebug", cdecl, varargs.}
\brief Log a message with SDL_LOG_PRIORITY_DEBUG
proc logInfo(category: cint; fmt: cstring) {...}{.importc: "SDL_LogInfo", cdecl, varargs.}
\brief Log a message with SDL_LOG_PRIORITY_INFO
proc logWarn(category: cint; fmt: cstring) {...}{.importc: "SDL_LogWarn", cdecl, varargs.}
\brief Log a message with SDL_LOG_PRIORITY_WARN
proc logError(category: cint; fmt: cstring) {...}{.importc: "SDL_LogError", cdecl, varargs.}
\brief Log a message with SDL_LOG_PRIORITY_ERROR
proc logCritical(category: cint; fmt: cstring) {...}{.importc: "SDL_LogCritical", cdecl,
    varargs.}
\brief Log a message with SDL_LOG_PRIORITY_CRITICAL
proc logMessage(category: cint; priority: LogPriority; fmt: cstring) {...}{.
    importc: "SDL_LogMessage", cdecl, varargs.}
\brief Log a message with the specified category and priority.
proc logMessageV(category: cint; priority: LogPriority; fmt: cstring; ap: va_list) {...}{.
    importc: "SDL_LogMessageV", cdecl.}
\brief Log a message with the specified category and priority.
proc logGetOutputFunction(callback: ptr LogOutputFunction; userdata: ptr pointer) {...}{.
    importc: "SDL_LogGetOutputFunction", cdecl.}
\brief Get the current log output function.
proc logSetOutputFunction(callback: LogOutputFunction; userdata: pointer) {...}{.
    importc: "SDL_LogSetOutputFunction", cdecl.}
\brief This function allows you to replace the default log output
         function with one of your own.
proc showMessageBox(messageboxdata: ptr MessageBoxData; buttonid: ptr cint): cint {...}{.
    importc: "SDL_ShowMessageBox", cdecl.}
\brief Create a modal message box.
  
  \param messageboxdata The SDL_MessageBoxData structure with title, text, etc.
  \param buttonid The pointer to which user id of hit button should be copied.
  
  \return -1 on error, otherwise 0 and buttonid contains user id of button
          hit or -1 if dialog was closed.
  
  \note This function should be called on the thread that created the parent
        window, or on the main thread if the messagebox has no parent.  It will
        block execution of that thread until the user clicks a button or
        closes the messagebox.
proc showSimpleMessageBox(flags: Uint32; title: cstring; message: cstring;
                         window: ptr Window): cint {...}{.
    importc: "SDL_ShowSimpleMessageBox", cdecl.}
\brief Create a simple modal message box
  
  \param flags    ::SDL_MessageBoxFlags
  \param title    UTF-8 title text
  \param message  UTF-8 message text
  \param window   The parent window, or NULL for no parent
  
  \return 0 on success, -1 on error
  
  \sa SDL_ShowMessageBox
proc metal_CreateView(window: ptr Window): MetalView {...}{.
    importc: "SDL_Metal_CreateView", cdecl.}
\name Metal support functions
@{
\brief Create a CAMetalLayer-backed NSView/UIView and attach it to the
        specified window.
  
  On macOS, this doesnot associate a MTLDevice with the CAMetalLayer on its
  own. It is up to user code to do that.
  
  The returned handle can be casted directly to a NSView or UIView, and the
  CAMetalLayer can be accessed from the view's 'layer' property.
  
  \code
  SDL_MetalView metalview = SDL_Metal_CreateView(window);
  UIViewuiview = (__bridge UIView)metalview;
  CAMetalLayermetallayer = (CAMetalLayer)uiview.layer;
 [...]
  SDL_Metal_DestroyView(metalview);
  \endcode
  
  \sa SDL_Metal_DestroyView
proc metal_DestroyView(view: MetalView) {...}{.importc: "SDL_Metal_DestroyView", cdecl.}
\brief Destroy an existing SDL_MetalView object.
  
  This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was
  called after SDL_CreateWindow.
  
  \sa SDL_Metal_CreateView
proc getPowerInfo(secs: ptr cint; pct: ptr cint): PowerState {...}{.
    importc: "SDL_GetPowerInfo", cdecl.}
\brief Get the current power supply details.
  
  \param secs Seconds of battery life left. You can pass a NULL here if
              you don't care. Will return -1 if we can't determine a
              value, or we're not running on a battery.
  
  \param pct Percentage of battery life left, between 0 and 100. You can
             pass a NULL here if you don't care. Will return -1 if we
             can't determine a value, or we're not running on a battery.
  
  \return The state of the battery (if any).
proc getNumRenderDrivers(): cint {...}{.importc: "SDL_GetNumRenderDrivers", cdecl.}
Function prototypes
\brief Get the number of 2D rendering drivers available for the current
         display.
  
  A render driver is a set of code that handles rendering and texture
  management on a particular display.  Normally there is only one, but
  some drivers may have several available with different capabilities.
  
  \sa SDL_GetRenderDriverInfo()
  \sa SDL_CreateRenderer()
proc getRenderDriverInfo(index: cint; info: ptr RendererInfo): cint {...}{.
    importc: "SDL_GetRenderDriverInfo", cdecl.}
\brief Get information about a specific 2D rendering driver for the current
         display.
  
  \param index The index of the driver to query information about.
  \param info  A pointer to an SDL_RendererInfo struct to be filled with
               information on the rendering driver.
  
  \return 0 on success, -1 if the index was out of range.
  
  \sa SDL_CreateRenderer()
proc createWindowAndRenderer(width: cint; height: cint; windowFlags: Uint32;
                            window: ptr ptr Window; renderer: ptr ptr Renderer): cint {...}{.
    importc: "SDL_CreateWindowAndRenderer", cdecl.}
\brief Create a window and default renderer
  
  \param width    The width of the window
  \param height   The height of the window
  \param window_flags The flags used to create the window
  \param window   A pointer filled with the window, or NULL on error
  \param renderer A pointer filled with the renderer, or NULL on error
  
  \return 0 on success, or -1 on error
proc createRenderer(window: ptr Window; index: cint; flags: Uint32): ptr Renderer {...}{.
    importc: "SDL_CreateRenderer", cdecl.}
\brief Create a 2D rendering context for a window.
  
  \param window The window where rendering is displayed.
  \param index    The index of the rendering driver to initialize, or -1 to
                  initialize the first one supporting the requested flags.
  \param flags    ::SDL_RendererFlags.
  
  \return A valid rendering context or NULL if there was an error.
  
  \sa SDL_CreateSoftwareRenderer()
  \sa SDL_GetRendererInfo()
  \sa SDL_DestroyRenderer()
proc createSoftwareRenderer(surface: ptr Surface): ptr Renderer {...}{.
    importc: "SDL_CreateSoftwareRenderer", cdecl.}
\brief Create a 2D software rendering context for a surface.
  
  \param surface The surface where rendering is done.
  
  \return A valid rendering context or NULL if there was an error.
  
  \sa SDL_CreateRenderer()
  \sa SDL_DestroyRenderer()
proc getRenderer(window: ptr Window): ptr Renderer {...}{.importc: "SDL_GetRenderer", cdecl.}
\brief Get the renderer associated with a window.
proc getRendererInfo(renderer: ptr Renderer; info: ptr RendererInfo): cint {...}{.
    importc: "SDL_GetRendererInfo", cdecl.}
\brief Get information about a rendering context.
proc getRendererOutputSize(renderer: ptr Renderer; w: ptr cint; h: ptr cint): cint {...}{.
    importc: "SDL_GetRendererOutputSize", cdecl.}
\brief Get the output size in pixels of a rendering context.
proc createTexture(renderer: ptr Renderer; format: Uint32; access: cint; w: cint; h: cint): ptr Texture {...}{.
    importc: "SDL_CreateTexture", cdecl.}
\brief Create a texture for a rendering context.
  
  \param renderer The renderer.
  \param format The format of the texture.
  \param access One of the enumerated values in ::SDL_TextureAccess.
  \param w      The width of the texture in pixels.
  \param h      The height of the texture in pixels.
  
  \return The created texture is returned, or NULL if no rendering context was
          active,  the format was unsupported, or the width or height were out
          of range.
  
  \note The contents of the texture are not defined at creation.
  
  \sa SDL_QueryTexture()
  \sa SDL_UpdateTexture()
  \sa SDL_DestroyTexture()
proc createTextureFromSurface(renderer: ptr Renderer; surface: ptr Surface): ptr Texture {...}{.
    importc: "SDL_CreateTextureFromSurface", cdecl.}
\brief Create a texture from an existing surface.
  
  \param renderer The renderer.
  \param surface The surface containing pixel data used to fill the texture.
  
  \return The created texture is returned, or NULL on error.
  
  \note The surface is not modified or freed by this function.
  
  \sa SDL_QueryTexture()
  \sa SDL_DestroyTexture()
proc queryTexture(texture: ptr Texture; format: ptr Uint32; access: ptr cint; w: ptr cint;
                 h: ptr cint): cint {...}{.importc: "SDL_QueryTexture", cdecl.}
\brief Query the attributes of a texture
  
  \param texture A texture to be queried.
  \param format  A pointer filled in with the raw format of the texture.  The
                 actual format may differ, but pixel transfers will use this
                 format.
  \param access  A pointer filled in with the actual access to the texture.
  \param w       A pointer filled in with the width of the texture in pixels.
  \param h       A pointer filled in with the height of the texture in pixels.
  
  \return 0 on success, or -1 if the texture is not valid.
proc setTextureColorMod(texture: ptr Texture; r: Uint8; g: Uint8; b: Uint8): cint {...}{.
    importc: "SDL_SetTextureColorMod", cdecl.}
\brief Set an additional color value used in render copy operations.
  
  \param texture The texture to update.
  \param r       The red color value multiplied into copy operations.
  \param g       The green color value multiplied into copy operations.
  \param b       The blue color value multiplied into copy operations.
  
  \return 0 on success, or -1 if the texture is not valid or color modulation
          is not supported.
  
  \sa SDL_GetTextureColorMod()
proc getTextureColorMod(texture: ptr Texture; r: ptr Uint8; g: ptr Uint8; b: ptr Uint8): cint {...}{.
    importc: "SDL_GetTextureColorMod", cdecl.}
\brief Get the additional color value used in render copy operations.
  
  \param texture The texture to query.
  \param r         A pointer filled in with the current red color value.
  \param g         A pointer filled in with the current green color value.
  \param b         A pointer filled in with the current blue color value.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \sa SDL_SetTextureColorMod()
proc setTextureAlphaMod(texture: ptr Texture; alpha: Uint8): cint {...}{.
    importc: "SDL_SetTextureAlphaMod", cdecl.}
\brief Set an additional alpha value used in render copy operations.
  
  \param texture The texture to update.
  \param alpha     The alpha value multiplied into copy operations.
  
  \return 0 on success, or -1 if the texture is not valid or alpha modulation
          is not supported.
  
  \sa SDL_GetTextureAlphaMod()
proc getTextureAlphaMod(texture: ptr Texture; alpha: ptr Uint8): cint {...}{.
    importc: "SDL_GetTextureAlphaMod", cdecl.}
\brief Get the additional alpha value used in render copy operations.
  
  \param texture The texture to query.
  \param alpha     A pointer filled in with the current alpha value.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \sa SDL_SetTextureAlphaMod()
proc setTextureBlendMode(texture: ptr Texture; blendMode: BlendMode): cint {...}{.
    importc: "SDL_SetTextureBlendMode", cdecl.}
\brief Set the blend mode used for texture copy operations.
  
  \param texture The texture to update.
  \param blendMode ::SDL_BlendMode to use for texture blending.
  
  \return 0 on success, or -1 if the texture is not valid or the blend mode is
          not supported.
  
  \note If the blend mode is not supported, the closest supported mode is
        chosen.
  
  \sa SDL_GetTextureBlendMode()
proc getTextureBlendMode(texture: ptr Texture; blendMode: ptr BlendMode): cint {...}{.
    importc: "SDL_GetTextureBlendMode", cdecl.}
\brief Get the blend mode used for texture copy operations.
  
  \param texture   The texture to query.
  \param blendMode A pointer filled in with the current blend mode.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \sa SDL_SetTextureBlendMode()
proc setTextureScaleMode(texture: ptr Texture; scaleMode: ScaleMode): cint {...}{.
    importc: "SDL_SetTextureScaleMode", cdecl.}
\brief Set the scale mode used for texture scale operations.
  
  \param texture The texture to update.
  \param scaleMode ::SDL_ScaleMode to use for texture scaling.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \note If the scale mode is not supported, the closest supported mode is
        chosen.
  
  \sa SDL_GetTextureScaleMode()
proc getTextureScaleMode(texture: ptr Texture; scaleMode: ptr ScaleMode): cint {...}{.
    importc: "SDL_GetTextureScaleMode", cdecl.}
\brief Get the scale mode used for texture scale operations.
  
  \param texture   The texture to query.
  \param scaleMode A pointer filled in with the current scale mode.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \sa SDL_SetTextureScaleMode()
proc updateTexture(texture: ptr Texture; rect: ptr Rect; pixels: pointer; pitch: cint): cint {...}{.
    importc: "SDL_UpdateTexture", cdecl.}
\brief Update the given texture rectangle with new pixel data.
  
  \param texture   The texture to update
  \param rect      A pointer to the rectangle of pixels to update, or NULL to
                   update the entire texture.
  \param pixels    The raw pixel data in the format of the texture.
  \param pitch     The number of bytes in a row of pixel data, including padding between lines.
  
  The pixel data must be in the format of the texture. The pixel format can be
  queried with SDL_QueryTexture.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \note This is a fairly slow function.
proc updateYUVTexture(texture: ptr Texture; rect: ptr Rect; Yplane: ptr Uint8;
                     Ypitch: cint; Uplane: ptr Uint8; Upitch: cint; Vplane: ptr Uint8;
                     Vpitch: cint): cint {...}{.importc: "SDL_UpdateYUVTexture", cdecl.}
\brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
  
  \param texture   The texture to update
  \param rect      A pointer to the rectangle of pixels to update, or NULL to
                   update the entire texture.
  \param Yplane    The raw pixel data for the Y plane.
  \param Ypitch    The number of bytes between rows of pixel data for the Y plane.
  \param Uplane    The raw pixel data for the U plane.
  \param Upitch    The number of bytes between rows of pixel data for the U plane.
  \param Vplane    The raw pixel data for the V plane.
  \param Vpitch    The number of bytes between rows of pixel data for the V plane.
  
  \return 0 on success, or -1 if the texture is not valid.
  
  \note You can use SDL_UpdateTexture() as long as your pixel data is
        a contiguous block of Y and U/V planes in the proper order, but
        this function is available if your pixel data is not contiguous.
proc lockTexture(texture: ptr Texture; rect: ptr Rect; pixels: ptr pointer;
                pitch: ptr cint): cint {...}{.importc: "SDL_LockTexture", cdecl.}
\brief Lock a portion of the texture for write-only pixel access.
  
  \param texture   The texture to lock for access, which was created with
                   ::SDL_TEXTUREACCESS_STREAMING.
  \param rect      A pointer to the rectangle to lock for access. If the rect
                   is NULL, the entire texture will be locked.
  \param pixels    This is filled in with a pointer to the locked pixels,
                   appropriately offset by the locked area.
  \param pitch     This is filled in with the pitch of the locked pixels.
  
  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
  
  \sa SDL_UnlockTexture()
proc lockTextureToSurface(texture: ptr Texture; rect: ptr Rect;
                         surface: ptr ptr Surface): cint {...}{.
    importc: "SDL_LockTextureToSurface", cdecl.}
\brief Lock a portion of the texture for write-only pixel access.
         Expose it as a SDL surface.
  
  \param texture   The texture to lock for access, which was created with
                   ::SDL_TEXTUREACCESS_STREAMING.
  \param rect      A pointer to the rectangle to lock for access. If the rect
                   is NULL, the entire texture will be locked.
  \param surface   This is filled in with a SDL surface representing the locked area
                   Surface is freed internally after calling SDL_UnlockTexture or SDL_DestroyTexture.
  
  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
  
  \sa SDL_UnlockTexture()
proc unlockTexture(texture: ptr Texture) {...}{.importc: "SDL_UnlockTexture", cdecl.}
\brief Unlock a texture, uploading the changes to video memory, if needed.
         If SDL_LockTextureToSurface() was called for locking, the SDL surface is freed.
  
  \sa SDL_LockTexture()
  \sa SDL_LockTextureToSurface()
proc renderTargetSupported(renderer: ptr Renderer): bool {...}{.
    importc: "SDL_RenderTargetSupported", cdecl.}
\brief Determines whether a window supports the use of render targets
 
 \param renderer The renderer that will be checked
 
 \return SDL_TRUE if supported, SDL_FALSE if not.
proc setRenderTarget(renderer: ptr Renderer; texture: ptr Texture): cint {...}{.
    importc: "SDL_SetRenderTarget", cdecl.}
\brief Set a texture as the current rendering target.
 
 \param renderer The renderer.
 \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
 
 \return 0 on success, or -1 on error
  
  \sa SDL_GetRenderTarget()
proc getRenderTarget(renderer: ptr Renderer): ptr Texture {...}{.
    importc: "SDL_GetRenderTarget", cdecl.}
\brief Get the current render target or NULL for the default render target.
 
 \return The current render target
  
  \sa SDL_SetRenderTarget()
proc renderSetLogicalSize(renderer: ptr Renderer; w: cint; h: cint): cint {...}{.
    importc: "SDL_RenderSetLogicalSize", cdecl.}
\brief Set device independent resolution for rendering
  
  \param renderer The renderer for which resolution should be set.
  \param w      The width of the logical resolution
  \param h      The height of the logical resolution
  
  This function uses the viewport and scaling functionality to allow a fixed logical
  resolution for rendering, regardless of the actual output resolution.  If the actual
  output resolution doesn't have the same aspect ratio the output rendering will be
  centered within the output display.
  
  If the output display is a window, mouse events in the window will be filtered
  and scaled so they seem to arrive within the logical resolution.
  
  \note If this function results in scaling or subpixel drawing by the
        rendering backend, it will be handled using the appropriate
        quality hints.
  
  \sa SDL_RenderGetLogicalSize()
  \sa SDL_RenderSetScale()
  \sa SDL_RenderSetViewport()
proc renderGetLogicalSize(renderer: ptr Renderer; w: ptr cint; h: ptr cint) {...}{.
    importc: "SDL_RenderGetLogicalSize", cdecl.}
\brief Get device independent resolution for rendering
  
  \param renderer The renderer from which resolution should be queried.
  \param w      A pointer filled with the width of the logical resolution
  \param h      A pointer filled with the height of the logical resolution
  
  \sa SDL_RenderSetLogicalSize()
proc renderSetIntegerScale(renderer: ptr Renderer; enable: bool): cint {...}{.
    importc: "SDL_RenderSetIntegerScale", cdecl.}
\brief Set whether to force integer scales for resolution-independent rendering
  
  \param renderer The renderer for which integer scaling should be set.
  \param enable   Enable or disable integer scaling
  
  This function restricts the logical viewport to integer values - that is, when
  a resolution is between two multiples of a logical size, the viewport size is
  rounded down to the lower multiple.
  
  \sa SDL_RenderSetLogicalSize()
proc renderGetIntegerScale(renderer: ptr Renderer): bool {...}{.
    importc: "SDL_RenderGetIntegerScale", cdecl.}
\brief Get whether integer scales are forced for resolution-independent rendering
  
  \param renderer The renderer from which integer scaling should be queried.
  
  \sa SDL_RenderSetIntegerScale()
proc renderSetViewport(renderer: ptr Renderer; rect: ptr Rect): cint {...}{.
    importc: "SDL_RenderSetViewport", cdecl.}
\brief Set the drawing area for rendering on the current target.
  
  \param renderer The renderer for which the drawing area should be set.
  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
  
  The x,y of the viewport rect represents the origin for rendering.
  
  \return 0 on success, or -1 on error
  
  \note If the window associated with the renderer is resized, the viewport is automatically reset.
  
  \sa SDL_RenderGetViewport()
  \sa SDL_RenderSetLogicalSize()
proc renderGetViewport(renderer: ptr Renderer; rect: ptr Rect) {...}{.
    importc: "SDL_RenderGetViewport", cdecl.}
\brief Get the drawing area for the current target.
  
  \sa SDL_RenderSetViewport()
proc renderSetClipRect(renderer: ptr Renderer; rect: ptr Rect): cint {...}{.
    importc: "SDL_RenderSetClipRect", cdecl.}
\brief Set the clip rectangle for the current target.
  
  \param renderer The renderer for which clip rectangle should be set.
  \param rect   A pointer to the rectangle to set as the clip rectangle,
                relative to the viewport, or NULL to disable clipping.
  
  \return 0 on success, or -1 on error
  
  \sa SDL_RenderGetClipRect()
proc renderGetClipRect(renderer: ptr Renderer; rect: ptr Rect) {...}{.
    importc: "SDL_RenderGetClipRect", cdecl.}
\brief Get the clip rectangle for the current target.
  
  \param renderer The renderer from which clip rectangle should be queried.
  \param rect   A pointer filled in with the current clip rectangle, or
                an empty rectangle if clipping is disabled.
  
  \sa SDL_RenderSetClipRect()
proc renderIsClipEnabled(renderer: ptr Renderer): bool {...}{.
    importc: "SDL_RenderIsClipEnabled", cdecl.}
\brief Get whether clipping is enabled on the given renderer.
  
  \param renderer The renderer from which clip state should be queried.
  
  \sa SDL_RenderGetClipRect()
proc renderSetScale(renderer: ptr Renderer; scaleX: cfloat; scaleY: cfloat): cint {...}{.
    importc: "SDL_RenderSetScale", cdecl.}
\brief Set the drawing scale for rendering on the current target.
  
  \param renderer The renderer for which the drawing scale should be set.
  \param scaleX The horizontal scaling factor
  \param scaleY The vertical scaling factor
  
  The drawing coordinates are scaled by the x/y scaling factors
  before they are used by the renderer.  This allows resolution
  independent drawing with a single coordinate system.
  
  \note If this results in scaling or subpixel drawing by the
        rendering backend, it will be handled using the appropriate
        quality hints.  For best results use integer scaling factors.
  
  \sa SDL_RenderGetScale()
  \sa SDL_RenderSetLogicalSize()
proc renderGetScale(renderer: ptr Renderer; scaleX: ptr cfloat; scaleY: ptr cfloat) {...}{.
    importc: "SDL_RenderGetScale", cdecl.}
\brief Get the drawing scale for the current target.
  
  \param renderer The renderer from which drawing scale should be queried.
  \param scaleX A pointer filled in with the horizontal scaling factor
  \param scaleY A pointer filled in with the vertical scaling factor
  
  \sa SDL_RenderSetScale()
proc setRenderDrawColor(renderer: ptr Renderer; r: Uint8; g: Uint8; b: Uint8; a: Uint8): cint {...}{.
    importc: "SDL_SetRenderDrawColor", cdecl.}
\brief Set the color used for drawing operations (Rect, Line and Clear).
  
  \param renderer The renderer for which drawing color should be set.
  \param r The red value used to draw on the rendering target.
  \param g The green value used to draw on the rendering target.
  \param b The blue value used to draw on the rendering target.
  \param a The alpha value used to draw on the rendering target, usually
           ::SDL_ALPHA_OPAQUE (255).
  
  \return 0 on success, or -1 on error
proc getRenderDrawColor(renderer: ptr Renderer; r: ptr Uint8; g: ptr Uint8; b: ptr Uint8;
                       a: ptr Uint8): cint {...}{.importc: "SDL_GetRenderDrawColor", cdecl.}
\brief Get the color used for drawing operations (Rect, Line and Clear).
  
  \param renderer The renderer from which drawing color should be queried.
  \param r A pointer to the red value used to draw on the rendering target.
  \param g A pointer to the green value used to draw on the rendering target.
  \param b A pointer to the blue value used to draw on the rendering target.
  \param a A pointer to the alpha value used to draw on the rendering target,
           usually ::SDL_ALPHA_OPAQUE (255).
  
  \return 0 on success, or -1 on error
proc setRenderDrawBlendMode(renderer: ptr Renderer; blendMode: BlendMode): cint {...}{.
    importc: "SDL_SetRenderDrawBlendMode", cdecl.}
\brief Set the blend mode used for drawing operations (Fill and Line).
  
  \param renderer The renderer for which blend mode should be set.
  \param blendMode ::SDL_BlendMode to use for blending.
  
  \return 0 on success, or -1 on error
  
  \note If the blend mode is not supported, the closest supported mode is
        chosen.
  
  \sa SDL_GetRenderDrawBlendMode()
proc getRenderDrawBlendMode(renderer: ptr Renderer; blendMode: ptr BlendMode): cint {...}{.
    importc: "SDL_GetRenderDrawBlendMode", cdecl.}
\brief Get the blend mode used for drawing operations.
  
  \param renderer The renderer from which blend mode should be queried.
  \param blendMode A pointer filled in with the current blend mode.
  
  \return 0 on success, or -1 on error
  
  \sa SDL_SetRenderDrawBlendMode()
proc renderClear(renderer: ptr Renderer): cint {...}{.importc: "SDL_RenderClear", cdecl.}
\brief Clear the current rendering target with the drawing color
  
  This function clears the entire rendering target, ignoring the viewport and
  the clip rectangle.
  
  \return 0 on success, or -1 on error
proc renderDrawPoint(renderer: ptr Renderer; x: cint; y: cint): cint {...}{.
    importc: "SDL_RenderDrawPoint", cdecl.}
\brief Draw a point on the current rendering target.
  
  \param renderer The renderer which should draw a point.
  \param x The x coordinate of the point.
  \param y The y coordinate of the point.
  
  \return 0 on success, or -1 on error
proc renderDrawPoints(renderer: ptr Renderer; points: ptr Point; count: cint): cint {...}{.
    importc: "SDL_RenderDrawPoints", cdecl.}
\brief Draw multiple points on the current rendering target.
  
  \param renderer The renderer which should draw multiple points.
  \param points The points to draw
  \param count The number of points to draw
  
  \return 0 on success, or -1 on error
proc renderDrawLine(renderer: ptr Renderer; x1: cint; y1: cint; x2: cint; y2: cint): cint {...}{.
    importc: "SDL_RenderDrawLine", cdecl.}
\brief Draw a line on the current rendering target.
  
  \param renderer The renderer which should draw a line.
  \param x1 The x coordinate of the start point.
  \param y1 The y coordinate of the start point.
  \param x2 The x coordinate of the end point.
  \param y2 The y coordinate of the end point.
  
  \return 0 on success, or -1 on error
proc renderDrawLines(renderer: ptr Renderer; points: ptr Point; count: cint): cint {...}{.
    importc: "SDL_RenderDrawLines", cdecl.}
\brief Draw a series of connected lines on the current rendering target.
  
  \param renderer The renderer which should draw multiple lines.
  \param points The points along the lines
  \param count The number of points, drawing count-1 lines
  
  \return 0 on success, or -1 on error
proc renderDrawRect(renderer: ptr Renderer; rect: ptr Rect): cint {...}{.
    importc: "SDL_RenderDrawRect", cdecl.}
\brief Draw a rectangle on the current rendering target.
  
  \param renderer The renderer which should draw a rectangle.
  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
  
  \return 0 on success, or -1 on error
proc renderDrawRects(renderer: ptr Renderer; rects: ptr Rect; count: cint): cint {...}{.
    importc: "SDL_RenderDrawRects", cdecl.}
\brief Draw some number of rectangles on the current rendering target.
  
  \param renderer The renderer which should draw multiple rectangles.
  \param rects A pointer to an array of destination rectangles.
  \param count The number of rectangles.
  
  \return 0 on success, or -1 on error
proc renderFillRect(renderer: ptr Renderer; rect: ptr Rect): cint {...}{.
    importc: "SDL_RenderFillRect", cdecl.}
\brief Fill a rectangle on the current rendering target with the drawing color.
  
  \param renderer The renderer which should fill a rectangle.
  \param rect A pointer to the destination rectangle, or NULL for the entire
              rendering target.
  
  \return 0 on success, or -1 on error
proc renderFillRects(renderer: ptr Renderer; rects: ptr Rect; count: cint): cint {...}{.
    importc: "SDL_RenderFillRects", cdecl.}
\brief Fill some number of rectangles on the current rendering target with the drawing color.
  
  \param renderer The renderer which should fill multiple rectangles.
  \param rects A pointer to an array of destination rectangles.
  \param count The number of rectangles.
  
  \return 0 on success, or -1 on error
proc renderCopy(renderer: ptr Renderer; texture: ptr Texture; srcrect: ptr Rect;
               dstrect: ptr Rect): cint {...}{.importc: "SDL_RenderCopy", cdecl.}
\brief Copy a portion of the texture to the current rendering target.
  
  \param renderer The renderer which should copy parts of a texture.
  \param texture The source texture.
  \param srcrect   A pointer to the source rectangle, or NULL for the entire
                   texture.
  \param dstrect   A pointer to the destination rectangle, or NULL for the
                   entire rendering target.
  
  \return 0 on success, or -1 on error
proc renderCopyEx(renderer: ptr Renderer; texture: ptr Texture; srcrect: ptr Rect;
                 dstrect: ptr Rect; angle: cdouble; center: ptr Point;
                 flip: RendererFlip): cint {...}{.importc: "SDL_RenderCopyEx", cdecl.}
\brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
  
  \param renderer The renderer which should copy parts of a texture.
  \param texture The source texture.
  \param srcrect   A pointer to the source rectangle, or NULL for the entire
                   texture.
  \param dstrect   A pointer to the destination rectangle, or NULL for the
                   entire rendering target.
  \param angle    An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
  \param center   A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
  \param flip     An SDL_RendererFlip value stating which flipping actions should be performed on the texture
  
  \return 0 on success, or -1 on error
proc renderDrawPointF(renderer: ptr Renderer; x: cfloat; y: cfloat): cint {...}{.
    importc: "SDL_RenderDrawPointF", cdecl.}
\brief Draw a point on the current rendering target.
  
  \param renderer The renderer which should draw a point.
  \param x The x coordinate of the point.
  \param y The y coordinate of the point.
  
  \return 0 on success, or -1 on error
proc renderDrawPointsF(renderer: ptr Renderer; points: ptr FPoint; count: cint): cint {...}{.
    importc: "SDL_RenderDrawPointsF", cdecl.}
\brief Draw multiple points on the current rendering target.
  
  \param renderer The renderer which should draw multiple points.
  \param points The points to draw
  \param count The number of points to draw
  
  \return 0 on success, or -1 on error
proc renderDrawLineF(renderer: ptr Renderer; x1: cfloat; y1: cfloat; x2: cfloat;
                    y2: cfloat): cint {...}{.importc: "SDL_RenderDrawLineF", cdecl.}
\brief Draw a line on the current rendering target.
  
  \param renderer The renderer which should draw a line.
  \param x1 The x coordinate of the start point.
  \param y1 The y coordinate of the start point.
  \param x2 The x coordinate of the end point.
  \param y2 The y coordinate of the end point.
  
  \return 0 on success, or -1 on error
proc renderDrawLinesF(renderer: ptr Renderer; points: ptr FPoint; count: cint): cint {...}{.
    importc: "SDL_RenderDrawLinesF", cdecl.}
\brief Draw a series of connected lines on the current rendering target.
  
  \param renderer The renderer which should draw multiple lines.
  \param points The points along the lines
  \param count The number of points, drawing count-1 lines
  
  \return 0 on success, or -1 on error
proc renderDrawRectF(renderer: ptr Renderer; rect: ptr FRect): cint {...}{.
    importc: "SDL_RenderDrawRectF", cdecl.}
\brief Draw a rectangle on the current rendering target.
  
  \param renderer The renderer which should draw a rectangle.
  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
  
  \return 0 on success, or -1 on error
proc renderDrawRectsF(renderer: ptr Renderer; rects: ptr FRect; count: cint): cint {...}{.
    importc: "SDL_RenderDrawRectsF", cdecl.}
\brief Draw some number of rectangles on the current rendering target.
  
  \param renderer The renderer which should draw multiple rectangles.
  \param rects A pointer to an array of destination rectangles.
  \param count The number of rectangles.
  
  \return 0 on success, or -1 on error
proc renderFillRectF(renderer: ptr Renderer; rect: ptr FRect): cint {...}{.
    importc: "SDL_RenderFillRectF", cdecl.}
\brief Fill a rectangle on the current rendering target with the drawing color.
  
  \param renderer The renderer which should fill a rectangle.
  \param rect A pointer to the destination rectangle, or NULL for the entire
              rendering target.
  
  \return 0 on success, or -1 on error
proc renderFillRectsF(renderer: ptr Renderer; rects: ptr FRect; count: cint): cint {...}{.
    importc: "SDL_RenderFillRectsF", cdecl.}
\brief Fill some number of rectangles on the current rendering target with the drawing color.
  
  \param renderer The renderer which should fill multiple rectangles.
  \param rects A pointer to an array of destination rectangles.
  \param count The number of rectangles.
  
  \return 0 on success, or -1 on error
proc renderCopyF(renderer: ptr Renderer; texture: ptr Texture; srcrect: ptr Rect;
                dstrect: ptr FRect): cint {...}{.importc: "SDL_RenderCopyF", cdecl.}
\brief Copy a portion of the texture to the current rendering target.
  
  \param renderer The renderer which should copy parts of a texture.
  \param texture The source texture.
  \param srcrect   A pointer to the source rectangle, or NULL for the entire
                   texture.
  \param dstrect   A pointer to the destination rectangle, or NULL for the
                   entire rendering target.
  
  \return 0 on success, or -1 on error
proc renderCopyExF(renderer: ptr Renderer; texture: ptr Texture; srcrect: ptr Rect;
                  dstrect: ptr FRect; angle: cdouble; center: ptr FPoint;
                  flip: RendererFlip): cint {...}{.importc: "SDL_RenderCopyExF", cdecl.}
\brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
  
  \param renderer The renderer which should copy parts of a texture.
  \param texture The source texture.
  \param srcrect   A pointer to the source rectangle, or NULL for the entire
                   texture.
  \param dstrect   A pointer to the destination rectangle, or NULL for the
                   entire rendering target.
  \param angle    An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
  \param center   A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
  \param flip     An SDL_RendererFlip value stating which flipping actions should be performed on the texture
  
  \return 0 on success, or -1 on error
proc renderReadPixels(renderer: ptr Renderer; rect: ptr Rect; format: Uint32;
                     pixels: pointer; pitch: cint): cint {...}{.
    importc: "SDL_RenderReadPixels", cdecl.}
\brief Read pixels from the current rendering target.
  
  \param renderer The renderer from which pixels should be read.
  \param rect   A pointer to the rectangle to read, or NULL for the entire
                render target.
  \param format The desired format of the pixel data, or 0 to use the format
                of the rendering target
  \param pixels A pointer to be filled in with the pixel data
  \param pitch  The pitch of the pixels parameter.
  
  \return 0 on success, or -1 if pixel reading is not supported.
  
  \warning This is a very slow operation, and should not be used frequently.
proc renderPresent(renderer: ptr Renderer) {...}{.importc: "SDL_RenderPresent", cdecl.}
\brief Update the screen with rendering performed.
proc destroyTexture(texture: ptr Texture) {...}{.importc: "SDL_DestroyTexture", cdecl.}
\brief Destroy the specified texture.
  
  \sa SDL_CreateTexture()
  \sa SDL_CreateTextureFromSurface()
proc destroyRenderer(renderer: ptr Renderer) {...}{.importc: "SDL_DestroyRenderer", cdecl.}
\brief Destroy the rendering context for a window and free associated
         textures.
  
  \sa SDL_CreateRenderer()
proc renderFlush(renderer: ptr Renderer): cint {...}{.importc: "SDL_RenderFlush", cdecl.}
\brief Force the rendering context to flush any pending commands to the
         underlying rendering API.
  
  You do not need to (and in fact, shouldn't) call this function unless
  you are planning to call into OpenGL/Direct3D/Metal/whatever directly
  in addition to using an SDL_Renderer.
  
  This is for a very-specific case: if you are using SDL's render API,
  you asked for a specific renderer backend (OpenGL, Direct3D, etc),
  you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
  OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
  this applies, you should call SDL_RenderFlush() between calls to SDL's
  render API and the low-level API you're using in cooperation.
  
  In all other cases, you can ignore this function. This is only here to
  get maximum performance out of a specific situation. In all other cases,
  SDL will do the right thing, perhaps at a performance loss.
  
  This function is first available in SDL 2.0.10, and is not needed in
  2.0.9 and earlier, as earlier versions did not queue rendering commands
  at all, instead flushing them to the OS immediately.
proc gL_BindTexture(texture: ptr Texture; texw: ptr cfloat; texh: ptr cfloat): cint {...}{.
    importc: "SDL_GL_BindTexture", cdecl.}
\brief Bind the texture to the current OpenGL/ES/ES2 context for use with
         OpenGL instructions.
  
  \param texture  The SDL texture to bind
  \param texw     A pointer to a float that will be filled with the texture width
  \param texh     A pointer to a float that will be filled with the texture height
  
  \return 0 on success, or -1 if the operation is not supported
proc gL_UnbindTexture(texture: ptr Texture): cint {...}{.importc: "SDL_GL_UnbindTexture",
    cdecl.}
\brief Unbind a texture from the current OpenGL/ES/ES2 context.
  
  \param texture  The SDL texture to unbind
  
  \return 0 on success, or -1 if the operation is not supported
proc renderGetMetalLayer(renderer: ptr Renderer): pointer {...}{.
    importc: "SDL_RenderGetMetalLayer", cdecl.}
\brief Get the CAMetalLayer associated with the given Metal renderer
  
  \param renderer The renderer to query
  
  \return CAMetalLayer on success, or NULL if the renderer isn't a Metal renderer
  
  \sa SDL_RenderGetMetalCommandEncoder()
proc renderGetMetalCommandEncoder(renderer: ptr Renderer): pointer {...}{.
    importc: "SDL_RenderGetMetalCommandEncoder", cdecl.}
\brief Get the Metal command encoder for the current frame
  
  \param renderer The renderer to query
  
  \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer
  
  \sa SDL_RenderGetMetalLayer()
proc numSensors(): cint {...}{.importc: "SDL_NumSensors", cdecl.}
Gyroscope sensor
 
 The gyroscope returns the current rate of rotation in radians per second.
 The rotation is positive in the counter-clockwise direction. That is,
 an observer looking from a positive location on one of the axes would
 see positive rotation on that axis when it appeared to be rotating
 counter-clockwise.
 
 values[0]: Angular speed around the x axis
 values[1]: Angular speed around the y axis
 values[2]: Angular speed around the z axis
 
 For phones held in portrait mode, the axes are defined as follows:
 -X ... +X : left ... right
 -Y ... +Y : bottom ... top
 -Z ... +Z : farther ... closer
 
 The axis data is not changed when the phone is rotated.
 
 \sa SDL_GetDisplayOrientation()
Function prototypes
\brief Count the number of sensors attached to the system right now
proc sensorGetDeviceName(deviceIndex: cint): cstring {...}{.
    importc: "SDL_SensorGetDeviceName", cdecl.}
\brief Get the implementation dependent name of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor name, or NULL if device_index is out of range.
proc sensorGetDeviceType(deviceIndex: cint): SensorType {...}{.
    importc: "SDL_SensorGetDeviceType", cdecl.}
\brief Get the type of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor type, or SDL_SENSOR_INVALID if device_index is out of range.
proc sensorGetDeviceNonPortableType(deviceIndex: cint): cint {...}{.
    importc: "SDL_SensorGetDeviceNonPortableType", cdecl.}
\brief Get the platform dependent type of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor platform dependent type, or -1 if device_index is out of range.
proc sensorGetDeviceInstanceID(deviceIndex: cint): SensorID {...}{.
    importc: "SDL_SensorGetDeviceInstanceID", cdecl.}
\brief Get the instance ID of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor instance ID, or -1 if device_index is out of range.
proc sensorOpen(deviceIndex: cint): ptr Sensor {...}{.importc: "SDL_SensorOpen", cdecl.}
\brief Open a sensor for use.
  
  The index passed as an argument refers to the N'th sensor on the system.
  
  \return A sensor identifier, or NULL if an error occurred.
proc sensorFromInstanceID(instanceId: SensorID): ptr Sensor {...}{.
    importc: "SDL_SensorFromInstanceID", cdecl.}
Return the SDL_Sensor associated with an instance id.
proc sensorGetName(sensor: ptr Sensor): cstring {...}{.importc: "SDL_SensorGetName", cdecl.}
\brief Get the implementation dependent name of a sensor.
  
  \return The sensor name, or NULL if the sensor is NULL.
proc sensorGetType(sensor: ptr Sensor): SensorType {...}{.importc: "SDL_SensorGetType",
    cdecl.}
\brief Get the type of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor type, or SDL_SENSOR_INVALID if the sensor is NULL.
proc sensorGetNonPortableType(sensor: ptr Sensor): cint {...}{.
    importc: "SDL_SensorGetNonPortableType", cdecl.}
\brief Get the platform dependent type of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor platform dependent type, or -1 if the sensor is NULL.
proc sensorGetInstanceID(sensor: ptr Sensor): SensorID {...}{.
    importc: "SDL_SensorGetInstanceID", cdecl.}
\brief Get the instance ID of a sensor.
  
  This can be called before any sensors are opened.
  
  \return The sensor instance ID, or -1 if the sensor is NULL.
proc sensorGetData(sensor: ptr Sensor; data: ptr cfloat; numValues: cint): cint {...}{.
    importc: "SDL_SensorGetData", cdecl.}
Get the current state of an opened sensor.
  
  The number of values and interpretation of the data is sensor dependent.
  
  \param sensor The sensor to query
  \param data A pointer filled with the current sensor state
  \param num_values The number of values to write to data
  
  \return 0 or -1 if an error occurred.
proc sensorClose(sensor: ptr Sensor) {...}{.importc: "SDL_SensorClose", cdecl.}
Close a sensor previously opened with SDL_SensorOpen()
proc sensorUpdate() {...}{.importc: "SDL_SensorUpdate", cdecl.}
Update the current state of the open sensors.
  
  This is called automatically by the event loop if sensor events are enabled.
  
  This needs to be called from the thread that initialized the sensor subsystem.
proc createShapedWindow(title: cstring; x: cuint; y: cuint; w: cuint; h: cuint;
                       flags: Uint32): ptr Window {...}{.
    importc: "SDL_CreateShapedWindow", cdecl.}
\brief Create a window that can be shaped with the specified position, dimensions, and flags.
  
  \param title The title of the window, in UTF-8 encoding.
  \param x     The x position of the window, ::SDL_WINDOWPOS_CENTERED, or
               ::SDL_WINDOWPOS_UNDEFINED.
  \param y     The y position of the window, ::SDL_WINDOWPOS_CENTERED, or
               ::SDL_WINDOWPOS_UNDEFINED.
  \param w     The width of the window.
  \param h     The height of the window.
  \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following:
               ::SDL_WINDOW_OPENGL,     ::SDL_WINDOW_INPUT_GRABBED,
               ::SDL_WINDOW_HIDDEN,     ::SDL_WINDOW_RESIZABLE,
               ::SDL_WINDOW_MAXIMIZED,  ::SDL_WINDOW_MINIMIZED,
       ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset.
  
  \return The window created, or NULL if window creation failed.
  
  \sa SDL_DestroyWindow()
proc isShapedWindow(window: ptr Window): bool {...}{.importc: "SDL_IsShapedWindow", cdecl.}
\brief Return whether the given window is a shaped window.
 
 \param window The window to query for being shaped.
 
 \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL.
 
 \sa SDL_CreateShapedWindow
proc setWindowShape(window: ptr Window; shape: ptr Surface;
                   shapeMode: ptr WindowShapeMode): cint {...}{.
    importc: "SDL_SetWindowShape", cdecl.}
\brief Set the shape and parameters of a shaped window.
 
 \param window The shaped window whose parameters should be set.
 \param shape A surface encoding the desired shape for the window.
 \param shape_mode The parameters to set for the shaped window.
 
 \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW
           if the SDL_Window given does not reference a valid shaped window.
 
 \sa SDL_WindowShapeMode
 \sa SDL_GetShapedWindowMode.
proc getShapedWindowMode(window: ptr Window; shapeMode: ptr WindowShapeMode): cint {...}{.
    importc: "SDL_GetShapedWindowMode", cdecl.}
\brief Get the shape parameters of a shaped window.
 
 \param window The shaped window whose parameters should be retrieved.
 \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
 
 \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
           data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if
           the SDL_Window given is a shapeable window currently lacking a shape.
 
 \sa SDL_WindowShapeMode
 \sa SDL_SetWindowShape
proc isTablet(): bool {...}{.importc: "SDL_IsTablet", cdecl.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
Platform specific functions for Windows
Platform specific functions for Linux
Platform specific functions for iOS
Platform specific functions for Android
Platform specific functions for WinRT
\brief Return true if the current device is a tablet.
proc onApplicationWillTerminate() {...}{.importc: "SDL_OnApplicationWillTerminate", cdecl.}
Functions used by iOS application delegates to notify SDL about state changes
proc onApplicationDidReceiveMemoryWarning() {...}{.
    importc: "SDL_OnApplicationDidReceiveMemoryWarning", cdecl.}
proc onApplicationWillResignActive() {...}{.importc: "SDL_OnApplicationWillResignActive",
                                     cdecl.}
proc onApplicationDidEnterBackground() {...}{.importc: "SDL_OnApplicationDidEnterBackground",
                                       cdecl.}
proc onApplicationWillEnterForeground() {...}{.importc: "SDL_OnApplicationWillEnterForeground",
                                        cdecl.}
proc onApplicationDidBecomeActive() {...}{.importc: "SDL_OnApplicationDidBecomeActive",
                                    cdecl.}
proc getTicks(): Uint32 {...}{.importc: "SDL_GetTicks", cdecl.}
Some compilers use a special export keyword
By default SDL uses the C calling convention
Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC
Force structure packing at 4 byte alignment.
   This is necessary if the header is included in code which has structure
   packing set to an alternate value, say for loading structures from disk.
   The packing is reset to the previous value in close_code.h
Apparently this is needed by several Windows compilers
Set up for C function definitions, even when using C++
\brief Get the number of milliseconds since the SDL library initialization.
 
 \note This value wraps if the program runs for more than ~49 days.
proc getPerformanceCounter(): Uint64 {...}{.importc: "SDL_GetPerformanceCounter", cdecl.}
\brief Get the current value of the high resolution counter
proc getPerformanceFrequency(): Uint64 {...}{.importc: "SDL_GetPerformanceFrequency",
                                      cdecl.}
\brief Get the count per second of the high resolution counter
proc delay(ms: Uint32) {...}{.importc: "SDL_Delay", cdecl.}
\brief Wait a specified number of milliseconds before returning.
proc addTimer(interval: Uint32; callback: TimerCallback; param: pointer): TimerID {...}{.
    importc: "SDL_AddTimer", cdecl.}
\brief Add a new timer to the pool of timers already running.
 
 \return A timer ID, or 0 when an error occurs.
proc removeTimer(id: TimerID): bool {...}{.importc: "SDL_RemoveTimer", cdecl.}
\brief Remove a timer knowing its ID.
 
 \return A boolean value indicating success or failure.
 
 \warning It is not safe to remove a timer multiple times.
proc getVersion(ver: ptr Version) {...}{.importc: "SDL_GetVersion", cdecl.}
\brief Get the version of SDL that is linked against your program.
  
  If you are linking to SDL dynamically, then it is possible that the
  current version will be different than the version you compiled against.
  This function returns the current version, while SDL_VERSION() is a
  macro that tells you what version you compiled with.
  
  \code
  SDL_version compiled;
  SDL_version linked;
  
  SDL_VERSION(&compiled);
  SDL_GetVersion(&linked);
  printf("We compiled against SDL version %d.%d.%d ...\n",
         compiled.major, compiled.minor, compiled.patch);
  printf("But we linked against SDL version %d.%d.%d.\n",
         linked.major, linked.minor, linked.patch);
  \endcode
  
  This function may be called safely at any time, even before SDL_Init().
  
  \sa SDL_VERSION
proc getRevision(): cstring {...}{.importc: "SDL_GetRevision", cdecl.}
\brief Get the code revision of SDL that is linked against your program.
  
  Returns an arbitrary string (a hash value) uniquely identifying the
  exact revision of the SDL library in use, and is only useful in comparing
  against other revisions. It is NOT an incrementing number.
proc getRevisionNumber(): cint {...}{.importc: "SDL_GetRevisionNumber", cdecl.}
\brief Get the revision number of SDL that is linked against your program.
  
  Returns a number uniquely identifying the exact revision of the SDL
  library in use. It is an incrementing number based on commits to
  hg.libsdl.org.
proc init(flags: Uint32): cint {...}{.importc: "SDL_Init", cdecl.}
@}
This function initializes  the subsystems specified by \c flags
proc initSubSystem(flags: Uint32): cint {...}{.importc: "SDL_InitSubSystem", cdecl.}
This function initializes specific SDL subsystems
  
  Subsystem initialization is ref-counted, you must call
  SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly
  shutdown a subsystem manually (or call SDL_Quit() to force shutdown).
  If a subsystem is already loaded then this call will
  increase the ref-count and return.
proc quitSubSystem(flags: Uint32) {...}{.importc: "SDL_QuitSubSystem", cdecl.}
This function cleans up specific SDL subsystems
proc wasInit(flags: Uint32): Uint32 {...}{.importc: "SDL_WasInit", cdecl.}
This function returns a mask of the specified subsystems which have
  previously been initialized.
  
  If \c flags is 0, it returns a mask of all initialized subsystems.
proc quit() {...}{.importc: "SDL_Quit", cdecl.}
This function cleans up all initialized subsystems. You should
  call it upon all exit conditions.

Templates

template sdl_button(x: untyped): untyped
template WINDOWPOS_UNDEFINED_DISPLAY(x: untyped): untyped
template WINDOWPOS_ISUNDEFINED(x: untyped): untyped
template WINDOWPOS_CENTERED_DISPLAY(x: untyped): untyped
template WINDOWPOS_ISCENTERED(x: untyped): untyped