sdl2_gpu

    Dark Mode
Search:
Group by:

Types

ComparisonEnum = distinct cint
BlendFuncEnum = distinct cint
BlendEqEnum = distinct cint
BlendPresetEnum = distinct cint
FilterEnum = distinct cint
SnapEnum = distinct cint
WrapEnum = distinct cint
FormatEnum = distinct cint
FileFormatEnum = distinct cint
ShaderEnum = distinct cint
ShaderLanguageEnum = distinct cint
ErrorEnum = distinct cint
DebugLevelEnum = distinct cint
LogLevelEnum = enum
  LOG_LEVEL_INFO = 0, LOG_LEVEL_WARNING, LOG_LEVEL_ERROR
WindowFlagEnum = WindowFlags
Renderer {...}{.bycopy.} = object
  id*: RendererID
  requestedId*: RendererID
  sdlInitFlags*: WindowFlagEnum
  gpuInitFlags*: InitFlagEnum
  shaderLanguage*: ShaderLanguageEnum
  minShaderVersion*: cint
  maxShaderVersion*: cint
  enabledFeatures*: FeatureEnum ## ::
                              ##   ! Current display target
  currentContextTarget*: ptr Target ## ::
                                 ##   ! 0 for inverted, 1 for mathematical
  coordinateMode*: Bool        ## ::
                      ##   ! Default is (0.5, 0.5) - images draw centered.
  defaultImageAnchorX*: cfloat
  defaultImageAnchorY*: cfloat
  impl*: ptr RendererImpl
! \ingroup Initialization
  @{
Target {...}{.bycopy.} = object
  renderer*: ptr Renderer
  contextTarget*: ptr Target
  image*: ptr Image
  data*: pointer
  w*: Uint16
  h*: Uint16
  usingVirtualResolution*: Bool
  baseW*: Uint16               ## ::
               ##   The true dimensions of the underlying image or window
  baseH*: Uint16               ## ::
               ##   The true dimensions of the underlying image or window
  useClipRect*: Bool
  clipRect*: Rect
  useColor*: Bool
  color*: Color
  viewport*: Rect              ## ::
                ##   ! Perspective and object viewing transforms.
  matrixMode*: cint
  projectionMatrix*: MatrixStack
  viewMatrix*: MatrixStack
  modelMatrix*: MatrixStack
  camera*: Camera
  useCamera*: Bool
  useDepthTest*: Bool
  useDepthWrite*: Bool
  depthFunction*: ComparisonEnum ## ::
                               ##   ! Renderer context data.  NULL if the target does not represent a window or rendering context.
  context*: ptr Context
  refcount*: cint
  isAlias*: Bool
! \ingroup Initialization
 Important GPU features which may not be supported depending on a device's extension support.  Can be bitwise OR'd together.
 \see GPU_IsFeatureEnabled()
 \see GPU_SetRequiredFeatures()
Rect {...}{.bycopy.} = object
  x*: cfloat
  y*: cfloat
  w*: cfloat
  h*: cfloat
!
 \defgroup Initialization Initialization
 \defgroup Logging Debugging, Logging, and Error Handling
 \defgroup RendererSetup Renderer Setup
 \defgroup RendererControls Renderer Controls
 \defgroup ContextControls Context Controls
 \defgroup TargetControls Target Controls
 \defgroup SurfaceControls Surface Controls
 \defgroup ImageControls Image Controls
 \defgroup Conversions Surface, Image, and Target Conversions
 \defgroup Matrix Matrix Controls
 \defgroup Rendering Rendering
 \defgroup Shapes Shapes
 \defgroup ShaderInterface Shader Interface
! \ingroup Rendering
 A struct representing a rectangular area with floating point precision.
 \see GPU_MakeRect()
RendererEnum = Uint32
RendererID {...}{.bycopy.} = object
  name*: cstring
  renderer*: RendererEnum
  majorVersion*: cint
  minorVersion*: cint
! \ingroup Initialization
 \ingroup RendererSetup
 \ingroup RendererControls
 Renderer ID object for identifying a specific renderer.
 \see GPU_MakeRendererID()
 \see GPU_InitRendererByID()
BlendMode {...}{.bycopy.} = object
  sourceColor*: BlendFuncEnum
  destColor*: BlendFuncEnum
  sourceAlpha*: BlendFuncEnum
  destAlpha*: BlendFuncEnum
  colorEquation*: BlendEqEnum
  alphaEquation*: BlendEqEnum
! \ingroup ImageControls
 Blend mode storage struct
Image {...}{.bycopy.} = object
  renderer*: ptr Renderer
  contextTarget*: ptr Target
  target*: ptr Target
  w*: Uint16
  h*: Uint16
  usingVirtualResolution*: Bool
  format*: FormatEnum
  numLayers*: cint
  bytesPerPixel*: cint
  baseW*: Uint16               ## ::
               ##   Original image dimensions
  baseH*: Uint16               ## ::
               ##   Original image dimensions
  textureW*: Uint16            ## ::
                  ##   Underlying texture dimensions
  textureH*: Uint16            ## ::
                  ##   Underlying texture dimensions
  hasMipmaps*: Bool
  anchorX*: cfloat             ## ::
                 ##   Normalized coords for the point at which the image is blitted.  Default is (0.5, 0.5), that is, the image is drawn centered.
  anchorY*: cfloat             ## ::
                 ##   These are interpreted according to GPU_SetCoordinateMode() and range from (0.0 - 1.0) normally.
  color*: Color
  useBlending*: Bool
  blendMode*: BlendMode
  filterMode*: FilterEnum
  snapMode*: SnapEnum
  wrapModeX*: WrapEnum
  wrapModeY*: WrapEnum
  data*: pointer
  refcount*: cint
  isAlias*: Bool
! \ingroup ImageControls
 Image object for containing pixel/texture data.
 A GPU_Image can be created with GPU_CreateImage(), GPU_LoadImage(), GPU_CopyImage(), or GPU_CopyImageFromSurface().
 Free the memory with GPU_FreeImage() when you're done.
 \see GPU_CreateImage()
 \see GPU_LoadImage()
 \see GPU_CopyImage()
 \see GPU_CopyImageFromSurface()
 \see GPU_Target
TextureHandle = ptr uint
! \ingroup ImageControls
 A backend-neutral type that is intended to hold a backend-specific handle/pointer to a texture.
 \see GPU_CreateImageUsingTexture()
 \see GPU_GetTextureHandle()
Camera {...}{.bycopy.} = object
  x*: cfloat
  y*: cfloat
  z*: cfloat
  angle*: cfloat
  zoomX*: cfloat
  zoomY*: cfloat
  zNear*: cfloat               ## ::
               ##   z clipping planes
  zFar*: cfloat                ## ::
              ##   z clipping planes
  useCenteredOrigin*: Bool     ## ::
                         ##   move rotation/scaling origin to the center of the camera's view
  
! \ingroup TargetControls
 Camera object that determines viewing transform.
 \see GPU_SetCamera()
 \see GPU_GetDefaultCamera()
 \see GPU_GetCamera()
ShaderBlock {...}{.bycopy.} = object
  positionLoc*: cint
  texcoordLoc*: cint
  colorLoc*: cint              ## ::
                ##   Uniforms
  modelViewProjectionLoc*: cint
! \ingroup ShaderInterface
 Container for the built-in shader attribute and uniform locations (indices).
 \see GPU_LoadShaderBlock()
 \see GPU_SetShaderBlock()
MatrixStack {...}{.bycopy.} = object
  storageSize*: cuint
  size*: cuint
  matrix*: ptr ptr cfloat
! \ingroup Matrix
 Matrix stack data structure for global vertex transforms.
Context {...}{.bycopy.} = object
  context*: pointer
  failed*: Bool                ## ::
              ##   ! SDL window ID
  windowID*: Uint32            ## ::
                  ##   ! Actual window dimensions
  windowW*: cint
  windowH*: cint               ## ::
               ##   ! Drawable region dimensions
  drawableW*: cint
  drawableH*: cint             ## ::
                 ##   ! Window dimensions for restoring windowed mode after GPU_SetFullscreen(1,1).
  storedWindowW*: cint
  storedWindowH*: cint         ## ::
                     ##   ! Last target used
  activeTarget*: ptr Target     ## ::
                         ##   ! Internal state
  currentShaderProgram*: Uint32
  defaultTexturedShaderProgram*: Uint32
  defaultUntexturedShaderProgram*: Uint32
  currentShaderBlock*: ShaderBlock
  defaultTexturedShaderBlock*: ShaderBlock
  defaultUntexturedShaderBlock*: ShaderBlock
  shapesUseBlending*: Bool
  shapesBlendMode*: BlendMode
  lineThickness*: cfloat
  useTexturing*: Bool
  refcount*: cint
  data*: pointer
! \ingroup ContextControls
 Rendering context data.  Only GPU_Targets which represent windows will store this.
FeatureEnum = Uint32
! \ingroup Initialization
 Important GPU features which may not be supported depending on a device's extension support.  Can be bitwise OR'd together.
 \see GPU_IsFeatureEnabled()
 \see GPU_SetRequiredFeatures()
InitFlagEnum = Uint32
! \ingroup Initialization
 Initialization flags for changing default init parameters.  Can be bitwise OR'ed together.
 Default (0) is to use late swap vsync and double buffering.
 \see GPU_SetPreInitFlags()
 \see GPU_GetPreInitFlags()
PrimitiveEnum = Uint32
! \ingroup Rendering
 Primitive types for rendering arbitrary geometry.  The values are intentionally identical to the GL_ primitives.
 \see GPU_PrimitiveBatch()
 \see GPU_PrimitiveBatchV()
BatchFlagEnum = Uint32
! Bit flags for geometry batching.
 \see GPU_TriangleBatch()
 \see GPU_TriangleBatchX()
 \see GPU_PrimitiveBatch()
 \see GPU_PrimitiveBatchV()
FlipEnum = Uint32
! Bit flags for blitting into a rectangular region.
 \see GPU_BlitRect
 \see GPU_BlitRectX
TypeEnum = Uint32
! \ingroup ShaderInterface
 Type enumeration for GPU_AttributeFormat specifications.
AttributeFormat {...}{.bycopy.} = object
  isPerSprite*: Bool           ## ::
                   ##   Per-sprite values are expanded to 4 vertices
  numElemsPerValue*: cint
  kind*: TypeEnum              ## ::
                ##   GPU_TYPE_FLOAT, GPU_TYPE_INT, GPU_TYPE_UNSIGNED_INT, etc.
  normalize*: Bool
  strideBytes*: cint           ## ::
                   ##   Number of bytes between two vertex specifications
  offsetBytes*: cint           ## ::
                   ##   Number of bytes to skip at the beginning of 'values'
  
! \ingroup ShaderInterface
Attribute {...}{.bycopy.} = object
  location*: cint
  values*: pointer             ## ::
                 ##   Expect 4 values for each sprite
  format*: AttributeFormat
! \ingroup ShaderInterface
AttributeSource {...}{.bycopy.} = object
  enabled*: Bool
  numValues*: cint
  nextValue*: pointer          ## ::
                    ##   Automatic storage format
  perVertexStorageStrideBytes*: cint
  perVertexStorageOffsetBytes*: cint
  perVertexStorageSize*: cint  ## ::
                            ##   Over 0 means that the per-vertex storage has been automatically allocated
  perVertexStorage*: pointer   ## ::
                           ##   Could point to the attribute's values or to allocated storage
  attribute*: Attribute
! \ingroup ShaderInterface
ErrorObject {...}{.bycopy.} = object
  function*: cstring
  error*: ErrorEnum
  details*: cstring
! \ingroup Logging
RendererImpl {...}{.incompleteStruct.} = object

Consts

SDLgpuStd = false
SDLgpuGit = true
SDLgpuDL = false
SDLgpuStatic = true
SDLgpuSetVer = ""
SDLgpuLPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2_gpu/buildcache/SDL_gpu-0.11.0/lib/libSDL2_gpu.a"
SDLgpuPath = "/Users/joey/Projects/nim-sdl2/src/build/sdl2_gpu/include/SDL_gpu.h"
NONE = 0'u
FEATURE_NON_POWER_OF_TWO = 1'u
FEATURE_RENDER_TARGETS = 2'u
FEATURE_BLEND_EQUATIONS = 4'u
FEATURE_BLEND_FUNC_SEPARATE = 8'u
FEATURE_BLEND_EQUATIONS_SEPARATE = 16'u
FEATURE_GL_BGR = 32'u
FEATURE_GL_BGRA = 64'u
FEATURE_GL_ABGR = 128'u
FEATURE_VERTEX_SHADER = 256'u
FEATURE_FRAGMENT_SHADER = 512'u
FEATURE_PIXEL_SHADER = 512'u
FEATURE_GEOMETRY_SHADER = 1024'u
FEATURE_WRAP_REPEAT_MIRRORED = 2048'u
FEATURE_CORE_FRAMEBUFFER_OBJECTS = 4096'u
FEATURE_ALL_BASE = 2'u
FEATURE_ALL_BLEND_PRESETS = 12'u32
FEATURE_ALL_GL_FORMATS = 224'u32
FEATURE_BASIC_SHADERS = 768'u32
FEATURE_ALL_SHADERS = 1792'u32
INIT_ENABLE_VSYNC = 1'u
INIT_DISABLE_VSYNC = 2'u
INIT_DISABLE_DOUBLE_BUFFER = 4'u
INIT_DISABLE_AUTO_VIRTUAL_RESOLUTION = 8'u
INIT_REQUEST_COMPATIBILITY_PROFILE = 16'u
INIT_USE_ROW_BY_ROW_TEXTURE_UPLOAD_FALLBACK = 32'u
INIT_USE_COPY_TEXTURE_UPLOAD_FALLBACK = 64'u
POINTS = 0'u
LINES = 1'u
LINE_LOOP = 2'u
LINE_STRIP = 3'u
TRIANGLES = 4'u
TRIANGLE_STRIP = 5'u
TRIANGLE_FAN = 6'u
BATCH_XY = 1'u
BATCH_XYZ = 2'u
BATCH_ST = 4'u
BATCH_RGB = 8'u
BATCH_RGBA = 16'u
BATCH_RGB8 = 32'u
BATCH_RGBA8 = 64'u
BATCH_XY_ST = 5'u32
BATCH_XYZ_ST = 6'u32
BATCH_XY_RGB = 9'u32
BATCH_XYZ_RGB = 10'u32
BATCH_XY_RGBA = 17'u32
BATCH_XYZ_RGBA = 18'u32
BATCH_XY_ST_RGBA = 21'u32
BATCH_XYZ_ST_RGBA = 22'u32
BATCH_XY_RGB8 = 33'u32
BATCH_XYZ_RGB8 = 34'u32
BATCH_XY_RGBA8 = 65'u32
BATCH_XYZ_RGBA8 = 66'u32
BATCH_XY_ST_RGBA8 = 69'u32
BATCH_XYZ_ST_RGBA8 = 70'u32
FLIP_NONE = 0'u
FLIP_HORIZONTAL = 1'u
FLIP_VERTICAL = 2'u
TYPE_BYTE = 5120'u
TYPE_UNSIGNED_BYTE = 5121'u
TYPE_SHORT = 5122'u
TYPE_UNSIGNED_SHORT = 5123'u
TYPE_INT = 5124'u
TYPE_UNSIGNED_INT = 5125'u
TYPE_FLOAT = 5126'u
TYPE_DOUBLE = 5130'u
RENDERER_UNKNOWN = 0'u
RENDERER_OPENGL_1_BASE = 1'u
RENDERER_OPENGL_1 = 2'u
RENDERER_OPENGL_2 = 3'u
RENDERER_OPENGL_3 = 4'u
RENDERER_OPENGL_4 = 5'u
RENDERER_GLES_1 = 11'u
RENDERER_GLES_2 = 12'u
RENDERER_GLES_3 = 13'u
RENDERER_D3D9 = 21'u
RENDERER_D3D10 = 22'u
RENDERER_D3D11 = 23'u
GPU_VERSION_MAJOR = 0
GPU_VERSION_MINOR = 11
GPU_VERSION_PATCH = 0
HAVE_STDC = 1
HAVE_GNUC = 1
HAVE_MSVC = 0
FALSE = 0
TRUE = 1
RENDERER_ORDER_MAX = 10
RENDERER_CUSTOM_0 = 1000
NEVER = 512'i32
LESS = 513'i32
EQUAL = 514'i32
LEQUAL = 515'i32
GREATER = 516'i32
NOTEQUAL = 517'i32
GEQUAL = 518'i32
ALWAYS = 519'i32
FUNC_ZERO = 0'i32
FUNC_ONE = 1'i32
FUNC_SRC_COLOR = 768'i32
FUNC_DST_COLOR = 774'i32
FUNC_ONE_MINUS_SRC = 769'i32
FUNC_ONE_MINUS_DST = 775'i32
FUNC_SRC_ALPHA = 770'i32
FUNC_DST_ALPHA = 772'i32
FUNC_ONE_MINUS_SRC_ALPHA = 771'i32
FUNC_ONE_MINUS_DST_ALPHA = 773'i32
EQ_ADD = 32774'i32
EQ_SUBTRACT = 32778'i32
EQ_REVERSE_SUBTRACT = 32779'i32
BLEND_NORMAL = 0'i32
BLEND_PREMULTIPLIED_ALPHA = 1'i32
BLEND_MULTIPLY = 2'i32
BLEND_ADD = 3'i32
BLEND_SUBTRACT = 4'i32
BLEND_MOD_ALPHA = 5'i32
BLEND_SET_ALPHA = 6'i32
BLEND_SET = 7'i32
BLEND_NORMAL_KEEP_ALPHA = 8'i32
BLEND_NORMAL_ADD_ALPHA = 9'i32
BLEND_NORMAL_FACTOR_ALPHA = 10'i32
FILTER_NEAREST = 0'i32
FILTER_LINEAR = 1'i32
FILTER_LINEAR_MIPMAP = 2'i32
SNAP_NONE = 0'i32
SNAP_POSITION = 1'i32
SNAP_DIMENSIONS = 2'i32
SNAP_POSITION_AND_DIMENSIONS = 3'i32
WRAP_NONE = 0'i32
WRAP_REPEAT = 1'i32
WRAP_MIRRORED = 2'i32
FORMAT_LUMINANCE = 1'i32
FORMAT_LUMINANCE_ALPHA = 2'i32
FORMAT_RGB = 3'i32
FORMAT_RGBA = 4'i32
FORMAT_ALPHA = 5'i32
FORMAT_RG = 6'i32
FORMAT_YCbCr422 = 7'i32
FORMAT_YCbCr420P = 8'i32
FORMAT_BGR = 9'i32
FORMAT_BGRA = 10'i32
FORMAT_ABGR = 11'i32
FILE_AUTO = 0'i32
FILE_PNG = 1
FILE_BMP = 2
FILE_TGA = 3
MODEL = 0
VIEW = 1
PROJECTION = 2
DEFAULT_INIT_FLAGS = 0
VERTEX_SHADER = 0'i32
FRAGMENT_SHADER = 1'i32
PIXEL_SHADER = 1'i32
GEOMETRY_SHADER = 2'i32
LANGUAGE_NONE = 0'i32
LANGUAGE_ARB_ASSEMBLY = 1'i32
LANGUAGE_GLSL = 2'i32
LANGUAGE_GLSLES = 3'i32
LANGUAGE_HLSL = 4'i32
LANGUAGE_CG = 5'i32
ERROR_NONE = 0'i32
ERROR_BACKEND_ERROR = 1'i32
ERROR_DATA_ERROR = 2'i32
ERROR_USER_ERROR = 3'i32
ERROR_UNSUPPORTED_FUNCTION = 4'i32
ERROR_NULL_ARGUMENT = 5'i32
ERROR_FILE_NOT_FOUND = 6'i32
DEBUG_LEVEL_0 = 0'i32
DEBUG_LEVEL_1 = 1'i32
DEBUG_LEVEL_2 = 2'i32
DEBUG_LEVEL_3 = 3'i32
DEBUG_LEVEL_MAX = 3'i32

Procs

proc getLinkedVersion(): Version {...}{.importc: "GPU_GetLinkedVersion", cdecl.}
proc setInitWindow(windowID: Uint32) {...}{.importc: "GPU_SetInitWindow", cdecl.}
! The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window.
proc getInitWindow(): Uint32 {...}{.importc: "GPU_GetInitWindow", cdecl.}
! Returns the window ID that has been set via GPU_SetInitWindow().
proc setPreInitFlags(flags: InitFlagEnum) {...}{.importc: "GPU_SetPreInitFlags", cdecl.}
! Set special flags to use for initialization. Set these before calling GPU_Init().
 \param GPU_flags An OR'ed combination of GPU_InitFlagEnum flags.  Default flags (0) enable late swap vsync and double buffering.
proc getPreInitFlags(): InitFlagEnum {...}{.importc: "GPU_GetPreInitFlags", cdecl.}
! Returns the current special flags to use for initialization.
proc setRequiredFeatures(features: FeatureEnum) {...}{.
    importc: "GPU_SetRequiredFeatures", cdecl.}
! Set required features to use for initialization. Set these before calling GPU_Init().
 \param features An OR'ed combination of GPU_FeatureEnum flags.  Required features will force GPU_Init() to create a renderer that supports all of the given flags or else fail.
proc getRequiredFeatures(): FeatureEnum {...}{.importc: "GPU_GetRequiredFeatures", cdecl.}
! Returns the current required features to use for initialization.
proc getDefaultRendererOrder(orderSize: ptr cint; order: ptr RendererID) {...}{.
    importc: "GPU_GetDefaultRendererOrder", cdecl.}
! Gets the default initialization renderer IDs for the current platform copied into the 'order' array and the number of renderer IDs into 'order_size'.  Pass NULL for 'order' to just get the size of the renderer order array.  Will return at most GPU_RENDERER_ORDER_MAX renderers.
proc getRendererOrder(orderSize: ptr cint; order: ptr RendererID) {...}{.
    importc: "GPU_GetRendererOrder", cdecl.}
! Gets the current renderer ID order for initialization copied into the 'order' array and the number of renderer IDs into 'order_size'.  Pass NULL for 'order' to just get the size of the renderer order array.
proc setRendererOrder(orderSize: cint; order: ptr RendererID) {...}{.
    importc: "GPU_SetRendererOrder", cdecl.}
! Sets the renderer ID order to use for initialization.  If 'order' is NULL, it will restore the default order.
proc init(w: Uint16; h: Uint16; flags: WindowFlagEnum): ptr Target {...}{.importc: "GPU_Init",
    cdecl.}
! Initializes SDL's video subsystem (if necessary) and all of SDL_gpu's internal structures.
 Chooses a renderer and creates a window with the given dimensions and window creation flags.
 A pointer to the resulting window's render target is returned.
 
 \param w Desired window width in pixels
 \param h Desired window height in pixels
 \param SDL_flags The bit flags to pass to SDL when creating the window.  Use GPU_DEFAULT_INIT_FLAGS if you don't care.
 \return On success, returns the new context target (i.e. render target backed by a window).  On failure, returns NULL.
 
 Initializes these systems:
  The 'error queue': Stores error codes and description strings.
  The 'renderer registry': An array of information about the supported renderers on the current platform,
    such as the renderer name and id and its life cycle functions.
  The SDL library and its video subsystem: Calls SDL_Init() if SDL has not already been initialized.
    Use SDL_InitSubsystem() to initialize more parts of SDL.
  The current renderer:  Walks through each renderer in the renderer registry and tries to initialize them until one succeeds.
 
 \see GPU_RendererID
 \see GPU_InitRenderer()
 \see GPU_InitRendererByID()
 \see GPU_SetRendererOrder()
 \see GPU_PushErrorCode()
proc initRenderer(rendererEnum: RendererEnum; w: Uint16; h: Uint16;
                 flags: WindowFlagEnum): ptr Target {...}{.importc: "GPU_InitRenderer",
    cdecl.}
! Initializes SDL and SDL_gpu.  Creates a window and the requested renderer context.
proc initRendererByID(rendererRequest: RendererID; w: Uint16; h: Uint16;
                     flags: WindowFlagEnum): ptr Target {...}{.
    importc: "GPU_InitRendererByID", cdecl.}
! Initializes SDL and SDL_gpu.  Creates a window and the requested renderer context.
 By requesting a renderer via ID, you can specify the major and minor versions of an individual renderer backend.
 \see GPU_MakeRendererID
proc isFeatureEnabled(feature: FeatureEnum): Bool {...}{.importc: "GPU_IsFeatureEnabled",
    cdecl.}
! Checks for important GPU features which may not be supported depending on a device's extension support.  Feature flags (GPU_FEATURE_) can be bitwise OR'd together.
 \return 1 if all of the passed features are enabled/supported
 \return 0 if any of the passed features are disabled/unsupported
proc closeCurrentRenderer() {...}{.importc: "GPU_CloseCurrentRenderer", cdecl.}
! Clean up the renderer state.
proc quit() {...}{.importc: "GPU_Quit", cdecl.}
! Clean up the renderer state and shut down SDL_gpu.
proc setDebugLevel(level: DebugLevelEnum) {...}{.importc: "GPU_SetDebugLevel", cdecl.}
! \ingroup Logging
  @{
! Sets the global debug level.
 GPU_DEBUG_LEVEL_0: Normal
 GPU_DEBUG_LEVEL_1: Prints messages when errors are pushed via GPU_PushErrorCode()
 GPU_DEBUG_LEVEL_2: Elevates warning logs to error priority
 GPU_DEBUG_LEVEL_3: Elevates info logs to error priority
proc getDebugLevel(): DebugLevelEnum {...}{.importc: "GPU_GetDebugLevel", cdecl.}
! Returns the current global debug level.
proc logInfo(format: cstring) {...}{.importc: "GPU_LogInfo", cdecl, varargs.}
! Prints an informational log message.
proc logWarning(format: cstring) {...}{.importc: "GPU_LogWarning", cdecl, varargs.}
! Prints a warning log message.
proc logError(format: cstring) {...}{.importc: "GPU_LogError", cdecl, varargs.}
! Prints an error log message.
proc setLogCallback(callback: proc (logLevel: LogLevelEnum; format: cstring;
                                 args: va_list): cint {...}{.cdecl.}) {...}{.
    importc: "GPU_SetLogCallback", cdecl.}
! Sets a custom callback for handling logging.  Use stdio's vsnprintf() to process the va_list into a string.  Passing NULL as the callback will reset to the default internal logging.
proc pushErrorCode(function: cstring; error: ErrorEnum; details: cstring) {...}{.
    importc: "GPU_PushErrorCode", cdecl, varargs.}
! Pushes a new error code into the error queue.  If the queue is full, the queue is not modified.
 \param function The name of the function that pushed the error
 \param error The error code to push on the error queue
 \param details Additional information string, can be NULL.
proc popErrorCode(): ErrorObject {...}{.importc: "GPU_PopErrorCode", cdecl.}
! Pops an error object from the error queue and returns it.  If the error queue is empty, it returns an error object with NULL function, GPU_ERROR_NONE error, and NULL details.
proc getErrorString(error: ErrorEnum): cstring {...}{.importc: "GPU_GetErrorString", cdecl.}
! Gets the string representation of an error code.
proc setErrorQueueMax(max: cuint) {...}{.importc: "GPU_SetErrorQueueMax", cdecl.}
! Changes the maximum number of error objects that SDL_gpu will store.  This deletes all currently stored errors.
proc makeRendererID(name: cstring; renderer: RendererEnum; majorVersion: cint;
                   minorVersion: cint): RendererID {...}{.importc: "GPU_MakeRendererID",
    cdecl.}
End of Logging
! @}
! \ingroup RendererSetup
  @{
! Returns an initialized GPU_RendererID.
proc getRendererID(renderer: RendererEnum): RendererID {...}{.
    importc: "GPU_GetRendererID", cdecl.}
! Gets the first registered renderer identifier for the given enum value.
proc getNumRegisteredRenderers(): cint {...}{.importc: "GPU_GetNumRegisteredRenderers",
                                      cdecl.}
! Gets the number of registered (available) renderers.
proc getRegisteredRendererList(renderersArray: ptr RendererID) {...}{.
    importc: "GPU_GetRegisteredRendererList", cdecl.}
! Gets an array of identifiers for the registered (available) renderers.
proc registerRenderer(id: RendererID; createRenderer: proc (request: RendererID): ptr Renderer {...}{.
    cdecl.}; freeRenderer: proc (renderer: ptr Renderer) {...}{.cdecl.}) {...}{.
    importc: "GPU_RegisterRenderer", cdecl.}
! Prepares a renderer for use by SDL_gpu.
proc reserveNextRendererEnum(): RendererEnum {...}{.
    importc: "GPU_ReserveNextRendererEnum", cdecl.}
End of RendererSetup
! @}
! \ingroup RendererControls
  @{
! Gets the next enum ID that can be used for a custom renderer.
proc getNumActiveRenderers(): cint {...}{.importc: "GPU_GetNumActiveRenderers", cdecl.}
! Gets the number of active (created) renderers.
proc getActiveRendererList(renderersArray: ptr RendererID) {...}{.
    importc: "GPU_GetActiveRendererList", cdecl.}
! Gets an array of identifiers for the active renderers.
proc getCurrentRenderer(): ptr Renderer {...}{.importc: "GPU_GetCurrentRenderer", cdecl.}
! \return The current renderer
proc setCurrentRenderer(id: RendererID) {...}{.importc: "GPU_SetCurrentRenderer", cdecl.}
! Switches the current renderer to the renderer matching the given identifier.
proc getRenderer(id: RendererID): ptr Renderer {...}{.importc: "GPU_GetRenderer", cdecl.}
! \return The renderer matching the given identifier.
proc freeRenderer(renderer: ptr Renderer) {...}{.importc: "GPU_FreeRenderer", cdecl.}
proc resetRendererState() {...}{.importc: "GPU_ResetRendererState", cdecl.}
! Reapplies the renderer state to the backend API (e.g. OpenGL, Direct3D).  Use this if you want SDL_gpu to be able to render after you've used direct backend calls.
proc setCoordinateMode(useMathCoords: Bool) {...}{.importc: "GPU_SetCoordinateMode", cdecl.}
! Sets the coordinate mode for this renderer.  Target and image coordinates will be either "inverted" (0,0 is the upper left corner, y increases downward) or "mathematical" (0,0 is the bottom-left corner, y increases upward).
 The default is inverted (0), as this is traditional for 2D graphics.
 \param inverted 0 is for inverted coordinates, 1 is for mathematical coordinates
proc getCoordinateMode(): Bool {...}{.importc: "GPU_GetCoordinateMode", cdecl.}
proc setDefaultAnchor(anchorX: cfloat; anchorY: cfloat) {...}{.
    importc: "GPU_SetDefaultAnchor", cdecl.}
! Sets the default image blitting anchor for newly created images.
 \see GPU_SetAnchor
proc getDefaultAnchor(anchorX: ptr cfloat; anchorY: ptr cfloat) {...}{.
    importc: "GPU_GetDefaultAnchor", cdecl.}
! Returns the default image blitting anchor through the given variables.
 \see GPU_GetAnchor
proc getContextTarget(): ptr Target {...}{.importc: "GPU_GetContextTarget", cdecl.}
End of RendererControls
! @}
Context / window controls
! \ingroup ContextControls
  @{
! \return The renderer's current context target.
proc getWindowTarget(windowID: Uint32): ptr Target {...}{.importc: "GPU_GetWindowTarget",
    cdecl.}
! \return The target that is associated with the given windowID.
proc createTargetFromWindow(windowID: Uint32): ptr Target {...}{.
    importc: "GPU_CreateTargetFromWindow", cdecl.}
! Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it.
proc makeCurrent(target: ptr Target; windowID: Uint32) {...}{.importc: "GPU_MakeCurrent",
    cdecl.}
! Makes the given window the current rendering destination for the given context target.
 This also makes the target the current context for image loading and window operations.
 If the target does not represent a window, this does nothing.
proc setWindowResolution(w: Uint16; h: Uint16): Bool {...}{.
    importc: "GPU_SetWindowResolution", cdecl.}
! Change the actual size of the current context target's window.  This resets the virtual resolution and viewport of the context target.
 Aside from direct resolution changes, this should also be called in response to SDL_WINDOWEVENT_RESIZED window events for resizable windows.
proc setFullscreen(enableFullscreen: Bool; useDesktopResolution: Bool): Bool {...}{.
    importc: "GPU_SetFullscreen", cdecl.}
! Enable/disable fullscreen mode for the current context target's window.
 On some platforms, this may destroy the renderer context and require that textures be reloaded.  Unfortunately, SDL does not provide a notification mechanism for this.
 \param enable_fullscreen If true, make the application go fullscreen.  If false, make the application go to windowed mode.
 \param use_desktop_resolution If true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP).
 \return 0 if the new mode is windowed, 1 if the new mode is fullscreen.
proc getFullscreen(): Bool {...}{.importc: "GPU_GetFullscreen", cdecl.}
! Returns true if the current context target's window is in fullscreen mode.
proc getActiveTarget(): ptr Target {...}{.importc: "GPU_GetActiveTarget", cdecl.}
! \return Returns the last active target.
proc setActiveTarget(target: ptr Target): Bool {...}{.importc: "GPU_SetActiveTarget", cdecl.}
! \return Sets the currently active target for matrix modification functions.
proc setShapeBlending(enable: Bool) {...}{.importc: "GPU_SetShapeBlending", cdecl.}
! Enables/disables alpha blending for shape rendering on the current window.
proc getBlendModeFromPreset(preset: BlendPresetEnum): BlendMode {...}{.
    importc: "GPU_GetBlendModeFromPreset", cdecl.}
! Translates a blend preset into a blend mode.
proc setShapeBlendFunction(sourceColor: BlendFuncEnum; destColor: BlendFuncEnum;
                          sourceAlpha: BlendFuncEnum; destAlpha: BlendFuncEnum) {...}{.
    importc: "GPU_SetShapeBlendFunction", cdecl.}
! Sets the blending component functions for shape rendering.
proc setShapeBlendEquation(colorEquation: BlendEqEnum; alphaEquation: BlendEqEnum) {...}{.
    importc: "GPU_SetShapeBlendEquation", cdecl.}
! Sets the blending component equations for shape rendering.
proc setShapeBlendMode(mode: BlendPresetEnum) {...}{.importc: "GPU_SetShapeBlendMode",
    cdecl.}
! Sets the blending mode for shape rendering on the current window, if supported by the renderer.
proc setLineThickness(thickness: cfloat): cfloat {...}{.importc: "GPU_SetLineThickness",
    cdecl.}
! Sets the thickness of lines for the current context.
 \param thickness New line thickness in pixels measured across the line.  Default is 1.0f.
 \return The old thickness value
proc getLineThickness(): cfloat {...}{.importc: "GPU_GetLineThickness", cdecl.}
! Returns the current line thickness value.
proc createAliasTarget(target: ptr Target): ptr Target {...}{.
    importc: "GPU_CreateAliasTarget", cdecl.}
End of ContextControls
! @}
! \ingroup TargetControls
  @{
! Creates a target that aliases the given target.  Aliases can be used to store target settings (e.g. viewports) for easy switching.
 GPU_FreeTarget() frees the alias's memory, but does not affect the original.
proc loadTarget(image: ptr Image): ptr Target {...}{.importc: "GPU_LoadTarget", cdecl.}
! Creates a new render target from the given image.  It can then be accessed from image->target.  This increments the internal refcount of the target, so it should be matched with a GPU_FreeTarget().
proc getTarget(image: ptr Image): ptr Target {...}{.importc: "GPU_GetTarget", cdecl.}
! Creates a new render target from the given image.  It can then be accessed from image->target.  This does not increment the internal refcount of the target, so it will be invalidated when the image is freed.
proc freeTarget(target: ptr Target) {...}{.importc: "GPU_FreeTarget", cdecl.}
! Deletes a render target in the proper way for this renderer.
proc setVirtualResolution(target: ptr Target; w: Uint16; h: Uint16) {...}{.
    importc: "GPU_SetVirtualResolution", cdecl.}
! Change the logical size of the given target.  Rendering to this target will be scaled as if the dimensions were actually the ones given.
proc getVirtualResolution(target: ptr Target; w: ptr Uint16; h: ptr Uint16) {...}{.
    importc: "GPU_GetVirtualResolution", cdecl.}
! Query the logical size of the given target.
proc getVirtualCoords(target: ptr Target; x: ptr cfloat; y: ptr cfloat; displayX: cfloat;
                     displayY: cfloat) {...}{.importc: "GPU_GetVirtualCoords", cdecl.}
! Converts screen space coordinates (such as from mouse input) to logical drawing coordinates.  This interacts with GPU_SetCoordinateMode() when the y-axis is flipped (screen space is assumed to be inverted: (0,0) in the upper-left corner).
proc unsetVirtualResolution(target: ptr Target) {...}{.
    importc: "GPU_UnsetVirtualResolution", cdecl.}
! Reset the logical size of the given target to its original value.
proc makeRect(x: cfloat; y: cfloat; w: cfloat; h: cfloat): Rect {...}{.importc: "GPU_MakeRect",
    cdecl.}
! \return A GPU_Rect with the given values.
proc makeColor(r: Uint8; g: Uint8; b: Uint8; a: Uint8): Color {...}{.importc: "GPU_MakeColor",
    cdecl.}
! \return An SDL_Color with the given values.
proc setViewport(target: ptr Target; viewport: Rect) {...}{.importc: "GPU_SetViewport", cdecl.}
! Sets the given target's viewport.
proc unsetViewport(target: ptr Target) {...}{.importc: "GPU_UnsetViewport", cdecl.}
! Resets the given target's viewport to the entire target area.
proc getDefaultCamera(): Camera {...}{.importc: "GPU_GetDefaultCamera", cdecl.}
! \return A GPU_Camera with position (0, 0, 0), angle of 0, zoom of 1, centered origin, and near/far clipping planes of -100 and 100.
proc getCamera(target: ptr Target): Camera {...}{.importc: "GPU_GetCamera", cdecl.}
! \return The camera of the given render target.  If target is NULL, returns the default camera.
proc setCamera(target: ptr Target; cam: ptr Camera): Camera {...}{.importc: "GPU_SetCamera",
    cdecl.}
! Sets the current render target's current camera.
 \param target A pointer to the target that will copy this camera.
 \param cam A pointer to the camera data to use or NULL to use the default camera.
 \return The old camera.
proc enableCamera(target: ptr Target; useCamera: Bool) {...}{.importc: "GPU_EnableCamera",
    cdecl.}
! Enables or disables using the built-in camera matrix transforms.
proc isCameraEnabled(target: ptr Target): Bool {...}{.importc: "GPU_IsCameraEnabled", cdecl.}
! Returns 1 if the camera transforms are enabled, 0 otherwise.
proc addDepthBuffer(target: ptr Target): Bool {...}{.importc: "GPU_AddDepthBuffer", cdecl.}
! Attach a new depth buffer to the given target so that it can use depth testing.  Context targets automatically have a depth buffer already.
  If successful, also enables depth testing for this target.
proc setDepthTest(target: ptr Target; enable: Bool) {...}{.importc: "GPU_SetDepthTest", cdecl.}
! Enables or disables the depth test, which will skip drawing pixels/fragments behind other fragments.  Disabled by default.
  This has implications for alpha blending, where compositing might not work correctly depending on render order.
proc setDepthWrite(target: ptr Target; enable: Bool) {...}{.importc: "GPU_SetDepthWrite",
    cdecl.}
! Enables or disables writing the depth (effective view z-coordinate) of new pixels to the depth buffer.  Enabled by default, but you must call GPU_SetDepthTest() to use it.
proc setDepthFunction(target: ptr Target; compareOperation: ComparisonEnum) {...}{.
    importc: "GPU_SetDepthFunction", cdecl.}
! Sets the operation to perform when depth testing.
proc getPixel(target: ptr Target; x: Sint16; y: Sint16): Color {...}{.importc: "GPU_GetPixel",
    cdecl.}
! \return The RGBA color of a pixel.
proc setClipRect(target: ptr Target; rect: Rect): Rect {...}{.importc: "GPU_SetClipRect",
    cdecl.}
! Sets the clipping rect for the given render target.
proc setClip(target: ptr Target; x: Sint16; y: Sint16; w: Uint16; h: Uint16): Rect {...}{.
    importc: "GPU_SetClip", cdecl.}
! Sets the clipping rect for the given render target.
proc unsetClip(target: ptr Target) {...}{.importc: "GPU_UnsetClip", cdecl.}
! Turns off clipping for the given target.
proc intersectRect(A: Rect; B: Rect; result: ptr Rect): Bool {...}{.
    importc: "GPU_IntersectRect", cdecl.}
! Returns GPU_TRUE if the given rects A and B overlap, in which case it also fills the given result rect with the intersection.  `result` can be NULL if you don't need the intersection.
proc intersectClipRect(target: ptr Target; B: Rect; result: ptr Rect): Bool {...}{.
    importc: "GPU_IntersectClipRect", cdecl.}
! Returns GPU_TRUE if the given target's clip rect and the given B rect overlap, in which case it also fills the given result rect with the intersection.  `result` can be NULL if you don't need the intersection.
 If the target doesn't have a clip rect enabled, this uses the whole target area.
proc setTargetColor(target: ptr Target; color: Color) {...}{.importc: "GPU_SetTargetColor",
    cdecl.}
! Sets the modulation color for subsequent drawing of images and shapes on the given target.
  This has a cumulative effect with the image coloring functions.
  e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
  Would make the image draw with color of roughly (128, 64, 0).
proc setTargetRGB(target: ptr Target; r: Uint8; g: Uint8; b: Uint8) {...}{.
    importc: "GPU_SetTargetRGB", cdecl.}
! Sets the modulation color for subsequent drawing of images and shapes on the given target.
  This has a cumulative effect with the image coloring functions.
  e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
  Would make the image draw with color of roughly (128, 64, 0).
proc setTargetRGBA(target: ptr Target; r: Uint8; g: Uint8; b: Uint8; a: Uint8) {...}{.
    importc: "GPU_SetTargetRGBA", cdecl.}
! Sets the modulation color for subsequent drawing of images and shapes on the given target.
  This has a cumulative effect with the image coloring functions.
  e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128);
  Would make the image draw with color of roughly (128, 64, 0).
proc unsetTargetColor(target: ptr Target) {...}{.importc: "GPU_UnsetTargetColor", cdecl.}
! Unsets the modulation color for subsequent drawing of images and shapes on the given target.
  This has the same effect as coloring with pure opaque white (255, 255, 255, 255).
proc loadSurface(filename: cstring): ptr Surface {...}{.importc: "GPU_LoadSurface", cdecl.}
End of TargetControls
! @}
! \ingroup SurfaceControls
  @{
! Load surface from an image file that is supported by this renderer.  Don't forget to SDL_FreeSurface() it.
proc loadSurface_RW(rwops: ptr RWops; freeRwops: Bool): ptr Surface {...}{.
    importc: "GPU_LoadSurface_RW", cdecl.}
! Load surface from an image file in memory.  Don't forget to SDL_FreeSurface() it.
proc saveSurface(surface: ptr Surface; filename: cstring; format: FileFormatEnum): Bool {...}{.
    importc: "GPU_SaveSurface", cdecl.}
! Save surface to a file.
 With a format of GPU_FILE_AUTO, the file type is deduced from the extension.  Supported formats are: png, bmp, tga.
 Returns 0 on failure.
proc saveSurface_RW(surface: ptr Surface; rwops: ptr RWops; freeRwops: Bool;
                   format: FileFormatEnum): Bool {...}{.importc: "GPU_SaveSurface_RW",
    cdecl.}
! Save surface to a RWops stream.
 Does not support format of GPU_FILE_AUTO, because the file type cannot be deduced.  Supported formats are: png, bmp, tga.
 Returns 0 on failure.
proc createImage(w: Uint16; h: Uint16; format: FormatEnum): ptr Image {...}{.
    importc: "GPU_CreateImage", cdecl.}
End of SurfaceControls
! @}
! \ingroup ImageControls
  @{
! Create a new, blank image with the given format.  Don't forget to GPU_FreeImage() it.
       \param w Image width in pixels
       \param h Image height in pixels
       \param format Format of color channels.
proc createImageUsingTexture(handle: TextureHandle; takeOwnership: Bool): ptr Image {...}{.
    importc: "GPU_CreateImageUsingTexture", cdecl.}
! Create a new image that uses the given native texture handle as the image texture.
proc loadImage(filename: cstring): ptr Image {...}{.importc: "GPU_LoadImage", cdecl.}
! Load image from an image file that is supported by this renderer.  Don't forget to GPU_FreeImage() it.
proc loadImage_RW(rwops: ptr RWops; freeRwops: Bool): ptr Image {...}{.
    importc: "GPU_LoadImage_RW", cdecl.}
! Load image from an image file in memory.  Don't forget to GPU_FreeImage() it.
proc createAliasImage(image: ptr Image): ptr Image {...}{.importc: "GPU_CreateAliasImage",
    cdecl.}
! Creates an image that aliases the given image.  Aliases can be used to store image settings (e.g. modulation color) for easy switching.
 GPU_FreeImage() frees the alias's memory, but does not affect the original.
proc copyImage(image: ptr Image): ptr Image {...}{.importc: "GPU_CopyImage", cdecl.}
! Copy an image to a new image.  Don't forget to GPU_FreeImage() both.
proc freeImage(image: ptr Image) {...}{.importc: "GPU_FreeImage", cdecl.}
! Deletes an image in the proper way for this renderer.  Also deletes the corresponding GPU_Target if applicable.  Be careful not to use that target afterward!
proc setImageVirtualResolution(image: ptr Image; w: Uint16; h: Uint16) {...}{.
    importc: "GPU_SetImageVirtualResolution", cdecl.}
! Change the logical size of the given image.  Rendering this image will scaled it as if the dimensions were actually the ones given.
proc unsetImageVirtualResolution(image: ptr Image) {...}{.
    importc: "GPU_UnsetImageVirtualResolution", cdecl.}
! Reset the logical size of the given image to its original value.
proc updateImage(image: ptr Image; imageRect: ptr Rect; surface: ptr Surface;
                surfaceRect: ptr Rect) {...}{.importc: "GPU_UpdateImage", cdecl.}
! Update an image from surface data.  Ignores virtual resolution on the image so the number of pixels needed from the surface is known.
proc updateImageBytes(image: ptr Image; imageRect: ptr Rect; bytes: ptr cuchar;
                     bytesPerRow: cint) {...}{.importc: "GPU_UpdateImageBytes", cdecl.}
! Update an image from an array of pixel data.  Ignores virtual resolution on the image so the number of pixels needed from the surface is known.
proc replaceImage(image: ptr Image; surface: ptr Surface; surfaceRect: ptr Rect): Bool {...}{.
    importc: "GPU_ReplaceImage", cdecl.}
! Update an image from surface data, replacing its underlying texture to allow for size changes.  Ignores virtual resolution on the image so the number of pixels needed from the surface is known.
proc saveImage(image: ptr Image; filename: cstring; format: FileFormatEnum): Bool {...}{.
    importc: "GPU_SaveImage", cdecl.}
! Save image to a file.
 With a format of GPU_FILE_AUTO, the file type is deduced from the extension.  Supported formats are: png, bmp, tga.
 Returns 0 on failure.
proc saveImage_RW(image: ptr Image; rwops: ptr RWops; freeRwops: Bool;
                 format: FileFormatEnum): Bool {...}{.importc: "GPU_SaveImage_RW", cdecl.}
! Save image to a RWops stream.
 Does not support format of GPU_FILE_AUTO, because the file type cannot be deduced.  Supported formats are: png, bmp, tga.
 Returns 0 on failure.
proc generateMipmaps(image: ptr Image) {...}{.importc: "GPU_GenerateMipmaps", cdecl.}
! Loads mipmaps for the given image, if supported by the renderer.
proc setColor(image: ptr Image; color: Color) {...}{.importc: "GPU_SetColor", cdecl.}
! Sets the modulation color for subsequent drawing of the given image.
proc setRGB(image: ptr Image; r: Uint8; g: Uint8; b: Uint8) {...}{.importc: "GPU_SetRGB", cdecl.}
! Sets the modulation color for subsequent drawing of the given image.
proc setRGBA(image: ptr Image; r: Uint8; g: Uint8; b: Uint8; a: Uint8) {...}{.
    importc: "GPU_SetRGBA", cdecl.}
! Sets the modulation color for subsequent drawing of the given image.
proc unsetColor(image: ptr Image) {...}{.importc: "GPU_UnsetColor", cdecl.}
! Unsets the modulation color for subsequent drawing of the given image.
  This is equivalent to coloring with pure opaque white (255, 255, 255, 255).
proc getBlending(image: ptr Image): Bool {...}{.importc: "GPU_GetBlending", cdecl.}
! Gets the current alpha blending setting.
proc setBlending(image: ptr Image; enable: Bool) {...}{.importc: "GPU_SetBlending", cdecl.}
! Enables/disables alpha blending for the given image.
proc setBlendFunction(image: ptr Image; sourceColor: BlendFuncEnum;
                     destColor: BlendFuncEnum; sourceAlpha: BlendFuncEnum;
                     destAlpha: BlendFuncEnum) {...}{.importc: "GPU_SetBlendFunction",
    cdecl.}
! Sets the blending component functions.
proc setBlendEquation(image: ptr Image; colorEquation: BlendEqEnum;
                     alphaEquation: BlendEqEnum) {...}{.
    importc: "GPU_SetBlendEquation", cdecl.}
! Sets the blending component equations.
proc setBlendMode(image: ptr Image; mode: BlendPresetEnum) {...}{.
    importc: "GPU_SetBlendMode", cdecl.}
! Sets the blending mode, if supported by the renderer.
proc setImageFilter(image: ptr Image; filter: FilterEnum) {...}{.
    importc: "GPU_SetImageFilter", cdecl.}
! Sets the image filtering mode, if supported by the renderer.
proc setAnchor(image: ptr Image; anchorX: cfloat; anchorY: cfloat) {...}{.
    importc: "GPU_SetAnchor", cdecl.}
! Sets the image anchor, which is the point about which the image is blitted.  The default is to blit the image on-center (0.5, 0.5).  The anchor is in normalized coordinates (0.0-1.0).
proc getAnchor(image: ptr Image; anchorX: ptr cfloat; anchorY: ptr cfloat) {...}{.
    importc: "GPU_GetAnchor", cdecl.}
! Returns the image anchor via the passed parameters.  The anchor is in normalized coordinates (0.0-1.0).
proc getSnapMode(image: ptr Image): SnapEnum {...}{.importc: "GPU_GetSnapMode", cdecl.}
! Gets the current pixel snap setting.  The default value is GPU_SNAP_POSITION_AND_DIMENSIONS.
proc setSnapMode(image: ptr Image; mode: SnapEnum) {...}{.importc: "GPU_SetSnapMode", cdecl.}
! Sets the pixel grid snapping mode for the given image.
proc setWrapMode(image: ptr Image; wrapModeX: WrapEnum; wrapModeY: WrapEnum) {...}{.
    importc: "GPU_SetWrapMode", cdecl.}
! Sets the image wrapping mode, if supported by the renderer.
proc getTextureHandle(image: ptr Image): TextureHandle {...}{.
    importc: "GPU_GetTextureHandle", cdecl.}
! Returns the backend-specific texture handle associated with the given image.  Note that SDL_gpu will be unaware of changes made to the texture.
proc copyImageFromSurface(surface: ptr Surface): ptr Image {...}{.
    importc: "GPU_CopyImageFromSurface", cdecl.}
End of ImageControls
! @}
Surface / Image / Target conversions
! \ingroup Conversions
  @{
! Copy SDL_Surface data into a new GPU_Image.  Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.
proc copyImageFromTarget(target: ptr Target): ptr Image {...}{.
    importc: "GPU_CopyImageFromTarget", cdecl.}
! Copy GPU_Target data into a new GPU_Image.  Don't forget to GPU_FreeImage() the image.
proc copySurfaceFromTarget(target: ptr Target): ptr Surface {...}{.
    importc: "GPU_CopySurfaceFromTarget", cdecl.}
! Copy GPU_Target data into a new SDL_Surface.  Don't forget to SDL_FreeSurface() the surface.
proc copySurfaceFromImage(image: ptr Image): ptr Surface {...}{.
    importc: "GPU_CopySurfaceFromImage", cdecl.}
! Copy GPU_Image data into a new SDL_Surface.  Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.
proc vectorLength(vec3: ptr cfloat): cfloat {...}{.importc: "GPU_VectorLength", cdecl.}
End of Conversions
! @}
! \ingroup Matrix
  @{
Basic vector operations (3D)
! Returns the magnitude (length) of the given vector.
proc vectorNormalize(vec3: ptr cfloat) {...}{.importc: "GPU_VectorNormalize", cdecl.}
! Modifies the given vector so that it has a new length of 1.
proc vectorDot(A: ptr cfloat; B: ptr cfloat): cfloat {...}{.importc: "GPU_VectorDot", cdecl.}
! Returns the dot product of two vectors.
proc vectorCross(result: ptr cfloat; A: ptr cfloat; B: ptr cfloat) {...}{.
    importc: "GPU_VectorCross", cdecl.}
! Performs the cross product of vectors A and B (result = A x B).  Do not use A or B as 'result'.
proc vectorCopy(result: ptr cfloat; A: ptr cfloat) {...}{.importc: "GPU_VectorCopy", cdecl.}
! Overwrite 'result' vector with the values from vector A.
proc vectorApplyMatrix(vec3: ptr cfloat; matrix4x4: ptr cfloat) {...}{.
    importc: "GPU_VectorApplyMatrix", cdecl.}
! Multiplies the given matrix into the given vector (vec3 = matrixvec3).
proc vector4ApplyMatrix(vec4: ptr cfloat; matrix4x4: ptr cfloat) {...}{.
    importc: "GPU_Vector4ApplyMatrix", cdecl.}
! Multiplies the given matrix into the given vector (vec4 = matrixvec4).
proc matrixCopy(result: ptr cfloat; A: ptr cfloat) {...}{.importc: "GPU_MatrixCopy", cdecl.}
Basic matrix operations (4x4)
! Overwrite 'result' matrix with the values from matrix A.
proc matrixIdentity(result: ptr cfloat) {...}{.importc: "GPU_MatrixIdentity", cdecl.}
! Fills 'result' matrix with the identity matrix.
proc matrixOrtho(result: ptr cfloat; left: cfloat; right: cfloat; bottom: cfloat;
                top: cfloat; zNear: cfloat; zFar: cfloat) {...}{.
    importc: "GPU_MatrixOrtho", cdecl.}
! Multiplies an orthographic projection matrix into the given matrix.
proc matrixFrustum(result: ptr cfloat; left: cfloat; right: cfloat; bottom: cfloat;
                  top: cfloat; zNear: cfloat; zFar: cfloat) {...}{.
    importc: "GPU_MatrixFrustum", cdecl.}
! Multiplies a perspective projection matrix into the given matrix.
proc matrixPerspective(result: ptr cfloat; fovy: cfloat; aspect: cfloat; zNear: cfloat;
                      zFar: cfloat) {...}{.importc: "GPU_MatrixPerspective", cdecl.}
! Multiplies a perspective projection matrix into the given matrix.
proc matrixLookAt(matrix: ptr cfloat; eyeX: cfloat; eyeY: cfloat; eyeZ: cfloat;
                 targetX: cfloat; targetY: cfloat; targetZ: cfloat; upX: cfloat;
                 upY: cfloat; upZ: cfloat) {...}{.importc: "GPU_MatrixLookAt", cdecl.}
! Multiplies a view matrix into the given matrix.
proc matrixTranslate(result: ptr cfloat; x: cfloat; y: cfloat; z: cfloat) {...}{.
    importc: "GPU_MatrixTranslate", cdecl.}
! Adds a translation into the given matrix.
proc matrixScale(result: ptr cfloat; sx: cfloat; sy: cfloat; sz: cfloat) {...}{.
    importc: "GPU_MatrixScale", cdecl.}
! Multiplies a scaling matrix into the given matrix.
proc matrixRotate(result: ptr cfloat; degrees: cfloat; x: cfloat; y: cfloat; z: cfloat) {...}{.
    importc: "GPU_MatrixRotate", cdecl.}
! Multiplies a rotation matrix into the given matrix.
proc matrixMultiply(result: ptr cfloat; A: ptr cfloat; B: ptr cfloat) {...}{.
    importc: "GPU_MatrixMultiply", cdecl.}
! Multiplies matrices A and B and stores the result in the given 'result' matrix (result = AB).  Do not use A or B as 'result'.
 \see GPU_MultiplyAndAssign
proc multiplyAndAssign(result: ptr cfloat; B: ptr cfloat) {...}{.
    importc: "GPU_MultiplyAndAssign", cdecl.}
! Multiplies matrices 'result' and B and stores the result in the given 'result' matrix (result = result B).
proc getMatrixString(A: ptr cfloat): cstring {...}{.importc: "GPU_GetMatrixString", cdecl.}
Matrix stack accessors
! Returns an internal string that represents the contents of matrix A.
proc getCurrentMatrix(): ptr cfloat {...}{.importc: "GPU_GetCurrentMatrix", cdecl.}
! Returns the current matrix from the active target.  Returns NULL if stack is empty.
proc getTopMatrix(stack: ptr MatrixStack): ptr cfloat {...}{.importc: "GPU_GetTopMatrix",
    cdecl.}
! Returns the current matrix from the top of the matrix stack.  Returns NULL if stack is empty.
proc getModel(): ptr cfloat {...}{.importc: "GPU_GetModel", cdecl.}
! Returns the current model matrix from the active target.  Returns NULL if stack is empty.
proc getView(): ptr cfloat {...}{.importc: "GPU_GetView", cdecl.}
! Returns the current view matrix from the active target.  Returns NULL if stack is empty.
proc getProjection(): ptr cfloat {...}{.importc: "GPU_GetProjection", cdecl.}
! Returns the current projection matrix from the active target.  Returns NULL if stack is empty.
proc getModelViewProjection(result: ptr cfloat) {...}{.
    importc: "GPU_GetModelViewProjection", cdecl.}
! Copies the current modelview-projection matrix from the active target into the given 'result' matrix (result = PVM).
proc createMatrixStack(): ptr MatrixStack {...}{.importc: "GPU_CreateMatrixStack", cdecl.}
Matrix stack manipulators
! Returns a newly allocated matrix stack that has already been initialized.
proc freeMatrixStack(stack: ptr MatrixStack) {...}{.importc: "GPU_FreeMatrixStack", cdecl.}
! Frees the memory for the matrix stack and any matrices it contains.
proc initMatrixStack(stack: ptr MatrixStack) {...}{.importc: "GPU_InitMatrixStack", cdecl.}
! Allocate new matrices for the given stack.
proc copyMatrixStack(source: ptr MatrixStack; dest: ptr MatrixStack) {...}{.
    importc: "GPU_CopyMatrixStack", cdecl.}
! Copies matrices from one stack to another.
proc clearMatrixStack(stack: ptr MatrixStack) {...}{.importc: "GPU_ClearMatrixStack", cdecl.}
! Deletes matrices in the given stack.
proc resetProjection(target: ptr Target) {...}{.importc: "GPU_ResetProjection", cdecl.}
! Reapplies the default orthographic projection matrix, based on camera and coordinate settings.
proc matrixMode(target: ptr Target; matrixMode: cint) {...}{.importc: "GPU_MatrixMode", cdecl.}
! Sets the active target and changes matrix mode to GPU_PROJECTION, GPU_VIEW, or GPU_MODEL.  Further matrix stack operations manipulate that particular stack.
proc setProjection(A: ptr cfloat) {...}{.importc: "GPU_SetProjection", cdecl.}
! Copies the given matrix to the active target's projection matrix.
proc setView(A: ptr cfloat) {...}{.importc: "GPU_SetView", cdecl.}
! Copies the given matrix to the active target's view matrix.
proc setModel(A: ptr cfloat) {...}{.importc: "GPU_SetModel", cdecl.}
! Copies the given matrix to the active target's model matrix.
proc setProjectionFromStack(stack: ptr MatrixStack) {...}{.
    importc: "GPU_SetProjectionFromStack", cdecl.}
! Copies the given matrix to the active target's projection matrix.
proc setViewFromStack(stack: ptr MatrixStack) {...}{.importc: "GPU_SetViewFromStack", cdecl.}
! Copies the given matrix to the active target's view matrix.
proc setModelFromStack(stack: ptr MatrixStack) {...}{.importc: "GPU_SetModelFromStack",
    cdecl.}
! Copies the given matrix to the active target's model matrix.
proc pushMatrix() {...}{.importc: "GPU_PushMatrix", cdecl.}
! Pushes the current matrix as a new matrix stack item to be restored later.
proc popMatrix() {...}{.importc: "GPU_PopMatrix", cdecl.}
! Removes the current matrix from the stack, restoring the previously pushed matrix.
proc loadIdentity() {...}{.importc: "GPU_LoadIdentity", cdecl.}
! Fills current matrix with the identity matrix.
proc loadMatrix(matrix4x4: ptr cfloat) {...}{.importc: "GPU_LoadMatrix", cdecl.}
! Copies a given matrix to be the current matrix.
proc ortho(left: cfloat; right: cfloat; bottom: cfloat; top: cfloat; zNear: cfloat;
          zFar: cfloat) {...}{.importc: "GPU_Ortho", cdecl.}
! Multiplies an orthographic projection matrix into the current matrix.
proc frustum(left: cfloat; right: cfloat; bottom: cfloat; top: cfloat; zNear: cfloat;
            zFar: cfloat) {...}{.importc: "GPU_Frustum", cdecl.}
! Multiplies a perspective projection matrix into the current matrix.
proc perspective(fovy: cfloat; aspect: cfloat; zNear: cfloat; zFar: cfloat) {...}{.
    importc: "GPU_Perspective", cdecl.}
! Multiplies a perspective projection matrix into the current matrix.
proc lookAt(eyeX: cfloat; eyeY: cfloat; eyeZ: cfloat; targetX: cfloat; targetY: cfloat;
           targetZ: cfloat; upX: cfloat; upY: cfloat; upZ: cfloat) {...}{.
    importc: "GPU_LookAt", cdecl.}
! Multiplies a view matrix into the current matrix.
proc translate(x: cfloat; y: cfloat; z: cfloat) {...}{.importc: "GPU_Translate", cdecl.}
! Adds a translation into the current matrix.
proc scale(sx: cfloat; sy: cfloat; sz: cfloat) {...}{.importc: "GPU_Scale", cdecl.}
! Multiplies a scaling matrix into the current matrix.
proc rotate(degrees: cfloat; x: cfloat; y: cfloat; z: cfloat) {...}{.importc: "GPU_Rotate",
    cdecl.}
! Multiplies a rotation matrix into the current matrix.
proc multMatrix(matrix4x4: ptr cfloat) {...}{.importc: "GPU_MultMatrix", cdecl.}
! Multiplies a given matrix into the current matrix.
proc clear(target: ptr Target) {...}{.importc: "GPU_Clear", cdecl.}
End of Matrix
! @}
! \ingroup Rendering
  @{
! Clears the contents of the given render target.  Fills the target with color {0, 0, 0, 0}.
proc clearColor(target: ptr Target; color: Color) {...}{.importc: "GPU_ClearColor", cdecl.}
! Fills the given render target with a color.
proc clearRGB(target: ptr Target; r: Uint8; g: Uint8; b: Uint8) {...}{.importc: "GPU_ClearRGB",
    cdecl.}
! Fills the given render target with a color (alpha is 255, fully opaque).
proc clearRGBA(target: ptr Target; r: Uint8; g: Uint8; b: Uint8; a: Uint8) {...}{.
    importc: "GPU_ClearRGBA", cdecl.}
! Fills the given render target with a color.
proc blit(image: ptr Image; srcRect: ptr Rect; target: ptr Target; x: cfloat; y: cfloat) {...}{.
    importc: "GPU_Blit", cdecl.}
! Draws the given image to the given render target.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param x Destination x-position
 \param y Destination y-position
proc blitRotate(image: ptr Image; srcRect: ptr Rect; target: ptr Target; x: cfloat;
               y: cfloat; degrees: cfloat) {...}{.importc: "GPU_BlitRotate", cdecl.}
! Rotates and draws the given image to the given render target.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param x Destination x-position
 \param y Destination y-position
 \param degrees Rotation angle (in degrees)
proc blitScale(image: ptr Image; srcRect: ptr Rect; target: ptr Target; x: cfloat;
              y: cfloat; scaleX: cfloat; scaleY: cfloat) {...}{.importc: "GPU_BlitScale",
    cdecl.}
! Scales and draws the given image to the given render target.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param x Destination x-position
 \param y Destination y-position
 \param scaleX Horizontal stretch factor
 \param scaleY Vertical stretch factor
proc blitTransform(image: ptr Image; srcRect: ptr Rect; target: ptr Target; x: cfloat;
                  y: cfloat; degrees: cfloat; scaleX: cfloat; scaleY: cfloat) {...}{.
    importc: "GPU_BlitTransform", cdecl.}
! Scales, rotates, and draws the given image to the given render target.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param x Destination x-position
 \param y Destination y-position
 \param degrees Rotation angle (in degrees)
 \param scaleX Horizontal stretch factor
 \param scaleY Vertical stretch factor
proc blitTransformX(image: ptr Image; srcRect: ptr Rect; target: ptr Target; x: cfloat;
                   y: cfloat; pivotX: cfloat; pivotY: cfloat; degrees: cfloat;
                   scaleX: cfloat; scaleY: cfloat) {...}{.importc: "GPU_BlitTransformX",
    cdecl.}
! Scales, rotates around a pivot point, and draws the given image to the given render target.  The drawing point (x, y) coincides with the pivot point on the src image (pivot_x, pivot_y).
       \param src_rect The region of the source image to use.  Pass NULL for the entire image.
       \param x Destination x-position
       \param y Destination y-position
       \param pivot_x Pivot x-position (in image coordinates)
       \param pivot_y Pivot y-position (in image coordinates)
       \param degrees Rotation angle (in degrees)
       \param scaleX Horizontal stretch factor
       \param scaleY Vertical stretch factor
proc blitRect(image: ptr Image; srcRect: ptr Rect; target: ptr Target; destRect: ptr Rect) {...}{.
    importc: "GPU_BlitRect", cdecl.}
! Draws the given image to the given render target, scaling it to fit the destination region.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param dest_rect The region of the destination target image to draw upon.  Pass NULL for the entire target.
proc blitRectX(image: ptr Image; srcRect: ptr Rect; target: ptr Target;
              destRect: ptr Rect; degrees: cfloat; pivotX: cfloat; pivotY: cfloat;
              flipDirection: FlipEnum) {...}{.importc: "GPU_BlitRectX", cdecl.}
! Draws the given image to the given render target, scaling it to fit the destination region.
 \param src_rect The region of the source image to use.  Pass NULL for the entire image.
 \param dest_rect The region of the destination target image to draw upon.  Pass NULL for the entire target.
       \param degrees Rotation angle (in degrees)
       \param pivot_x Pivot x-position (in image coordinates)
       \param pivot_y Pivot y-position (in image coordinates)
       \param flip_direction A GPU_FlipEnum value (or bitwise OR'd combination) that specifies which direction the image should be flipped.
proc triangleBatch(image: ptr Image; target: ptr Target; numVertices: cushort;
                  values: ptr cfloat; numIndices: cuint; indices: ptr cushort;
                  flags: BatchFlagEnum) {...}{.importc: "GPU_TriangleBatch", cdecl.}
! Renders triangles from the given set of vertices.  This lets you render arbitrary geometry.  It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
 \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values.  Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0.  Pass NULL to render with only custom shader attributes.
 \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
 \param flags Bit flags to control the interpretation of the 'values' array parameters.
proc triangleBatchX(image: ptr Image; target: ptr Target; numVertices: cushort;
                   values: pointer; numIndices: cuint; indices: ptr cushort;
                   flags: BatchFlagEnum) {...}{.importc: "GPU_TriangleBatchX", cdecl.}
! Renders triangles from the given set of vertices.  This lets you render arbitrary geometry.  It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
 \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values.  Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components).  Pass NULL to render with only custom shader attributes.
 \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
 \param flags Bit flags to control the interpretation of the 'values' array parameters.
proc primitiveBatch(image: ptr Image; target: ptr Target; primitiveType: PrimitiveEnum;
                   numVertices: cushort; values: ptr cfloat; numIndices: cuint;
                   indices: ptr cushort; flags: BatchFlagEnum) {...}{.
    importc: "GPU_PrimitiveBatch", cdecl.}
! Renders primitives from the given set of vertices.  This lets you render arbitrary geometry.  It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
 \param primitive_type The kind of primitive to render.
 \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values.  Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components).  Pass NULL to render with only custom shader attributes.
 \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
 \param flags Bit flags to control the interpretation of the 'values' array parameters.
proc primitiveBatchV(image: ptr Image; target: ptr Target;
                    primitiveType: PrimitiveEnum; numVertices: cushort;
                    values: pointer; numIndices: cuint; indices: ptr cushort;
                    flags: BatchFlagEnum) {...}{.importc: "GPU_PrimitiveBatchV", cdecl.}
! Renders primitives from the given set of vertices.  This lets you render arbitrary geometry.  It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.
 \param primitive_type The kind of primitive to render.
 \param values A tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values.  Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components).  Pass NULL to render with only custom shader attributes.
 \param indices If not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
 \param flags Bit flags to control the interpretation of the 'values' array parameters.
proc flushBlitBuffer() {...}{.importc: "GPU_FlushBlitBuffer", cdecl.}
! Send all buffered blitting data to the current context target.
proc flip(target: ptr Target) {...}{.importc: "GPU_Flip", cdecl.}
! Updates the given target's associated window.  For non-context targets (e.g. image targets), this will flush the blit buffer.
proc pixel(target: ptr Target; x: cfloat; y: cfloat; color: Color) {...}{.importc: "GPU_Pixel",
    cdecl.}
End of Rendering
! @}
! \ingroup Shapes
  @{
! Renders a colored point.
 \param target The destination render target
 \param x x-coord of the point
 \param y y-coord of the point
 \param color The color of the shape to render
proc line(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat; color: Color) {...}{.
    importc: "GPU_Line", cdecl.}
! Renders a colored line.
 \param target The destination render target
 \param x1 x-coord of starting point
 \param y1 y-coord of starting point
 \param x2 x-coord of ending point
 \param y2 y-coord of ending point
 \param color The color of the shape to render
proc arc(target: ptr Target; x: cfloat; y: cfloat; radius: cfloat; startAngle: cfloat;
        endAngle: cfloat; color: Color) {...}{.importc: "GPU_Arc", cdecl.}
! Renders a colored arc curve (circle segment).
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param radius The radius of the circle / distance from the center point that rendering will occur
 \param start_angle The angle to start from, in degrees.  Measured clockwise from the positive x-axis.
 \param end_angle The angle to end at, in degrees.  Measured clockwise from the positive x-axis.
 \param color The color of the shape to render
proc arcFilled(target: ptr Target; x: cfloat; y: cfloat; radius: cfloat;
              startAngle: cfloat; endAngle: cfloat; color: Color) {...}{.
    importc: "GPU_ArcFilled", cdecl.}
! Renders a colored filled arc (circle segment / pie piece).
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param radius The radius of the circle / distance from the center point that rendering will occur
 \param start_angle The angle to start from, in degrees.  Measured clockwise from the positive x-axis.
 \param end_angle The angle to end at, in degrees.  Measured clockwise from the positive x-axis.
 \param color The color of the shape to render
proc circle(target: ptr Target; x: cfloat; y: cfloat; radius: cfloat; color: Color) {...}{.
    importc: "GPU_Circle", cdecl.}
! Renders a colored circle outline.
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param radius The radius of the circle / distance from the center point that rendering will occur
 \param color The color of the shape to render
proc circleFilled(target: ptr Target; x: cfloat; y: cfloat; radius: cfloat; color: Color) {...}{.
    importc: "GPU_CircleFilled", cdecl.}
! Renders a colored filled circle.
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param radius The radius of the circle / distance from the center point that rendering will occur
 \param color The color of the shape to render
proc ellipse(target: ptr Target; x: cfloat; y: cfloat; rx: cfloat; ry: cfloat;
            degrees: cfloat; color: Color) {...}{.importc: "GPU_Ellipse", cdecl.}
! Renders a colored ellipse outline.
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param rx x-radius of ellipse
 \param ry y-radius of ellipse
 \param degrees The angle to rotate the ellipse
 \param color The color of the shape to render
proc ellipseFilled(target: ptr Target; x: cfloat; y: cfloat; rx: cfloat; ry: cfloat;
                  degrees: cfloat; color: Color) {...}{.importc: "GPU_EllipseFilled", cdecl.}
! Renders a colored filled ellipse.
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param rx x-radius of ellipse
 \param ry y-radius of ellipse
 \param degrees The angle to rotate the ellipse
 \param color The color of the shape to render
proc sector(target: ptr Target; x: cfloat; y: cfloat; innerRadius: cfloat;
           outerRadius: cfloat; startAngle: cfloat; endAngle: cfloat; color: Color) {...}{.
    importc: "GPU_Sector", cdecl.}
! Renders a colored annular sector outline (ring segment).
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param inner_radius The inner radius of the ring
 \param outer_radius The outer radius of the ring
 \param start_angle The angle to start from, in degrees.  Measured clockwise from the positive x-axis.
 \param end_angle The angle to end at, in degrees.  Measured clockwise from the positive x-axis.
 \param color The color of the shape to render
proc sectorFilled(target: ptr Target; x: cfloat; y: cfloat; innerRadius: cfloat;
                 outerRadius: cfloat; startAngle: cfloat; endAngle: cfloat;
                 color: Color) {...}{.importc: "GPU_SectorFilled", cdecl.}
! Renders a colored filled annular sector (ring segment).
 \param target The destination render target
 \param x x-coord of center point
 \param y y-coord of center point
 \param inner_radius The inner radius of the ring
 \param outer_radius The outer radius of the ring
 \param start_angle The angle to start from, in degrees.  Measured clockwise from the positive x-axis.
 \param end_angle The angle to end at, in degrees.  Measured clockwise from the positive x-axis.
 \param color The color of the shape to render
proc tri(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat; x3: cfloat;
        y3: cfloat; color: Color) {...}{.importc: "GPU_Tri", cdecl.}
! Renders a colored triangle outline.
 \param target The destination render target
 \param x1 x-coord of first point
 \param y1 y-coord of first point
 \param x2 x-coord of second point
 \param y2 y-coord of second point
 \param x3 x-coord of third point
 \param y3 y-coord of third point
 \param color The color of the shape to render
proc triFilled(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat;
              x3: cfloat; y3: cfloat; color: Color) {...}{.importc: "GPU_TriFilled", cdecl.}
! Renders a colored filled triangle.
 \param target The destination render target
 \param x1 x-coord of first point
 \param y1 y-coord of first point
 \param x2 x-coord of second point
 \param y2 y-coord of second point
 \param x3 x-coord of third point
 \param y3 y-coord of third point
 \param color The color of the shape to render
proc rectangle(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat;
              color: Color) {...}{.importc: "GPU_Rectangle", cdecl.}
! Renders a colored rectangle outline.
 \param target The destination render target
 \param x1 x-coord of top-left corner
 \param y1 y-coord of top-left corner
 \param x2 x-coord of bottom-right corner
 \param y2 y-coord of bottom-right corner
 \param color The color of the shape to render
proc rectangle2(target: ptr Target; rect: Rect; color: Color) {...}{.
    importc: "GPU_Rectangle2", cdecl.}
! Renders a colored rectangle outline.
 \param target The destination render target
 \param rect The rectangular area to draw
 \param color The color of the shape to render
proc rectangleFilled(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat;
                    color: Color) {...}{.importc: "GPU_RectangleFilled", cdecl.}
! Renders a colored filled rectangle.
 \param target The destination render target
 \param x1 x-coord of top-left corner
 \param y1 y-coord of top-left corner
 \param x2 x-coord of bottom-right corner
 \param y2 y-coord of bottom-right corner
 \param color The color of the shape to render
proc rectangleFilled2(target: ptr Target; rect: Rect; color: Color) {...}{.
    importc: "GPU_RectangleFilled2", cdecl.}
! Renders a colored filled rectangle.
 \param target The destination render target
 \param rect The rectangular area to draw
 \param color The color of the shape to render
proc rectangleRound(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat; y2: cfloat;
                   radius: cfloat; color: Color) {...}{.importc: "GPU_RectangleRound",
    cdecl.}
! Renders a colored rounded (filleted) rectangle outline.
 \param target The destination render target
 \param x1 x-coord of top-left corner
 \param y1 y-coord of top-left corner
 \param x2 x-coord of bottom-right corner
 \param y2 y-coord of bottom-right corner
 \param radius The radius of the corners
 \param color The color of the shape to render
proc rectangleRound2(target: ptr Target; rect: Rect; radius: cfloat; color: Color) {...}{.
    importc: "GPU_RectangleRound2", cdecl.}
! Renders a colored rounded (filleted) rectangle outline.
 \param target The destination render target
 \param rect The rectangular area to draw
 \param radius The radius of the corners
 \param color The color of the shape to render
proc rectangleRoundFilled(target: ptr Target; x1: cfloat; y1: cfloat; x2: cfloat;
                         y2: cfloat; radius: cfloat; color: Color) {...}{.
    importc: "GPU_RectangleRoundFilled", cdecl.}
! Renders a colored filled rounded (filleted) rectangle.
 \param target The destination render target
 \param x1 x-coord of top-left corner
 \param y1 y-coord of top-left corner
 \param x2 x-coord of bottom-right corner
 \param y2 y-coord of bottom-right corner
 \param radius The radius of the corners
 \param color The color of the shape to render
proc rectangleRoundFilled2(target: ptr Target; rect: Rect; radius: cfloat; color: Color) {...}{.
    importc: "GPU_RectangleRoundFilled2", cdecl.}
! Renders a colored filled rounded (filleted) rectangle.
 \param target The destination render target
 \param rect The rectangular area to draw
 \param radius The radius of the corners
 \param color The color of the shape to render
proc polygon(target: ptr Target; numVertices: cuint; vertices: ptr cfloat; color: Color) {...}{.
    importc: "GPU_Polygon", cdecl.}
! Renders a colored polygon outline.  The vertices are expected to define a convex polygon.
 \param target The destination render target
 \param num_vertices Number of vertices (x and y pairs)
 \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
 \param color The color of the shape to render
proc polyline(target: ptr Target; numVertices: cuint; vertices: ptr cfloat; color: Color;
             closeLoop: Bool) {...}{.importc: "GPU_Polyline", cdecl.}
! Renders a colored sequence of line segments.
 \param target The destination render target
 \param num_vertices Number of vertices (x and y pairs)
 \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
 \param color The color of the shape to render
 \param close_loop Make a closed polygon by drawing a line at the end back to the start point
proc polygonFilled(target: ptr Target; numVertices: cuint; vertices: ptr cfloat;
                  color: Color) {...}{.importc: "GPU_PolygonFilled", cdecl.}
! Renders a colored filled polygon.  The vertices are expected to define a convex polygon.
 \param target The destination render target
 \param num_vertices Number of vertices (x and y pairs)
 \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
 \param color The color of the shape to render
proc createShaderProgram(): Uint32 {...}{.importc: "GPU_CreateShaderProgram", cdecl.}
End of Shapes
! @}
! \ingroup ShaderInterface
  @{
! Creates a new, empty shader program.  You will need to compile shaders, attach them to the program, then link the program.
 \see GPU_AttachShader
 \see GPU_LinkShaderProgram
proc freeShaderProgram(programObject: Uint32) {...}{.importc: "GPU_FreeShaderProgram",
    cdecl.}
! Deletes a shader program.
proc compileShader_RW(shaderType: ShaderEnum; shaderSource: ptr RWops; freeRwops: Bool): Uint32 {...}{.
    importc: "GPU_CompileShader_RW", cdecl.}
! Loads shader source from an SDL_RWops, compiles it, and returns the new shader object.
proc compileShader(shaderType: ShaderEnum; shaderSource: cstring): Uint32 {...}{.
    importc: "GPU_CompileShader", cdecl.}
! Compiles shader source and returns the new shader object.
proc loadShader(shaderType: ShaderEnum; filename: cstring): Uint32 {...}{.
    importc: "GPU_LoadShader", cdecl.}
! Loads shader source from a file, compiles it, and returns the new shader object.
proc linkShaders(shaderObject1: Uint32; shaderObject2: Uint32): Uint32 {...}{.
    importc: "GPU_LinkShaders", cdecl.}
! Creates and links a shader program with the given shader objects.
proc linkManyShaders(shaderObjects: ptr Uint32; count: cint): Uint32 {...}{.
    importc: "GPU_LinkManyShaders", cdecl.}
! Creates and links a shader program with the given shader objects.
proc freeShader(shaderObject: Uint32) {...}{.importc: "GPU_FreeShader", cdecl.}
! Deletes a shader object.
proc attachShader(programObject: Uint32; shaderObject: Uint32) {...}{.
    importc: "GPU_AttachShader", cdecl.}
! Attaches a shader object to a shader program for future linking.
proc detachShader(programObject: Uint32; shaderObject: Uint32) {...}{.
    importc: "GPU_DetachShader", cdecl.}
! Detaches a shader object from a shader program.
proc linkShaderProgram(programObject: Uint32): Bool {...}{.
    importc: "GPU_LinkShaderProgram", cdecl.}
! Links a shader program with any attached shader objects.
proc getCurrentShaderProgram(): Uint32 {...}{.importc: "GPU_GetCurrentShaderProgram",
                                      cdecl.}
! \return The current shader program
proc isDefaultShaderProgram(programObject: Uint32): Bool {...}{.
    importc: "GPU_IsDefaultShaderProgram", cdecl.}
! Returns 1 if the given shader program is a default shader for the current context, 0 otherwise.
proc activateShaderProgram(programObject: Uint32; `block`: ptr ShaderBlock) {...}{.
    importc: "GPU_ActivateShaderProgram", cdecl.}
! Activates the given shader program.  Passing NULL for 'block' will disable the built-in shader variables for custom shaders until a GPU_ShaderBlock is set again.
proc deactivateShaderProgram() {...}{.importc: "GPU_DeactivateShaderProgram", cdecl.}
! Deactivates the current shader program (activates program 0).
proc getShaderMessage(): cstring {...}{.importc: "GPU_GetShaderMessage", cdecl.}
! Returns the last shader log message.
proc getAttributeLocation(programObject: Uint32; attribName: cstring): cint {...}{.
    importc: "GPU_GetAttributeLocation", cdecl.}
! Returns an integer representing the location of the specified attribute shader variable.
proc makeAttributeFormat(numElemsPerVertex: cint; kind: TypeEnum; normalize: Bool;
                        strideBytes: cint; offsetBytes: cint): AttributeFormat {...}{.
    importc: "GPU_MakeAttributeFormat", cdecl.}
! Returns a filled GPU_AttributeFormat object.
proc makeAttribute(location: cint; values: pointer; format: AttributeFormat): Attribute {...}{.
    importc: "GPU_MakeAttribute", cdecl.}
! Returns a filled GPU_Attribute object.
proc getUniformLocation(programObject: Uint32; uniformName: cstring): cint {...}{.
    importc: "GPU_GetUniformLocation", cdecl.}
! Returns an integer representing the location of the specified uniform shader variable.
proc loadShaderBlock(programObject: Uint32; positionName: cstring;
                    texcoordName: cstring; colorName: cstring;
                    modelViewMatrixName: cstring): ShaderBlock {...}{.
    importc: "GPU_LoadShaderBlock", cdecl.}
! Loads the given shader program's built-in attribute and uniform locations.
proc setShaderBlock(`block`: ShaderBlock) {...}{.importc: "GPU_SetShaderBlock", cdecl.}
! Sets the current shader block to use the given attribute and uniform locations.
proc getShaderBlock(): ShaderBlock {...}{.importc: "GPU_GetShaderBlock", cdecl.}
! Gets the shader block for the current shader.
proc setShaderImage(image: ptr Image; location: cint; imageUnit: cint) {...}{.
    importc: "GPU_SetShaderImage", cdecl.}
! Sets the given image unit to the given image so that a custom shader can sample multiple textures.
    \param image The source image/texture.  Pass NULL to disable the image unit.
    \param location The uniform location of a texture sampler
    \param image_unit The index of the texture unit to set.  0 is the first unit, which is used by SDL_gpu's blitting functions.  1 would be the second unit.
proc getUniformiv(programObject: Uint32; location: cint; values: ptr cint) {...}{.
    importc: "GPU_GetUniformiv", cdecl.}
! Fills "values" with the value of the uniform shader variable at the given location.
proc setUniformi(location: cint; value: cint) {...}{.importc: "GPU_SetUniformi", cdecl.}
! Sets the value of the integer uniform shader variable at the given location.
    This is equivalent to calling GPU_SetUniformiv(location, 1, 1, &value).
proc setUniformiv(location: cint; numElementsPerValue: cint; numValues: cint;
                 values: ptr cint) {...}{.importc: "GPU_SetUniformiv", cdecl.}
! Sets the value of the integer uniform shader variable at the given location.
proc getUniformuiv(programObject: Uint32; location: cint; values: ptr cuint) {...}{.
    importc: "GPU_GetUniformuiv", cdecl.}
! Fills "values" with the value of the uniform shader variable at the given location.
proc setUniformui(location: cint; value: cuint) {...}{.importc: "GPU_SetUniformui", cdecl.}
! Sets the value of the unsigned integer uniform shader variable at the given location.
    This is equivalent to calling GPU_SetUniformuiv(location, 1, 1, &value).
proc setUniformuiv(location: cint; numElementsPerValue: cint; numValues: cint;
                  values: ptr cuint) {...}{.importc: "GPU_SetUniformuiv", cdecl.}
! Sets the value of the unsigned integer uniform shader variable at the given location.
proc getUniformfv(programObject: Uint32; location: cint; values: ptr cfloat) {...}{.
    importc: "GPU_GetUniformfv", cdecl.}
! Fills "values" with the value of the uniform shader variable at the given location.
proc setUniformf(location: cint; value: cfloat) {...}{.importc: "GPU_SetUniformf", cdecl.}
! Sets the value of the floating point uniform shader variable at the given location.
    This is equivalent to calling GPU_SetUniformfv(location, 1, 1, &value).
proc setUniformfv(location: cint; numElementsPerValue: cint; numValues: cint;
                 values: ptr cfloat) {...}{.importc: "GPU_SetUniformfv", cdecl.}
! Sets the value of the floating point uniform shader variable at the given location.
proc getUniformMatrixfv(programObject: Uint32; location: cint; values: ptr cfloat) {...}{.
    importc: "GPU_GetUniformMatrixfv", cdecl.}
! Fills "values" with the value of the uniform shader variable at the given location.  The results are identical to calling GPU_GetUniformfv().  Matrices are gotten in column-major order.
proc setUniformMatrixfv(location: cint; numMatrices: cint; numRows: cint;
                       numColumns: cint; transpose: Bool; values: ptr cfloat) {...}{.
    importc: "GPU_SetUniformMatrixfv", cdecl.}
! Sets the value of the matrix uniform shader variable at the given location.  The size of the matrices sent is specified by num_rows and num_columns.  Rows and columns must be between 2 and 4.
proc setAttributef(location: cint; value: cfloat) {...}{.importc: "GPU_SetAttributef", cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributei(location: cint; value: cint) {...}{.importc: "GPU_SetAttributei", cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributeui(location: cint; value: cuint) {...}{.importc: "GPU_SetAttributeui",
    cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributefv(location: cint; numElements: cint; value: ptr cfloat) {...}{.
    importc: "GPU_SetAttributefv", cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributeiv(location: cint; numElements: cint; value: ptr cint) {...}{.
    importc: "GPU_SetAttributeiv", cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributeuiv(location: cint; numElements: cint; value: ptr cuint) {...}{.
    importc: "GPU_SetAttributeuiv", cdecl.}
! Sets a constant-value shader attribute that will be used for each rendered vertex.
proc setAttributeSource(numValues: cint; source: Attribute) {...}{.
    importc: "GPU_SetAttributeSource", cdecl.}
! Enables a shader attribute and sets its source data.