The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Macros | Typedefs | Enumerations | Functions | Variables
SDL_gpu.h File Reference
#include "SDL.h"
#include <stdio.h>
#include <stdarg.h>
Include dependency graph for SDL_gpu.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  GPU_Rect
 
struct  GPU_RendererID
 
struct  GPU_BlendMode
 
struct  GPU_Image
 
struct  GPU_Camera
 
struct  GPU_ShaderBlock
 
struct  GPU_MatrixStack
 
struct  GPU_Context
 
struct  GPU_Target
 
struct  GPU_AttributeFormat
 
struct  GPU_Attribute
 
struct  GPU_AttributeSource
 
struct  GPU_ErrorObject
 
struct  GPU_Renderer
 

Macros

#define SDL_GPU_VERSION_MAJOR   0
 
#define SDL_GPU_VERSION_MINOR   9
 
#define SDL_GPU_VERSION_PATCH   0
 
#define SDL_GPU_USE_SDL2
 
#define GPU_RENDERER_ORDER_MAX   10
 
#define GPU_MATRIX_STACK_MAX   5
 
#define GPU_FEATURE_ALL_BASE   GPU_FEATURE_RENDER_TARGETS
 
#define GPU_FEATURE_ALL_BLEND_PRESETS   (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE)
 
#define GPU_FEATURE_ALL_GL_FORMATS   (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR)
 
#define GPU_FEATURE_BASIC_SHADERS   (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_PIXEL_SHADER)
 
#define GPU_FEATURE_ALL_SHADERS   (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_PIXEL_SHADER | GPU_FEATURE_GEOMETRY_SHADER)
 
#define GPU_FEATURE_MASK   0x00FFFF
 
#define GPU_INIT_MASK   0xFF0000
 
#define GPU_DEFAULT_INIT_FLAGS   0
 
#define GPU_PASSTHROUGH_ALL   (GPU_PASSTHROUGH_VERTICES | GPU_PASSTHROUGH_TEXCOORDS | GPU_PASSTHROUGH_COLORS)
 
#define GPU_Log   GPU_LogInfo
 

Typedefs

typedef struct GPU_Renderer GPU_Renderer
 
typedef struct GPU_Target GPU_Target
 
typedef struct GPU_Rect GPU_Rect
 
typedef Uint32 GPU_RendererEnum
 
typedef struct GPU_RendererID GPU_RendererID
 
typedef struct GPU_BlendMode GPU_BlendMode
 
typedef struct GPU_Image GPU_Image
 
typedef struct GPU_Camera GPU_Camera
 
typedef struct GPU_ShaderBlock GPU_ShaderBlock
 
typedef struct GPU_MatrixStack GPU_MatrixStack
 
typedef struct GPU_Context GPU_Context
 
typedef Uint32 GPU_FeatureEnum
 
typedef Uint32 GPU_WindowFlagEnum
 
typedef Uint32 GPU_InitFlagEnum
 
typedef Uint32 GPU_BlitFlagEnum
 
typedef Uint32 GPU_TypeEnum
 
typedef struct GPU_AttributeFormat GPU_AttributeFormat
 
typedef struct GPU_Attribute GPU_Attribute
 
typedef struct GPU_AttributeSource GPU_AttributeSource
 
typedef struct GPU_ErrorObject GPU_ErrorObject
 

Enumerations

enum  GPU_BlendFuncEnum {
  GPU_FUNC_ZERO = 0, GPU_FUNC_ONE = 1, GPU_FUNC_SRC_COLOR = 0x0300, GPU_FUNC_DST_COLOR = 0x0306,
  GPU_FUNC_ONE_MINUS_SRC = 0x0301, GPU_FUNC_ONE_MINUS_DST = 0x0307, GPU_FUNC_SRC_ALPHA = 0x0302, GPU_FUNC_DST_ALPHA = 0x0304,
  GPU_FUNC_ONE_MINUS_SRC_ALPHA = 0x0303, GPU_FUNC_ONE_MINUS_DST_ALPHA = 0x0305
}
 
enum  GPU_BlendEqEnum { GPU_EQ_ADD = 0x8006, GPU_EQ_SUBTRACT = 0x800A, GPU_EQ_REVERSE_SUBTRACT = 0x800B }
 
enum  GPU_BlendPresetEnum {
  GPU_BLEND_NORMAL = 0, GPU_BLEND_PREMULTIPLIED_ALPHA = 1, GPU_BLEND_MULTIPLY = 2, GPU_BLEND_ADD = 3,
  GPU_BLEND_SUBTRACT = 4, GPU_BLEND_MOD_ALPHA = 5, GPU_BLEND_SET_ALPHA = 6, GPU_BLEND_SET = 7,
  GPU_BLEND_NORMAL_KEEP_ALPHA = 8, GPU_BLEND_NORMAL_ADD_ALPHA = 9
}
 
enum  GPU_FilterEnum { GPU_FILTER_NEAREST = 0, GPU_FILTER_LINEAR = 1, GPU_FILTER_LINEAR_MIPMAP = 2 }
 
enum  GPU_SnapEnum { GPU_SNAP_NONE = 0, GPU_SNAP_POSITION = 1, GPU_SNAP_DIMENSIONS = 2, GPU_SNAP_POSITION_AND_DIMENSIONS = 3 }
 
enum  GPU_WrapEnum { GPU_WRAP_NONE = 0, GPU_WRAP_REPEAT = 1, GPU_WRAP_MIRRORED = 2 }
 
enum  GPU_FormatEnum {
  GPU_FORMAT_LUMINANCE = 1, GPU_FORMAT_LUMINANCE_ALPHA = 2, GPU_FORMAT_RGB = 3, GPU_FORMAT_RGBA = 4,
  GPU_FORMAT_ALPHA = 5, GPU_FORMAT_RG = 6, GPU_FORMAT_YCbCr422 = 7, GPU_FORMAT_YCbCr420P = 8
}
 
enum  GPU_ShaderEnum { GPU_VERTEX_SHADER = 0, GPU_FRAGMENT_SHADER = 1, GPU_PIXEL_SHADER = 1, GPU_GEOMETRY_SHADER = 2 }
 
enum  GPU_ShaderLanguageEnum {
  GPU_LANGUAGE_NONE = 0, GPU_LANGUAGE_ARB_ASSEMBLY = 1, GPU_LANGUAGE_GLSL = 2, GPU_LANGUAGE_GLSLES = 3,
  GPU_LANGUAGE_HLSL = 4, GPU_LANGUAGE_CG = 5
}
 
enum  GPU_ErrorEnum {
  GPU_ERROR_NONE = 0, GPU_ERROR_BACKEND_ERROR = 1, GPU_ERROR_DATA_ERROR = 2, GPU_ERROR_USER_ERROR = 3,
  GPU_ERROR_UNSUPPORTED_FUNCTION = 4, GPU_ERROR_NULL_ARGUMENT = 5, GPU_ERROR_FILE_NOT_FOUND = 6
}
 
enum  GPU_DebugLevelEnum {
  GPU_DEBUG_LEVEL_0 = 0, GPU_DEBUG_LEVEL_1 = 1, GPU_DEBUG_LEVEL_2 = 2, GPU_DEBUG_LEVEL_3 = 3,
  GPU_DEBUG_LEVEL_MAX = 3
}
 

Functions

static SDL_version GPU_GetCompiledVersion (void)
 
SDL_version GPU_GetLinkedVersion (void)
 
void GPU_SetInitWindow (Uint32 windowID)
 
Uint32 GPU_GetInitWindow (void)
 
void GPU_SetPreInitFlags (GPU_InitFlagEnum GPU_flags)
 
GPU_InitFlagEnum GPU_GetPreInitFlags (void)
 
void GPU_GetDefaultRendererOrder (int *order_size, GPU_RendererID *order)
 
void GPU_GetRendererOrder (int *order_size, GPU_RendererID *order)
 
void GPU_SetRendererOrder (int order_size, GPU_RendererID *order)
 
GPU_TargetGPU_Init (Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
GPU_TargetGPU_InitRenderer (GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
GPU_TargetGPU_InitRendererByID (GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
 
Uint8 GPU_IsFeatureEnabled (GPU_FeatureEnum feature)
 
void GPU_CloseCurrentRenderer (void)
 
void GPU_Quit (void)
 
void GPU_SetDebugLevel (GPU_DebugLevelEnum level)
 
GPU_DebugLevelEnum GPU_GetDebugLevel (void)
 
void GPU_LogInfo (const char *format,...)
 
void GPU_LogWarning (const char *format,...)
 
void GPU_LogError (const char *format,...)
 
void GPU_PushErrorCode (const char *function, GPU_ErrorEnum error, const char *details,...)
 
GPU_ErrorObject GPU_PopErrorCode (void)
 
const char * GPU_GetErrorString (GPU_ErrorEnum error)
 
const char * GPU_GetRendererEnumString (GPU_RendererEnum id)
 
GPU_RendererID GPU_MakeRendererID (GPU_RendererEnum id, int major_version, int minor_version)
 
GPU_RendererID GPU_GetRendererID (unsigned int index)
 
int GPU_GetNumRegisteredRenderers (void)
 
void GPU_GetRegisteredRendererList (GPU_RendererID *renderers_array)
 
GPU_RendererGPU_AddRenderer (GPU_RendererID id)
 
void GPU_RemoveRenderer (GPU_RendererID id)
 
int GPU_GetNumActiveRenderers (void)
 
void GPU_GetActiveRendererList (GPU_RendererID *renderers_array)
 
GPU_RendererGPU_GetRenderer (unsigned int index)
 
GPU_RendererGPU_GetRendererByID (GPU_RendererID id)
 
GPU_RendererGPU_GetCurrentRenderer (void)
 
void GPU_SetCurrentRenderer (GPU_RendererID id)
 
GPU_TargetGPU_GetContextTarget (void)
 
GPU_TargetGPU_GetWindowTarget (Uint32 windowID)
 
GPU_TargetGPU_CreateTargetFromWindow (Uint32 windowID)
 
void GPU_MakeCurrent (GPU_Target *target, Uint32 windowID)
 
Uint8 GPU_SetWindowResolution (Uint16 w, Uint16 h)
 
Uint8 GPU_ToggleFullscreen (Uint8 use_desktop_resolution)
 
void GPU_SetShapeBlending (Uint8 enable)
 
GPU_BlendMode GPU_GetBlendModeFromPreset (GPU_BlendPresetEnum preset)
 
void GPU_SetShapeBlendFunction (GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
 
void GPU_SetShapeBlendEquation (GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
 
void GPU_SetShapeBlendMode (GPU_BlendPresetEnum mode)
 
float GPU_SetLineThickness (float thickness)
 
float GPU_GetLineThickness (void)
 
GPU_TargetGPU_CreateAliasTarget (GPU_Target *target)
 
GPU_TargetGPU_LoadTarget (GPU_Image *image)
 
void GPU_FreeTarget (GPU_Target *target)
 
void GPU_SetVirtualResolution (GPU_Target *target, Uint16 w, Uint16 h)
 
void GPU_GetVirtualCoords (GPU_Target *target, float *x, float *y, float displayX, float displayY)
 
void GPU_UnsetVirtualResolution (GPU_Target *target)
 
GPU_Rect GPU_MakeRect (float x, float y, float w, float h)
 
SDL_Color GPU_MakeColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
void GPU_SetViewport (GPU_Target *target, GPU_Rect viewport)
 
GPU_Camera GPU_GetDefaultCamera (void)
 
GPU_Camera GPU_GetCamera (GPU_Target *target)
 
GPU_Camera GPU_SetCamera (GPU_Target *target, GPU_Camera *cam)
 
SDL_Color GPU_GetPixel (GPU_Target *target, Sint16 x, Sint16 y)
 
GPU_Rect GPU_SetClipRect (GPU_Target *target, GPU_Rect rect)
 
GPU_Rect GPU_SetClip (GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h)
 
void GPU_UnsetClip (GPU_Target *target)
 
void GPU_SetTargetColor (GPU_Target *target, SDL_Color *color)
 
void GPU_SetTargetRGB (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
 
void GPU_SetTargetRGBA (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
SDL_Surface * GPU_LoadSurface (const char *filename)
 
Uint8 GPU_SaveSurface (SDL_Surface *surface, const char *filename)
 
GPU_ImageGPU_CreateImage (Uint16 w, Uint16 h, GPU_FormatEnum format)
 
GPU_ImageGPU_LoadImage (const char *filename)
 
GPU_ImageGPU_CreateAliasImage (GPU_Image *image)
 
GPU_ImageGPU_CopyImage (GPU_Image *image)
 
void GPU_FreeImage (GPU_Image *image)
 
void GPU_UpdateImage (GPU_Image *image, SDL_Surface *surface, const GPU_Rect *surface_rect)
 
void GPU_UpdateSubImage (GPU_Image *image, const GPU_Rect *image_rect, SDL_Surface *surface, const GPU_Rect *surface_rect)
 
void GPU_UpdateImageBytes (GPU_Image *image, const GPU_Rect *image_rect, const unsigned char *bytes, int bytes_per_row)
 
Uint8 GPU_SaveImage (GPU_Image *image, const char *filename)
 
void GPU_GenerateMipmaps (GPU_Image *image)
 
void GPU_SetColor (GPU_Image *image, SDL_Color *color)
 
void GPU_SetRGB (GPU_Image *image, Uint8 r, Uint8 g, Uint8 b)
 
void GPU_SetRGBA (GPU_Image *image, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
Uint8 GPU_GetBlending (GPU_Image *image)
 
void GPU_SetBlending (GPU_Image *image, Uint8 enable)
 
void GPU_SetBlendFunction (GPU_Image *image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
 
void GPU_SetBlendEquation (GPU_Image *image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
 
void GPU_SetBlendMode (GPU_Image *image, GPU_BlendPresetEnum mode)
 
void GPU_SetImageFilter (GPU_Image *image, GPU_FilterEnum filter)
 
GPU_SnapEnum GPU_GetSnapMode (GPU_Image *image)
 
void GPU_SetSnapMode (GPU_Image *image, GPU_SnapEnum mode)
 
void GPU_SetWrapMode (GPU_Image *image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y)
 
GPU_ImageGPU_CopyImageFromSurface (SDL_Surface *surface)
 
GPU_ImageGPU_CopyImageFromTarget (GPU_Target *target)
 
SDL_Surface * GPU_CopySurfaceFromTarget (GPU_Target *target)
 
SDL_Surface * GPU_CopySurfaceFromImage (GPU_Image *image)
 
void GPU_Clear (GPU_Target *target)
 
void GPU_ClearColor (GPU_Target *target, SDL_Color *color)
 
void GPU_ClearRGBA (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
void GPU_Blit (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y)
 
void GPU_BlitRotate (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees)
 
void GPU_BlitScale (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float scaleX, float scaleY)
 
void GPU_BlitTransform (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees, float scaleX, float scaleY)
 
void GPU_BlitTransformX (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY)
 
void GPU_BlitTransformMatrix (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float *matrix3x3)
 
void GPU_BlitBatch (GPU_Image *image, GPU_Target *target, unsigned int num_sprites, float *values, GPU_BlitFlagEnum flags)
 
void GPU_BlitBatchSeparate (GPU_Image *image, GPU_Target *target, unsigned int num_sprites, float *positions, float *src_rects, float *colors, GPU_BlitFlagEnum flags)
 
void GPU_TriangleBatch (GPU_Image *image, GPU_Target *target, unsigned short num_vertices, float *values, unsigned int num_indices, unsigned short *indices, GPU_BlitFlagEnum flags)
 
void GPU_FlushBlitBuffer (void)
 
void GPU_Flip (GPU_Target *target)
 
void GPU_Pixel (GPU_Target *target, float x, float y, SDL_Color color)
 
void GPU_Line (GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
 
void GPU_Arc (GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
 
void GPU_ArcFilled (GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
 
void GPU_Circle (GPU_Target *target, float x, float y, float radius, SDL_Color color)
 
void GPU_CircleFilled (GPU_Target *target, float x, float y, float radius, SDL_Color color)
 
void GPU_Sector (GPU_Target *target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color)
 
void GPU_SectorFilled (GPU_Target *target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color)
 
void GPU_Tri (GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
 
void GPU_TriFilled (GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
 
void GPU_Rectangle (GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
 
void GPU_RectangleFilled (GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
 
void GPU_RectangleRound (GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
 
void GPU_RectangleRoundFilled (GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
 
void GPU_Polygon (GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
 
void GPU_PolygonFilled (GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
 
Uint32 GPU_CompileShader_RW (GPU_ShaderEnum shader_type, SDL_RWops *shader_source)
 
Uint32 GPU_LoadShader (GPU_ShaderEnum shader_type, const char *filename)
 
Uint32 GPU_CompileShader (GPU_ShaderEnum shader_type, const char *shader_source)
 
Uint32 GPU_LinkShaderProgram (Uint32 program_object)
 
Uint32 GPU_LinkShaders (Uint32 shader_object1, Uint32 shader_object2)
 
void GPU_FreeShader (Uint32 shader_object)
 
void GPU_FreeShaderProgram (Uint32 program_object)
 
void GPU_AttachShader (Uint32 program_object, Uint32 shader_object)
 
void GPU_DetachShader (Uint32 program_object, Uint32 shader_object)
 
Uint32 GPU_GetCurrentShaderProgram (void)
 
Uint8 GPU_IsDefaultShaderProgram (Uint32 program_object)
 
void GPU_ActivateShaderProgram (Uint32 program_object, GPU_ShaderBlock *block)
 
void GPU_DeactivateShaderProgram (void)
 
const char * GPU_GetShaderMessage (void)
 
int GPU_GetAttributeLocation (Uint32 program_object, const char *attrib_name)
 
GPU_AttributeFormat GPU_MakeAttributeFormat (int num_elems_per_vertex, GPU_TypeEnum type, Uint8 normalize, int stride_bytes, int offset_bytes)
 
GPU_Attribute GPU_MakeAttribute (int location, void *values, GPU_AttributeFormat format)
 
int GPU_GetUniformLocation (Uint32 program_object, const char *uniform_name)
 
GPU_ShaderBlock GPU_LoadShaderBlock (Uint32 program_object, const char *position_name, const char *texcoord_name, const char *color_name, const char *modelViewMatrix_name)
 
void GPU_SetShaderBlock (GPU_ShaderBlock block)
 
void GPU_SetShaderImage (GPU_Image *image, int location, int image_unit)
 
void GPU_GetUniformiv (Uint32 program_object, int location, int *values)
 
void GPU_SetUniformi (int location, int value)
 
void GPU_SetUniformiv (int location, int num_elements_per_value, int num_values, int *values)
 
void GPU_GetUniformuiv (Uint32 program_object, int location, unsigned int *values)
 
void GPU_SetUniformui (int location, unsigned int value)
 
void GPU_SetUniformuiv (int location, int num_elements_per_value, int num_values, unsigned int *values)
 
void GPU_GetUniformfv (Uint32 program_object, int location, float *values)
 
void GPU_SetUniformf (int location, float value)
 
void GPU_SetUniformfv (int location, int num_elements_per_value, int num_values, float *values)
 
void GPU_GetUniformMatrixfv (Uint32 program_object, int location, float *values)
 
void GPU_SetUniformMatrixfv (int location, int num_matrices, int num_rows, int num_columns, Uint8 transpose, float *values)
 
void GPU_SetAttributef (int location, float value)
 
void GPU_SetAttributei (int location, int value)
 
void GPU_SetAttributeui (int location, unsigned int value)
 
void GPU_SetAttributefv (int location, int num_elements, float *value)
 
void GPU_SetAttributeiv (int location, int num_elements, int *value)
 
void GPU_SetAttributeuiv (int location, int num_elements, unsigned int *value)
 
void GPU_SetAttributeSource (int num_values, GPU_Attribute source)
 

Variables

static const GPU_RendererEnum GPU_RENDERER_UNKNOWN = 0x0
 
static const GPU_RendererEnum GPU_RENDERER_OPENGL_1_BASE = 0x1
 
static const GPU_RendererEnum GPU_RENDERER_OPENGL_1 = 0x2
 
static const GPU_RendererEnum GPU_RENDERER_OPENGL_2 = 0x4
 
static const GPU_RendererEnum GPU_RENDERER_OPENGL_3 = 0x8
 
static const GPU_RendererEnum GPU_RENDERER_OPENGL_4 = 0x10
 
static const GPU_RendererEnum GPU_RENDERER_GLES_1 = 0x100
 
static const GPU_RendererEnum GPU_RENDERER_GLES_2 = 0x200
 
static const GPU_RendererEnum GPU_RENDERER_GLES_3 = 0x400
 
static const GPU_RendererEnum GPU_RENDERER_D3D9 = 0x10000
 
static const GPU_RendererEnum GPU_RENDERER_D3D10 = 0x20000
 
static const GPU_RendererEnum GPU_RENDERER_D3D11 = 0x40000
 
static const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1
 
static const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2
 
static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4
 
static const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8
 
static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS_SEPARATE = 0x10
 
static const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x20
 
static const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x40
 
static const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x80
 
static const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100
 
static const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200
 
static const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200
 
static const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400
 
static const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800
 
static const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x10000
 
static const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x20000
 
static const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x40000
 
static const Uint32 GPU_NONE = 0x0
 
static const GPU_BlitFlagEnum GPU_PASSTHROUGH_VERTICES = 0x1
 
static const GPU_BlitFlagEnum GPU_PASSTHROUGH_TEXCOORDS = 0x2
 
static const GPU_BlitFlagEnum GPU_PASSTHROUGH_COLORS = 0x4
 
static const GPU_BlitFlagEnum GPU_USE_DEFAULT_POSITIONS = 0x8
 
static const GPU_BlitFlagEnum GPU_USE_DEFAULT_SRC_RECTS = 0x10
 
static const GPU_BlitFlagEnum GPU_USE_DEFAULT_COLORS = 0x20
 
static const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400
 
static const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401
 
static const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402
 
static const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403
 
static const GPU_TypeEnum GPU_TYPE_INT = 0x1404
 
static const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405
 
static const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406
 
static const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A
 

Macro Definition Documentation

#define GPU_DEFAULT_INIT_FLAGS   0

Definition at line 351 of file SDL_gpu.h.

Referenced by CVideo::initSDL().

#define GPU_FEATURE_ALL_BASE   GPU_FEATURE_RENDER_TARGETS

Combined feature flags

Definition at line 329 of file SDL_gpu.h.

#define GPU_FEATURE_ALL_BLEND_PRESETS   (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE)

Definition at line 330 of file SDL_gpu.h.

#define GPU_FEATURE_ALL_GL_FORMATS   (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR)

Definition at line 331 of file SDL_gpu.h.

Definition at line 333 of file SDL_gpu.h.

#define GPU_FEATURE_BASIC_SHADERS   (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_PIXEL_SHADER)

Definition at line 332 of file SDL_gpu.h.

#define GPU_FEATURE_MASK   0x00FFFF

For separating combined feature flags from init flags.

Definition at line 336 of file SDL_gpu.h.

Referenced by CreateTargetFromWindow().

#define GPU_INIT_MASK   0xFF0000

Definition at line 337 of file SDL_gpu.h.

#define GPU_Log   GPU_LogInfo

Definition at line 891 of file SDL_gpu.h.

#define GPU_MATRIX_STACK_MAX   5

Definition at line 230 of file SDL_gpu.h.

Referenced by GPU_PushMatrix().

Definition at line 368 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), GPU_BlitBatchSeparate(), and GPU_TriangleBatch().

#define GPU_RENDERER_ORDER_MAX   10

Definition at line 33 of file SDL_gpu.h.

Referenced by GPU_GetDefaultRendererOrder(), GPU_Init(), and GPU_SetRendererOrder().

#define SDL_GPU_USE_SDL2

Definition at line 19 of file SDL_gpu.h.

#define SDL_GPU_VERSION_MAJOR   0

Definition at line 14 of file SDL_gpu.h.

Referenced by GPU_GetCompiledVersion().

#define SDL_GPU_VERSION_MINOR   9

Definition at line 15 of file SDL_gpu.h.

Referenced by GPU_GetCompiledVersion().

#define SDL_GPU_VERSION_PATCH   0

Definition at line 16 of file SDL_gpu.h.

Referenced by GPU_GetCompiledVersion().

Typedef Documentation

typedef struct GPU_Attribute GPU_Attribute
typedef struct GPU_BlendMode GPU_BlendMode

Blend mode storage struct

typedef Uint32 GPU_BlitFlagEnum

Bit flags for the blit batch functions.

See also
GPU_BlitBatch()
GPU_BlitBatchSeparate()

Definition at line 360 of file SDL_gpu.h.

typedef struct GPU_Camera GPU_Camera

Camera object that determines viewing transform.

See also
GPU_SetCamera()
GPU_GetDefaultCamera()
GPU_GetCamera()
typedef struct GPU_Context GPU_Context

Rendering context data. Only GPU_Targets which represent windows will store this.

typedef Uint32 GPU_FeatureEnum

Important GPU features which may not be supported depending on a device's extension support. Can be OR'd together.

See also
GPU_IsFeatureEnabled()
GPU_SetPreInitFlags()
GPU_GetPreInitFlags()

Definition at line 313 of file SDL_gpu.h.

typedef struct GPU_Image GPU_Image

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 also
GPU_CreateImage()
GPU_LoadImage()
GPU_CopyImage()
GPU_CopyImageFromSurface()
GPU_Target
typedef Uint32 GPU_InitFlagEnum

Initialization flags for changing default init parameters. Can be bitwise OR'ed together with GPU_FeatureEnums. Default (0) is to use late swap vsync and double buffering.

See also
GPU_SetPreInitFlags()
GPU_GetPreInitFlags()

Definition at line 346 of file SDL_gpu.h.

Matrix stack data structure for replacing the old OpenGL matrix stack.

typedef struct GPU_Rect GPU_Rect

A struct representing a rectangular area with floating point precision.

See also
GPU_MakeRect()
typedef struct GPU_Renderer GPU_Renderer

Definition at line 21 of file SDL_gpu.h.

typedef Uint32 GPU_RendererEnum

Definition at line 35 of file SDL_gpu.h.

Renderer ID object for identifying a specific renderer.

See also
GPU_MakeRendererID()
GPU_InitRendererByID()

Container for the built-in shader attribute and uniform locations (indices).

See also
GPU_LoadShaderBlock()
GPU_SetShaderBlock()
typedef struct GPU_Target GPU_Target

Definition at line 22 of file SDL_gpu.h.

typedef Uint32 GPU_TypeEnum

Type enumeration for GPU_AttributeFormat specifications.

Definition at line 371 of file SDL_gpu.h.

typedef Uint32 GPU_WindowFlagEnum

Definition at line 339 of file SDL_gpu.h.

Enumeration Type Documentation

Blend component equations

See also
GPU_SetBlendEquation() Values chosen for direct OpenGL compatibility.
Enumerator
GPU_EQ_ADD 
GPU_EQ_SUBTRACT 
GPU_EQ_REVERSE_SUBTRACT 

Definition at line 84 of file SDL_gpu.h.

Blend component functions

See also
GPU_SetBlendFunction() Values chosen for direct OpenGL compatibility.
Enumerator
GPU_FUNC_ZERO 
GPU_FUNC_ONE 
GPU_FUNC_SRC_COLOR 
GPU_FUNC_DST_COLOR 
GPU_FUNC_ONE_MINUS_SRC 
GPU_FUNC_ONE_MINUS_DST 
GPU_FUNC_SRC_ALPHA 
GPU_FUNC_DST_ALPHA 
GPU_FUNC_ONE_MINUS_SRC_ALPHA 
GPU_FUNC_ONE_MINUS_DST_ALPHA 

Definition at line 67 of file SDL_gpu.h.

Blend mode presets

See also
GPU_SetBlendMode()
GPU_GetBlendModeFromPreset()
Enumerator
GPU_BLEND_NORMAL 
GPU_BLEND_PREMULTIPLIED_ALPHA 
GPU_BLEND_MULTIPLY 
GPU_BLEND_ADD 
GPU_BLEND_SUBTRACT 
GPU_BLEND_MOD_ALPHA 
GPU_BLEND_SET_ALPHA 
GPU_BLEND_SET 
GPU_BLEND_NORMAL_KEEP_ALPHA 
GPU_BLEND_NORMAL_ADD_ALPHA 

Definition at line 106 of file SDL_gpu.h.

Type enumeration for debug levels.

See also
GPU_SetDebugLevel()
GPU_GetDebugLevel()
Enumerator
GPU_DEBUG_LEVEL_0 
GPU_DEBUG_LEVEL_1 
GPU_DEBUG_LEVEL_2 
GPU_DEBUG_LEVEL_3 
GPU_DEBUG_LEVEL_MAX 

Definition at line 469 of file SDL_gpu.h.

Type enumeration for error codes.

See also
GPU_PushErrorCode()
GPU_PopErrorCode()
Enumerator
GPU_ERROR_NONE 
GPU_ERROR_BACKEND_ERROR 
GPU_ERROR_DATA_ERROR 
GPU_ERROR_USER_ERROR 
GPU_ERROR_UNSUPPORTED_FUNCTION 
GPU_ERROR_NULL_ARGUMENT 
GPU_ERROR_FILE_NOT_FOUND 

Definition at line 446 of file SDL_gpu.h.

Image filtering options. These affect the quality/interpolation of colors when images are scaled.

See also
GPU_SetImageFilter()
Enumerator
GPU_FILTER_NEAREST 
GPU_FILTER_LINEAR 
GPU_FILTER_LINEAR_MIPMAP 

Definition at line 122 of file SDL_gpu.h.

Image format enum

See also
GPU_CreateImage()
Enumerator
GPU_FORMAT_LUMINANCE 
GPU_FORMAT_LUMINANCE_ALPHA 
GPU_FORMAT_RGB 
GPU_FORMAT_RGBA 
GPU_FORMAT_ALPHA 
GPU_FORMAT_RG 
GPU_FORMAT_YCbCr422 
GPU_FORMAT_YCbCr420P 

Definition at line 152 of file SDL_gpu.h.

Shader type enum.

See also
GPU_LoadShader()
GPU_CompileShader()
GPU_CompileShader_RW()
Enumerator
GPU_VERTEX_SHADER 
GPU_FRAGMENT_SHADER 
GPU_PIXEL_SHADER 
GPU_GEOMETRY_SHADER 

Definition at line 392 of file SDL_gpu.h.

Type enumeration for the shader language used by the renderer.

Enumerator
GPU_LANGUAGE_NONE 
GPU_LANGUAGE_ARB_ASSEMBLY 
GPU_LANGUAGE_GLSL 
GPU_LANGUAGE_GLSLES 
GPU_LANGUAGE_HLSL 
GPU_LANGUAGE_CG 

Definition at line 402 of file SDL_gpu.h.

Snap modes. Blitting with these modes will align the sprite with the target's pixel grid.

See also
GPU_SetSnapMode()
GPU_GetSnapMode()
Enumerator
GPU_SNAP_NONE 
GPU_SNAP_POSITION 
GPU_SNAP_DIMENSIONS 
GPU_SNAP_POSITION_AND_DIMENSIONS 

Definition at line 132 of file SDL_gpu.h.

Image wrapping options. These affect how images handle src_rect coordinates beyond their dimensions when blitted.

See also
GPU_SetWrapMode()
Enumerator
GPU_WRAP_NONE 
GPU_WRAP_REPEAT 
GPU_WRAP_MIRRORED 

Definition at line 143 of file SDL_gpu.h.

Function Documentation

void GPU_ActivateShaderProgram ( Uint32  program_object,
GPU_ShaderBlock block 
)

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.

Definition at line 2291 of file SDL_gpu.c.

References GPU_Renderer::ActivateShaderProgram, and GPU_Renderer::current_context_target.

GPU_Renderer* GPU_AddRenderer ( GPU_RendererID  id)

Creates a new renderer matching the given identifier.

Definition at line 364 of file SDL_gpu_Renderer.c.

References GPU_CreateRenderer(), GPU_ERROR_BACKEND_ERROR, GPU_PushErrorCode(), i, GPU_Renderer::id, GPU_RendererID::index, and MAX_ACTIVE_RENDERERS.

Referenced by GPU_InitRendererByID().

void GPU_Arc ( GPU_Target target,
float  x,
float  y,
float  radius,
float  start_angle,
float  end_angle,
SDL_Color  color 
)

Renders a colored arc curve (circle segment).

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
radiusThe radius of the circle / distance from the center point that rendering will occur
start_angleThe angle to start from, in degrees. Measured clockwise from the positive x-axis.
end_angleThe angle to end at, in degrees. Measured clockwise from the positive x-axis.
colorThe color of the shape to render

Definition at line 47 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_ArcFilled ( GPU_Target target,
float  x,
float  y,
float  radius,
float  start_angle,
float  end_angle,
SDL_Color  color 
)

Renders a colored filled arc (circle segment / pie piece).

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
radiusThe radius of the circle / distance from the center point that rendering will occur
start_angleThe angle to start from, in degrees. Measured clockwise from the positive x-axis.
end_angleThe angle to end at, in degrees. Measured clockwise from the positive x-axis.
colorThe color of the shape to render

Definition at line 57 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_AttachShader ( Uint32  program_object,
Uint32  shader_object 
)

Attaches a shader object to a shader program for future linking.

Definition at line 2267 of file SDL_gpu.c.

References GPU_Renderer::AttachShader, and GPU_Renderer::current_context_target.

void GPU_Blit ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y 
)

Draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position

Definition at line 911 of file SDL_gpu.c.

References GPU_Renderer::Blit, Blit(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_BlitBatch ( GPU_Image image,
GPU_Target target,
unsigned int  num_sprites,
float *  values,
GPU_BlitFlagEnum  flags 
)

Performs 'num_sprites' blits of the given image to the given target. Note: GPU_BlitBatch() cannot interpret a mix of normal values and "passthrough" values due to format ambiguity.

Parameters
valuesA tightly-packed array of position (x,y), src_rect (x,y,w,h) values in image coordinates, and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes.
flagsBit flags to control the interpretation of the array parameters. The only passthrough option accepted is GPU_PASSTHROUGH_ALL.

Definition at line 1017 of file SDL_gpu.c.

References GPU_Renderer::BlitBatch, BlitBatch(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, g, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, GPU_PASSTHROUGH_ALL, GPU_PASSTHROUGH_COLORS, GPU_PASSTHROUGH_TEXCOORDS, GPU_PASSTHROUGH_VERTICES, GPU_PushErrorCode(), GPU_USE_DEFAULT_COLORS, GPU_USE_DEFAULT_POSITIONS, GPU_USE_DEFAULT_SRC_RECTS, GPU_Image::h, RETURN_ERROR, GPU_Image::texture_h, GPU_Image::texture_w, and GPU_Image::w.

void GPU_BlitBatchSeparate ( GPU_Image image,
GPU_Target target,
unsigned int  num_sprites,
float *  positions,
float *  src_rects,
float *  colors,
GPU_BlitFlagEnum  flags 
)

Performs 'num_sprites' blits of the given image to the given target.

Parameters
positionsA tightly-packed array of (x,y) values
src_rectsA tightly-packed array of (x,y,w,h) values in image coordinates
colorsA tightly-packed array of (r,g,b,a) values with a range from 0-255
flagsBit flags to control the interpretation of the array parameters

Definition at line 1349 of file SDL_gpu.c.

References GPU_Renderer::BlitBatch, BlitBatch(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, g, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, GPU_PASSTHROUGH_ALL, GPU_PASSTHROUGH_COLORS, GPU_PASSTHROUGH_TEXCOORDS, GPU_PASSTHROUGH_VERTICES, GPU_Image::h, RETURN_ERROR, GPU_Image::texture_h, GPU_Image::texture_w, and GPU_Image::w.

void GPU_BlitRotate ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  degrees 
)

Rotates and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position
degreesRotation angle (in degrees)

Definition at line 929 of file SDL_gpu.c.

References GPU_Renderer::BlitRotate, BlitRotate(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_BlitScale ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  scaleX,
float  scaleY 
)

Scales and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 946 of file SDL_gpu.c.

References GPU_Renderer::BlitScale, BlitScale(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_BlitTransform ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  degrees,
float  scaleX,
float  scaleY 
)

Scales, rotates, and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position
degreesRotation angle (in degrees)
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 963 of file SDL_gpu.c.

References GPU_Renderer::BlitTransform, BlitTransform(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_BlitTransformMatrix ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float *  matrix3x3 
)

Transforms and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position
matrix3x33x3 matrix in column-major order (index = row + column*numColumns)

Definition at line 997 of file SDL_gpu.c.

References GPU_Renderer::BlitTransformMatrix, BlitTransformMatrix(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_BlitTransformX ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  pivot_x,
float  pivot_y,
float  degrees,
float  scaleX,
float  scaleY 
)

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).

Parameters
src_rectThe region of the source image to use.
xDestination x-position
yDestination y-position
pivot_xPivot x-position (in image coordinates)
pivot_yPivot y-position (in image coordinates)
degreesRotation angle (in degrees)
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 980 of file SDL_gpu.c.

References GPU_Renderer::BlitTransformX, BlitTransformX(), CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, and RETURN_ERROR.

void GPU_Circle ( GPU_Target target,
float  x,
float  y,
float  radius,
SDL_Color  color 
)

Renders a colored circle outline.

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
radiusThe radius of the circle / distance from the center point that rendering will occur
colorThe color of the shape to render

Definition at line 66 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_CircleFilled ( GPU_Target target,
float  x,
float  y,
float  radius,
SDL_Color  color 
)

Renders a colored filled circle.

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
radiusThe radius of the circle / distance from the center point that rendering will occur
colorThe color of the shape to render

Definition at line 75 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_Clear ( GPU_Target target)

Clears the contents of the given render target. Fills the target with color {0, 0, 0, 0}.

Definition at line 2148 of file SDL_gpu.c.

References GPU_Renderer::Clear, and GPU_Renderer::current_context_target.

void GPU_ClearColor ( GPU_Target target,
SDL_Color *  color 
)

Fills the given render target with a color. If 'color' is NULL, {0, 0, 0, 0} is used.

Definition at line 2156 of file SDL_gpu.c.

References GPU_Renderer::ClearRGBA, GPU_Renderer::current_context_target, and GET_ALPHA.

void GPU_ClearRGBA ( GPU_Target target,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Fills the given render target with a color.

Definition at line 2167 of file SDL_gpu.c.

References GPU_Renderer::ClearRGBA, and GPU_Renderer::current_context_target.

void GPU_CloseCurrentRenderer ( void  )

Clean up the renderer state.

Definition at line 452 of file SDL_gpu.c.

References GPU_RemoveRenderer(), GPU_Renderer::id, and GPU_Renderer::Quit.

Referenced by GPU_InitRendererByID().

Uint32 GPU_CompileShader ( GPU_ShaderEnum  shader_type,
const char *  shader_source 
)

Compiles shader source and returns the new shader object.

Definition at line 2227 of file SDL_gpu.c.

References GPU_Renderer::CompileShader, and GPU_Renderer::current_context_target.

Uint32 GPU_CompileShader_RW ( GPU_ShaderEnum  shader_type,
SDL_RWops *  shader_source 
)

Loads shader source from an SDL_RWops, compiles it, and returns the new shader object.

Definition at line 2198 of file SDL_gpu.c.

References GPU_Renderer::CompileShader_RW, and GPU_Renderer::current_context_target.

Referenced by GPU_LoadShader().

GPU_Image* GPU_CopyImage ( GPU_Image image)

Copy an image to a new image. Don't forget to GPU_FreeImage() both.

Definition at line 684 of file SDL_gpu.c.

References GPU_Renderer::CopyImage, and GPU_Renderer::current_context_target.

GPU_Image* GPU_CopyImageFromSurface ( SDL_Surface *  surface)

Copy SDL_Surface data into a new GPU_Image. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.

Definition at line 841 of file SDL_gpu.c.

References GPU_Renderer::CopyImageFromSurface, and GPU_Renderer::current_context_target.

GPU_Image* GPU_CopyImageFromTarget ( GPU_Target target)

Copy GPU_Target data into a new GPU_Image. Don't forget to GPU_FreeImage() the image.

Definition at line 849 of file SDL_gpu.c.

References GPU_Renderer::CopyImageFromTarget, and GPU_Renderer::current_context_target.

SDL_Surface* GPU_CopySurfaceFromImage ( GPU_Image image)

Copy GPU_Image data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface and GPU_FreeImage() the image.

Definition at line 865 of file SDL_gpu.c.

References GPU_Renderer::CopySurfaceFromImage, and GPU_Renderer::current_context_target.

SDL_Surface* GPU_CopySurfaceFromTarget ( GPU_Target target)

Copy GPU_Target data into a new SDL_Surface. Don't forget to SDL_FreeSurface() the surface.

Definition at line 857 of file SDL_gpu.c.

References GPU_Renderer::CopySurfaceFromTarget, and GPU_Renderer::current_context_target.

GPU_Image* GPU_CreateAliasImage ( GPU_Image image)

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.

Definition at line 668 of file SDL_gpu.c.

References GPU_Renderer::CreateAliasImage, and GPU_Renderer::current_context_target.

GPU_Target* GPU_CreateAliasTarget ( GPU_Target target)

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.

Definition at line 403 of file SDL_gpu.c.

References GPU_Renderer::CreateAliasTarget, and GPU_Renderer::current_context_target.

GPU_Image* GPU_CreateImage ( Uint16  w,
Uint16  h,
GPU_FormatEnum  format 
)

Create a new, blank image with the given format. Don't forget to GPU_FreeImage() it.

Parameters
wImage width in pixels
hImage height in pixels
formatFormat of color channels.

Definition at line 652 of file SDL_gpu.c.

References GPU_Renderer::CreateImage, and GPU_Renderer::current_context_target.

GPU_Target* GPU_CreateTargetFromWindow ( Uint32  windowID)

Creates a separate context for the given window using the current renderer and returns a GPU_Target that represents it.

Definition at line 395 of file SDL_gpu.c.

References GPU_Renderer::CreateTargetFromWindow, and GPU_Renderer::current_context_target.

void GPU_DeactivateShaderProgram ( void  )

Deactivates the current shader program (activates program 0).

Definition at line 2299 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::DeactivateShaderProgram.

void GPU_DetachShader ( Uint32  program_object,
Uint32  shader_object 
)

Detaches a shader object from a shader program.

Definition at line 2275 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::DetachShader.

void GPU_Flip ( GPU_Target target)

Updates the given target's associated window.

Definition at line 2183 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::Flip.

Referenced by CVideo::flip().

void GPU_FlushBlitBuffer ( void  )

Send all buffered blitting data to the current context target.

Definition at line 2175 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::FlushBlitBuffer.

void GPU_FreeImage ( GPU_Image image)

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!

Definition at line 873 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::FreeImage.

Referenced by CopyImage().

void GPU_FreeShader ( Uint32  shader_object)

Deletes a shader object.

Definition at line 2251 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::FreeShader.

void GPU_FreeShaderProgram ( Uint32  program_object)

Deletes a shader program.

Definition at line 2259 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::FreeShaderProgram.

void GPU_FreeTarget ( GPU_Target target)

Deletes a render target in the proper way for this renderer.

Definition at line 901 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::FreeTarget.

void GPU_GenerateMipmaps ( GPU_Image image)

Loads mipmaps for the given image, if supported by the renderer.

Definition at line 1800 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GenerateMipmaps.

Referenced by CopyImage().

void GPU_GetActiveRendererList ( GPU_RendererID renderers_array)

Gets an array of identifiers for the active renderers.

Definition at line 53 of file SDL_gpu_Renderer.c.

References GPU_InitRendererRegister(), i, GPU_Renderer::id, and MAX_ACTIVE_RENDERERS.

int GPU_GetAttributeLocation ( Uint32  program_object,
const char *  attrib_name 
)

Returns an integer representing the location of the specified attribute shader variable.

Definition at line 2315 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetAttributeLocation.

Uint8 GPU_GetBlending ( GPU_Image image)

Gets the current alpha blending setting.

Definition at line 1922 of file SDL_gpu.c.

References GPU_Image::use_blending.

GPU_BlendMode GPU_GetBlendModeFromPreset ( GPU_BlendPresetEnum  preset)
GPU_Camera GPU_GetCamera ( GPU_Target target)
Returns
The camera of the given render target. If target is NULL, returns the default camera.

Definition at line 637 of file SDL_gpu.c.

References GPU_Target::camera, and GPU_GetDefaultCamera().

static SDL_version GPU_GetCompiledVersion ( void  )
inlinestatic

Definition at line 809 of file SDL_gpu.h.

References SDL_GPU_VERSION_MAJOR, SDL_GPU_VERSION_MINOR, and SDL_GPU_VERSION_PATCH.

Referenced by GPU_GetLinkedVersion().

GPU_Target* GPU_GetContextTarget ( void  )
GPU_Renderer* GPU_GetCurrentRenderer ( void  )
Returns
The current renderer

Definition at line 64 of file SDL_gpu.c.

References current_renderer.

Uint32 GPU_GetCurrentShaderProgram ( void  )
Returns
The current shader program

Definition at line 69 of file SDL_gpu.c.

References GPU_Target::context, GPU_Renderer::current_context_target, and GPU_Context::current_shader_program.

GPU_DebugLevelEnum GPU_GetDebugLevel ( void  )

Returns the current global debug level.

Definition at line 498 of file SDL_gpu.c.

References debug_level.

Referenced by GPU_LogInfo(), GPU_LogWarning(), GPU_PushErrorCode(), and GPU_Quit().

GPU_Camera GPU_GetDefaultCamera ( void  )
Returns
A GPU_Camera with position (0, 0, -10), angle of 0, and zoom of 1.

Definition at line 631 of file SDL_gpu.c.

Referenced by CreateTargetFromWindow(), GPU_GetCamera(), GPU_SetCamera(), LoadTarget(), and SetCamera().

void GPU_GetDefaultRendererOrder ( int order_size,
GPU_RendererID order 
)

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.

Definition at line 267 of file SDL_gpu_Renderer.c.

References GPU_MakeRendererID(), GPU_RENDERER_GLES_1, GPU_RENDERER_GLES_2, GPU_RENDERER_OPENGL_1, GPU_RENDERER_OPENGL_2, GPU_RENDERER_OPENGL_3, and GPU_RENDERER_ORDER_MAX.

Referenced by GPU_InitRendererRegister(), and GPU_SetRendererOrder().

const char* GPU_GetErrorString ( GPU_ErrorEnum  error)

Gets the string representation of an error code.

Definition at line 556 of file SDL_gpu.c.

References GPU_ERROR_BACKEND_ERROR, GPU_ERROR_DATA_ERROR, GPU_ERROR_FILE_NOT_FOUND, GPU_ERROR_NONE, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, and GPU_ERROR_USER_ERROR.

Referenced by GPU_PushErrorCode().

Uint32 GPU_GetInitWindow ( void  )

Returns the window ID that has been set via GPU_SetInitWindow().

Definition at line 150 of file SDL_gpu.c.

References init_windowID.

Referenced by Init().

float GPU_GetLineThickness ( void  )

Returns the current line thickness value.

Definition at line 19 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

SDL_version GPU_GetLinkedVersion ( void  )

Definition at line 51 of file SDL_gpu.c.

References GPU_GetCompiledVersion().

int GPU_GetNumActiveRenderers ( void  )

Gets the number of active (created) renderers.

Definition at line 37 of file SDL_gpu_Renderer.c.

References GPU_InitRendererRegister(), i, and MAX_ACTIVE_RENDERERS.

Referenced by GPU_Quit(), and init_SDL().

int GPU_GetNumRegisteredRenderers ( void  )

Gets the number of registered (available) renderers.

Definition at line 72 of file SDL_gpu_Renderer.c.

References GPU_InitRendererRegister(), GPU_RENDERER_UNKNOWN, i, and MAX_REGISTERED_RENDERERS.

SDL_Color GPU_GetPixel ( GPU_Target target,
Sint16  x,
Sint16  y 
)
Returns
The RGBA color of a pixel.

Definition at line 2131 of file SDL_gpu.c.

References c, GPU_Renderer::current_context_target, and GPU_Renderer::GetPixel.

GPU_InitFlagEnum GPU_GetPreInitFlags ( void  )

Returns the current special flags to use for initialization.

Definition at line 162 of file SDL_gpu.c.

References preinit_flags.

Referenced by Init().

void GPU_GetRegisteredRendererList ( GPU_RendererID renderers_array)

Gets an array of identifiers for the registered (available) renderers.

Definition at line 88 of file SDL_gpu_Renderer.c.

References GPU_InitRendererRegister(), GPU_RENDERER_UNKNOWN, i, RendererRegistration::id, and MAX_REGISTERED_RENDERERS.

GPU_Renderer* GPU_GetRenderer ( unsigned int  index)

Gets the renderer for the given renderer index.

Definition at line 344 of file SDL_gpu_Renderer.c.

References MAX_ACTIVE_RENDERERS.

Referenced by GPU_GetRendererByID().

GPU_Renderer* GPU_GetRendererByID ( GPU_RendererID  id)
Returns
The renderer matching the given identifier.

Definition at line 353 of file SDL_gpu_Renderer.c.

References GPU_GetRenderer(), and GPU_InitRendererRegister().

Referenced by GPU_SetCurrentRenderer().

const char* GPU_GetRendererEnumString ( GPU_RendererEnum  id)
GPU_RendererID GPU_GetRendererID ( unsigned int  index)

Gets the renderer identifier for the given registration index.

Definition at line 107 of file SDL_gpu_Renderer.c.

References GPU_RENDERER_UNKNOWN, RendererRegistration::id, makeRendererID(), and MAX_REGISTERED_RENDERERS.

void GPU_GetRendererOrder ( int order_size,
GPU_RendererID order 
)

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.

Definition at line 231 of file SDL_gpu_Renderer.c.

References renderer_order_size.

Referenced by GPU_Init().

const char* GPU_GetShaderMessage ( void  )

Returns the last shader log message.

Definition at line 2307 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetShaderMessage.

GPU_SnapEnum GPU_GetSnapMode ( GPU_Image image)

Gets the current pixel snap setting. The default value is GPU_SNAP_POSITION_AND_DIMENSIONS.

Definition at line 2104 of file SDL_gpu.c.

References GPU_Image::snap_mode.

void GPU_GetUniformfv ( Uint32  program_object,
int  location,
float *  values 
)

Fills "values" with the value of the uniform shader variable at the given location.

Definition at line 2427 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetUniformfv.

void GPU_GetUniformiv ( Uint32  program_object,
int  location,
int values 
)

Fills "values" with the value of the uniform shader variable at the given location.

Definition at line 2377 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetUniformiv.

int GPU_GetUniformLocation ( Uint32  program_object,
const char *  uniform_name 
)

Returns an integer representing the location of the specified uniform shader variable.

Definition at line 2338 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetUniformLocation.

void GPU_GetUniformMatrixfv ( Uint32  program_object,
int  location,
float *  values 
)

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.

Definition at line 2452 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetUniformfv.

void GPU_GetUniformuiv ( Uint32  program_object,
int  location,
unsigned int values 
)

Fills "values" with the value of the uniform shader variable at the given location.

Definition at line 2402 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::GetUniformuiv.

void GPU_GetVirtualCoords ( GPU_Target target,
float *  x,
float *  y,
float  displayX,
float  displayY 
)

Converts screen space coordinates (such as from mouse input) to logical drawing coordinates.

Definition at line 579 of file SDL_gpu.c.

References GPU_Target::context, GPU_Image::h, GPU_Target::h, GPU_Target::image, GPU_Image::w, GPU_Target::w, GPU_Context::window_h, and GPU_Context::window_w.

GPU_Target* GPU_GetWindowTarget ( Uint32  windowID)
Returns
The target that is associated with the given windowID.

Definition at line 305 of file SDL_gpu.c.

References i, init_window_mappings(), num_window_mappings, and GPU_WindowMapping::target.

GPU_Target* GPU_Init ( Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

Initializes SDL and SDL_gpu. Creates a window and goes through the renderer order to create a renderer context.

See also
GPU_SetRendererOrder()

Definition at line 325 of file SDL_gpu.c.

References GPU_GetRendererOrder(), GPU_InitRendererByID(), GPU_InitRendererRegister(), GPU_RENDERER_ORDER_MAX, i, init_error_stack(), init_SDL(), renderer_order, renderer_order_size, and resources::screen.

Referenced by CVideo::initSDL().

GPU_Target* GPU_InitRenderer ( GPU_RendererEnum  renderer_enum,
Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

Initializes SDL and SDL_gpu. Creates a window and the requested renderer context.

Definition at line 352 of file SDL_gpu.c.

References GPU_InitRendererByID(), and GPU_MakeRendererID().

GPU_Target* GPU_InitRendererByID ( GPU_RendererID  renderer_request,
Uint16  w,
Uint16  h,
GPU_WindowFlagEnum  SDL_flags 
)

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 also
GPU_MakeRendererID

Definition at line 357 of file SDL_gpu.c.

References GPU_AddRenderer(), GPU_CloseCurrentRenderer(), GPU_InitRendererRegister(), GPU_SetCurrentRenderer(), GPU_SetInitWindow(), GPU_Renderer::id, GPU_Renderer::Init, init_error_stack(), init_SDL(), num_window_mappings, and resources::screen.

Referenced by GPU_Init(), and GPU_InitRenderer().

Uint8 GPU_IsDefaultShaderProgram ( Uint32  program_object)

Returns 1 if the given shader program is a default shader for the current context, 0 otherwise.

Definition at line 2283 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::IsDefaultShaderProgram.

Uint8 GPU_IsFeatureEnabled ( GPU_FeatureEnum  feature)

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.

Returns
1 if all of the passed features are enabled/supported
0 if any of the passed features are disabled/unsupported

Definition at line 387 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::IsFeatureEnabled.

void GPU_Line ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
SDL_Color  color 
)

Renders a colored line.

Parameters
targetThe destination render target
x1x-coord of starting point
y1y-coord of starting point
x2x-coord of ending point
y2y-coord of ending point
colorThe color of the shape to render

Definition at line 37 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

Uint32 GPU_LinkShaderProgram ( Uint32  program_object)

Links a shader program with any attached shader objects.

Definition at line 2235 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::LinkShaderProgram.

Uint32 GPU_LinkShaders ( Uint32  shader_object1,
Uint32  shader_object2 
)

Creates and links a shader program with the given shader objects.

Definition at line 2243 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::LinkShaders.

GPU_Image* GPU_LoadImage ( const char *  filename)

Load image from an image file that is supported by this renderer. Don't forget to GPU_FreeImage() it.

Definition at line 660 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::LoadImage.

Uint32 GPU_LoadShader ( GPU_ShaderEnum  shader_type,
const char *  filename 
)

Loads shader source from a file, compiles it, and returns the new shader object.

Definition at line 2206 of file SDL_gpu.c.

References GPU_CompileShader_RW(), GPU_ERROR_FILE_NOT_FOUND, GPU_ERROR_NULL_ARGUMENT, and GPU_PushErrorCode().

GPU_ShaderBlock GPU_LoadShaderBlock ( Uint32  program_object,
const char *  position_name,
const char *  texcoord_name,
const char *  color_name,
const char *  modelViewMatrix_name 
)
SDL_Surface* GPU_LoadSurface ( const char *  filename)

Load surface from an image file that is supported by this renderer. Don't forget to SDL_FreeSurface() it.

Definition at line 716 of file SDL_gpu.c.

References GPU_ERROR_DATA_ERROR, GPU_ERROR_NULL_ARGUMENT, GPU_PushErrorCode(), stbi_failure_reason(), stbi_image_free(), stbi_load(), and stbi_load_from_memory().

Referenced by LoadImage().

GPU_Target* GPU_LoadTarget ( GPU_Image image)

Creates a new render target from the given image. It can then be accessed from image->target.

Definition at line 891 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::LoadTarget.

Referenced by CopyImage().

void GPU_LogError ( const char *  format,
  ... 
)

Prints an error log message.

Definition at line 103 of file SDL_gpu.c.

Referenced by GPU_PushErrorCode(), and GPU_Quit().

void GPU_LogInfo ( const char *  format,
  ... 
)

Prints an informational log message.

Definition at line 79 of file SDL_gpu.c.

References GPU_DEBUG_LEVEL_3, and GPU_GetDebugLevel().

void GPU_LogWarning ( const char *  format,
  ... 
)

Prints a warning log message.

Definition at line 91 of file SDL_gpu.c.

References GPU_DEBUG_LEVEL_2, and GPU_GetDebugLevel().

GPU_Attribute GPU_MakeAttribute ( int  location,
void values,
GPU_AttributeFormat  format 
)

Returns a filled GPU_Attribute object.

Definition at line 2329 of file SDL_gpu.c.

References GPU_Attribute::format, GPU_Attribute::location, and GPU_Attribute::values.

GPU_AttributeFormat GPU_MakeAttributeFormat ( int  num_elems_per_vertex,
GPU_TypeEnum  type,
Uint8  normalize,
int  stride_bytes,
int  offset_bytes 
)

Returns a filled GPU_AttributeFormat object.

Definition at line 2323 of file SDL_gpu.c.

SDL_Color GPU_MakeColor ( Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)
Returns
An SDL_Color with the given values.

Definition at line 613 of file SDL_gpu.c.

References c, and g.

void GPU_MakeCurrent ( GPU_Target target,
Uint32  windowID 
)

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.

Definition at line 411 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::MakeCurrent.

GPU_Rect GPU_MakeRect ( float  x,
float  y,
float  w,
float  h 
)
Returns
A GPU_Rect with the given values.

Definition at line 607 of file SDL_gpu.c.

Referenced by CreateTargetFromWindow(), LoadTarget(), and SetWindowResolution().

GPU_RendererID GPU_MakeRendererID ( GPU_RendererEnum  id,
int  major_version,
int  minor_version 
)

Returns an initialized GPU_RendererID.

Definition at line 619 of file SDL_gpu.c.

Referenced by GPU_GetDefaultRendererOrder(), and GPU_InitRenderer().

void GPU_Pixel ( GPU_Target target,
float  x,
float  y,
SDL_Color  color 
)

Renders a colored point.

Parameters
targetThe destination render target
xx-coord of the point
yy-coord of the point
colorThe color of the shape to render

Definition at line 28 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_Polygon ( GPU_Target target,
unsigned int  num_vertices,
float *  vertices,
SDL_Color  color 
)

Renders a colored polygon outline. The vertices are expected to define a convex polygon.

Parameters
targetThe destination render target
num_verticesNumber of vertices (x and y pairs)
verticesAn array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
colorThe color of the shape to render

Definition at line 156 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_PolygonFilled ( GPU_Target target,
unsigned int  num_vertices,
float *  vertices,
SDL_Color  color 
)

Renders a colored filled polygon. The vertices are expected to define a convex polygon.

Parameters
targetThe destination render target
num_verticesNumber of vertices (x and y pairs)
verticesAn array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...}
colorThe color of the shape to render

Definition at line 165 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

GPU_ErrorObject GPU_PopErrorCode ( void  )

Pops an error object from the error stack and returns it. If the error stack is empty, it returns an error object with NULL function, GPU_ERROR_NONE error, and NULL details.

Definition at line 545 of file SDL_gpu.c.

References e, GPU_ERROR_NONE, and num_error_codes.

void GPU_PushErrorCode ( const char *  function,
GPU_ErrorEnum  error,
const char *  details,
  ... 
)
void GPU_Quit ( void  )
void GPU_Rectangle ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
SDL_Color  color 
)

Renders a colored rectangle outline.

Parameters
targetThe destination render target
x1x-coord of top-left corner
y1y-coord of top-left corner
x2x-coord of bottom-right corner
y2y-coord of bottom-right corner
colorThe color of the shape to render

Definition at line 120 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_RectangleFilled ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
SDL_Color  color 
)

Renders a colored filled rectangle.

Parameters
targetThe destination render target
x1x-coord of top-left corner
y1y-coord of top-left corner
x2x-coord of bottom-right corner
y2y-coord of bottom-right corner
colorThe color of the shape to render

Definition at line 129 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_RectangleRound ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
float  radius,
SDL_Color  color 
)

Renders a colored rounded (filleted) rectangle outline.

Parameters
targetThe destination render target
x1x-coord of top-left corner
y1y-coord of top-left corner
x2x-coord of bottom-right corner
y2y-coord of bottom-right corner
radiusThe radius of the corners
colorThe color of the shape to render

Definition at line 138 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_RectangleRoundFilled ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
float  radius,
SDL_Color  color 
)

Renders a colored filled rounded (filleted) rectangle.

Parameters
targetThe destination render target
x1x-coord of top-left corner
y1y-coord of top-left corner
x2x-coord of bottom-right corner
y2y-coord of bottom-right corner
radiusThe radius of the corners
colorThe color of the shape to render

Definition at line 147 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_RemoveRenderer ( GPU_RendererID  id)

Deletes the renderer matching the given identifier.

Definition at line 407 of file SDL_gpu_Renderer.c.

References GPU_FreeRenderer(), i, and MAX_ACTIVE_RENDERERS.

Referenced by GPU_CloseCurrentRenderer(), and GPU_Quit().

Uint8 GPU_SaveImage ( GPU_Image image,
const char *  filename 
)

Save image to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure.

Definition at line 676 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SaveImage.

Uint8 GPU_SaveSurface ( SDL_Surface *  surface,
const char *  filename 
)

Save surface to a file. The file type is deduced from the extension. Supported formats are: png, bmp, tga. Returns 0 on failure.

Definition at line 810 of file SDL_gpu.c.

References get_filename_ext(), GPU_ERROR_DATA_ERROR, GPU_PushErrorCode(), stbi_write_bmp(), stbi_write_png(), and stbi_write_tga().

void GPU_Sector ( GPU_Target target,
float  x,
float  y,
float  inner_radius,
float  outer_radius,
float  start_angle,
float  end_angle,
SDL_Color  color 
)

Renders a colored annular sector outline (ring segment).

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
inner_radiusThe inner radius of the ring
outer_radiusThe outer radius of the ring
start_angleThe angle to start from, in degrees. Measured clockwise from the positive x-axis.
end_angleThe angle to end at, in degrees. Measured clockwise from the positive x-axis.
colorThe color of the shape to render

Definition at line 84 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_SectorFilled ( GPU_Target target,
float  x,
float  y,
float  inner_radius,
float  outer_radius,
float  start_angle,
float  end_angle,
SDL_Color  color 
)

Renders a colored filled annular sector (ring segment).

Parameters
targetThe destination render target
xx-coord of center point
yy-coord of center point
inner_radiusThe inner radius of the ring
outer_radiusThe outer radius of the ring
start_angleThe angle to start from, in degrees. Measured clockwise from the positive x-axis.
end_angleThe angle to end at, in degrees. Measured clockwise from the positive x-axis.
colorThe color of the shape to render

Definition at line 93 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_SetAttributef ( int  location,
float  value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2469 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributef.

void GPU_SetAttributefv ( int  location,
int  num_elements,
float *  value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2493 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributefv.

void GPU_SetAttributei ( int  location,
int  value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2477 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributei.

void GPU_SetAttributeiv ( int  location,
int  num_elements,
int value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2501 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributeiv.

void GPU_SetAttributeSource ( int  num_values,
GPU_Attribute  source 
)

Enables a shader attribute and sets its source data.

Definition at line 2517 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributeSource.

void GPU_SetAttributeui ( int  location,
unsigned int  value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2485 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributeui.

void GPU_SetAttributeuiv ( int  location,
int  num_elements,
unsigned int value 
)

Sets a constant-value shader attribute that will be used for each rendered vertex.

Definition at line 2509 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetAttributeuiv.

void GPU_SetBlendEquation ( GPU_Image image,
GPU_BlendEqEnum  color_equation,
GPU_BlendEqEnum  alpha_equation 
)

Sets the blending component equations.

Definition at line 2037 of file SDL_gpu.c.

References GPU_BlendMode::alpha_equation, GPU_Image::blend_mode, and GPU_BlendMode::color_equation.

Referenced by GPU_SetBlendMode().

void GPU_SetBlendFunction ( GPU_Image image,
GPU_BlendFuncEnum  source_color,
GPU_BlendFuncEnum  dest_color,
GPU_BlendFuncEnum  source_alpha,
GPU_BlendFuncEnum  dest_alpha 
)

Sets the blending component functions.

Definition at line 2026 of file SDL_gpu.c.

References GPU_Image::blend_mode, GPU_BlendMode::dest_alpha, GPU_BlendMode::dest_color, GPU_BlendMode::source_alpha, and GPU_BlendMode::source_color.

Referenced by GPU_SetBlendMode().

void GPU_SetBlending ( GPU_Image image,
Uint8  enable 
)

Enables/disables alpha blending for the given image.

Definition at line 1931 of file SDL_gpu.c.

References GPU_Image::use_blending.

Referenced by CopyImage().

void GPU_SetBlendMode ( GPU_Image image,
GPU_BlendPresetEnum  mode 
)
GPU_Camera GPU_SetCamera ( GPU_Target target,
GPU_Camera cam 
)

Sets the current render target's current camera.

Parameters
targetA pointer to the target that will copy this camera.
camA pointer to the camera data to use or NULL to use the default camera.
Returns
The old camera.

Definition at line 644 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, GPU_GetDefaultCamera(), and GPU_Renderer::SetCamera.

GPU_Rect GPU_SetClip ( GPU_Target target,
Sint16  x,
Sint16  y,
Uint16  w,
Uint16  h 
)

Sets the clipping rect for the given render target.

Definition at line 1822 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetClip.

Referenced by dialogs::unit_preview_pane::draw_contents(), gui::menu::imgsel_style::draw_row(), and display::drawing_buffer_commit().

GPU_Rect GPU_SetClipRect ( GPU_Target target,
GPU_Rect  rect 
)

Sets the clipping rect for the given render target.

Definition at line 1811 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, GPU_Rect::h, GPU_Renderer::SetClip, GPU_Rect::w, GPU_Rect::x, and GPU_Rect::y.

void GPU_SetColor ( GPU_Image image,
SDL_Color *  color 
)

Sets the modulation color for subsequent drawing of the given image.

Definition at line 1844 of file SDL_gpu.c.

References c, and GPU_Image::color.

Referenced by CopyImage().

void GPU_SetCurrentRenderer ( GPU_RendererID  id)

Switches the current renderer to the renderer matching the given identifier.

Definition at line 56 of file SDL_gpu.c.

References GPU_GetRendererByID(), and GPU_Renderer::SetAsCurrent.

Referenced by GPU_InitRendererByID().

void GPU_SetDebugLevel ( GPU_DebugLevelEnum  level)

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

Definition at line 491 of file SDL_gpu.c.

References debug_level, and GPU_DEBUG_LEVEL_MAX.

void GPU_SetImageFilter ( GPU_Image image,
GPU_FilterEnum  filter 
)

Sets the image filtering mode, if supported by the renderer.

Definition at line 2094 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetImageFilter.

Referenced by CopyImage().

void GPU_SetInitWindow ( Uint32  windowID)

The window corresponding to 'windowID' will be used to create the rendering context instead of creating a new window.

Definition at line 145 of file SDL_gpu.c.

References init_windowID.

Referenced by GPU_InitRendererByID(), and Init().

float GPU_SetLineThickness ( float  thickness)

Sets the thickness of lines for the current context.

Parameters
thicknessNew line thickness in pixels measured across the line. Default is 1.0f.
Returns
The old thickness value

Definition at line 10 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_SetPreInitFlags ( GPU_InitFlagEnum  GPU_flags)

Set special flags to use for initialization. Set these before calling GPU_Init().

Parameters
GPU_flagsAn OR'ed combination of GPU_InitFlagEnum flags and GPU_FeatureEnum flags. GPU_FeatureEnum flags will force GPU_Init() to create a renderer that supports all of the given flags or else fail. Default flags (0) enable late swap vsync and double buffering.

Definition at line 157 of file SDL_gpu.c.

References preinit_flags.

void GPU_SetRendererOrder ( int  order_size,
GPU_RendererID order 
)

Sets the renderer ID order to use for initialization. If 'order' is NULL, it will restore the default order.

Definition at line 240 of file SDL_gpu_Renderer.c.

References GPU_ERROR_USER_ERROR, GPU_GetDefaultRendererOrder(), GPU_PushErrorCode(), GPU_RENDERER_ORDER_MAX, and renderer_order_size.

void GPU_SetRGB ( GPU_Image image,
Uint8  r,
Uint8  g,
Uint8  b 
)

Sets the modulation color for subsequent drawing of the given image.

Definition at line 1858 of file SDL_gpu.c.

References c, GPU_Image::color, and g.

void GPU_SetRGBA ( GPU_Image image,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Sets the modulation color for subsequent drawing of the given image.

Definition at line 1868 of file SDL_gpu.c.

References c, GPU_Image::color, and g.

void GPU_SetShaderBlock ( GPU_ShaderBlock  block)

Sets the current shader block to use the given attribute and uniform locations.

Definition at line 2361 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetShaderBlock.

Referenced by CreateTargetFromWindow().

void GPU_SetShaderImage ( GPU_Image image,
int  location,
int  image_unit 
)

Sets the given image unit to the given image so that a custom shader can sample multiple textures.

Parameters
imageThe source image/texture. Pass NULL to disable the image unit.
locationThe uniform location of a texture sampler
image_unitThe 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.

Definition at line 2369 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetShaderImage.

void GPU_SetShapeBlendEquation ( GPU_BlendEqEnum  color_equation,
GPU_BlendEqEnum  alpha_equation 
)

Sets the blending component equations for shape rendering.

Definition at line 2071 of file SDL_gpu.c.

References GPU_BlendMode::alpha_equation, GPU_BlendMode::color_equation, GPU_Target::context, GPU_Renderer::current_context_target, and GPU_Context::shapes_blend_mode.

Referenced by GPU_SetShapeBlendMode().

void GPU_SetShapeBlendFunction ( GPU_BlendFuncEnum  source_color,
GPU_BlendFuncEnum  dest_color,
GPU_BlendFuncEnum  source_alpha,
GPU_BlendFuncEnum  dest_alpha 
)
void GPU_SetShapeBlending ( Uint8  enable)

Enables/disables alpha blending for shape rendering on the current window.

Definition at line 1939 of file SDL_gpu.c.

References GPU_Target::context, GPU_Renderer::current_context_target, and GPU_Context::shapes_use_blending.

void GPU_SetShapeBlendMode ( GPU_BlendPresetEnum  mode)
void GPU_SetSnapMode ( GPU_Image image,
GPU_SnapEnum  mode 
)

Sets the pixel grid snapping mode for the given image.

Definition at line 2112 of file SDL_gpu.c.

References GPU_Image::snap_mode.

Referenced by CopyImage().

void GPU_SetTargetColor ( GPU_Target target,
SDL_Color *  color 
)

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).

Definition at line 1878 of file SDL_gpu.c.

References GPU_Target::color, and GPU_Target::use_color.

void GPU_SetTargetRGB ( GPU_Target target,
Uint8  r,
Uint8  g,
Uint8  b 
)

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).

Definition at line 1892 of file SDL_gpu.c.

References c, GPU_Target::color, g, and GPU_Target::use_color.

void GPU_SetTargetRGBA ( GPU_Target target,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

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).

Definition at line 1907 of file SDL_gpu.c.

References c, GPU_Target::color, g, and GPU_Target::use_color.

void GPU_SetUniformf ( int  location,
float  value 
)

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).

Definition at line 2435 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformf.

void GPU_SetUniformfv ( int  location,
int  num_elements_per_value,
int  num_values,
float *  values 
)

Sets the value of the floating point uniform shader variable at the given location.

Definition at line 2443 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformfv.

void GPU_SetUniformi ( int  location,
int  value 
)

Sets the value of the integer uniform shader variable at the given location. This is equivalent to calling GPU_SetUniformiv(location, 1, 1, &value).

Definition at line 2385 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformi.

void GPU_SetUniformiv ( int  location,
int  num_elements_per_value,
int  num_values,
int values 
)

Sets the value of the integer uniform shader variable at the given location.

Definition at line 2393 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformiv.

void GPU_SetUniformMatrixfv ( int  location,
int  num_matrices,
int  num_rows,
int  num_columns,
Uint8  transpose,
float *  values 
)

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.

Definition at line 2460 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformMatrixfv.

void GPU_SetUniformui ( int  location,
unsigned int  value 
)

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).

Definition at line 2410 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformui.

void GPU_SetUniformuiv ( int  location,
int  num_elements_per_value,
int  num_values,
unsigned int values 
)

Sets the value of the unsigned integer uniform shader variable at the given location.

Definition at line 2418 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetUniformuiv.

void GPU_SetViewport ( GPU_Target target,
GPU_Rect  viewport 
)

Sets the given target's viewport.

Definition at line 625 of file SDL_gpu.c.

References GPU_Target::viewport.

void GPU_SetVirtualResolution ( GPU_Target target,
Uint16  w,
Uint16  h 
)

Change the logical size of the given target. Rendering to this target will be scaled as if the dimensions were actually the ones given.

Definition at line 436 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetVirtualResolution.

Uint8 GPU_SetWindowResolution ( Uint16  w,
Uint16  h 
)

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.

Definition at line 427 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetWindowResolution.

void GPU_SetWrapMode ( GPU_Image image,
GPU_WrapEnum  wrap_mode_x,
GPU_WrapEnum  wrap_mode_y 
)

Sets the image wrapping mode, if supported by the renderer.

Definition at line 2120 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::SetWrapMode.

Referenced by CopyImage().

Uint8 GPU_ToggleFullscreen ( Uint8  use_desktop_resolution)

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.

Parameters
use_desktop_resolutionIf true, lets the window change its resolution when it enters fullscreen mode (via SDL_WINDOW_FULLSCREEN_DESKTOP).
Returns
0 if the new mode is windowed, 1 if the new mode is fullscreen.

Definition at line 419 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::ToggleFullscreen.

void GPU_Tri ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
SDL_Color  color 
)

Renders a colored triangle outline.

Parameters
targetThe destination render target
x1x-coord of first point
y1y-coord of first point
x2x-coord of second point
y2y-coord of second point
x3x-coord of third point
y3y-coord of third point
colorThe color of the shape to render

Definition at line 102 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_TriangleBatch ( GPU_Image image,
GPU_Target target,
unsigned short  num_vertices,
float *  values,
unsigned int  num_indices,
unsigned short *  indices,
GPU_BlitFlagEnum  flags 
)

Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry.

Parameters
valuesA tightly-packed array of vertex position (x,y), image coordinates (s,t), and color (r,g,b,a) values with a range from 0-255. Pass NULL to render with only custom shader attributes.
indicesIf 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).
flagsBit flags to control the interpretation of the array parameters. Since 'values' contains per-vertex data, GPU_PASSTHROUGH_VERTICES is ignored. Texture coordinates are scaled down using the image dimensions and color components are normalized to [0.0, 1.0].

Definition at line 1634 of file SDL_gpu.c.

References CHECK_CONTEXT, CHECK_FUNCTION_POINTER, CHECK_RENDERER, GPU_ERROR_NULL_ARGUMENT, GPU_ERROR_UNSUPPORTED_FUNCTION, GPU_ERROR_USER_ERROR, GPU_PASSTHROUGH_ALL, GPU_PASSTHROUGH_COLORS, GPU_PASSTHROUGH_TEXCOORDS, GPU_USE_DEFAULT_COLORS, GPU_USE_DEFAULT_POSITIONS, GPU_USE_DEFAULT_SRC_RECTS, RETURN_ERROR, GPU_Image::texture_h, GPU_Image::texture_w, GPU_Renderer::TriangleBatch, and TriangleBatch().

void GPU_TriFilled ( GPU_Target target,
float  x1,
float  y1,
float  x2,
float  y2,
float  x3,
float  y3,
SDL_Color  color 
)

Renders a colored filled triangle.

Parameters
targetThe destination render target
x1x-coord of first point
y1y-coord of first point
x2x-coord of second point
y2y-coord of second point
x3x-coord of third point
y3y-coord of third point
colorThe color of the shape to render

Definition at line 111 of file SDL_gpuShapes.c.

References CHECK_RENDERER.

void GPU_UnsetClip ( GPU_Target target)
void GPU_UnsetVirtualResolution ( GPU_Target target)

Reset the logical size of the given target to its original value.

Definition at line 444 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::UnsetVirtualResolution.

void GPU_UpdateImage ( GPU_Image image,
SDL_Surface *  surface,
const GPU_Rect surface_rect 
)

Update an image from surface data.

Definition at line 692 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::UpdateImage.

void GPU_UpdateImageBytes ( GPU_Image image,
const GPU_Rect image_rect,
const unsigned char *  bytes,
int  bytes_per_row 
)

Update an image from an array of pixel data.

Definition at line 708 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::UpdateImageBytes.

void GPU_UpdateSubImage ( GPU_Image image,
const GPU_Rect image_rect,
SDL_Surface *  surface,
const GPU_Rect surface_rect 
)

Update an image from surface data.

Definition at line 700 of file SDL_gpu.c.

References GPU_Renderer::current_context_target, and GPU_Renderer::UpdateSubImage.

Variable Documentation

const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4
static

Definition at line 316 of file SDL_gpu.h.

Referenced by changeBlendMode(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS_SEPARATE = 0x10
static

Definition at line 318 of file SDL_gpu.h.

Referenced by changeBlendMode(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8
static

Definition at line 317 of file SDL_gpu.h.

Referenced by changeBlendMode(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200
static

Definition at line 323 of file SDL_gpu.h.

Referenced by init_features().

const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400
static

Definition at line 325 of file SDL_gpu.h.

Referenced by init_features().

const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x80
static

Definition at line 321 of file SDL_gpu.h.

Referenced by compareFormats(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x20
static

Definition at line 319 of file SDL_gpu.h.

Referenced by compareFormats(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x40
static

Definition at line 320 of file SDL_gpu.h.

Referenced by compareFormats(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1
static

Definition at line 314 of file SDL_gpu.h.

Referenced by CopyImage(), CreateImage(), and init_features().

const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200
static

Definition at line 324 of file SDL_gpu.h.

const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2
static

Definition at line 315 of file SDL_gpu.h.

Referenced by bindFramebuffer(), extBindFramebuffer(), FreeTarget(), init_features(), and LoadTarget().

const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100
static

Definition at line 322 of file SDL_gpu.h.

Referenced by init_features().

const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800
static

Definition at line 326 of file SDL_gpu.h.

Referenced by init_features(), and SetWrapMode().

const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x40000
static

Definition at line 349 of file SDL_gpu.h.

Referenced by Init().

const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x20000
static

Definition at line 348 of file SDL_gpu.h.

Referenced by CreateTargetFromWindow(), and Init().

const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x10000
static

Definition at line 347 of file SDL_gpu.h.

Referenced by CreateTargetFromWindow().

const Uint32 GPU_NONE = 0x0
static

Definition at line 354 of file SDL_gpu.h.

const GPU_BlitFlagEnum GPU_PASSTHROUGH_COLORS = 0x4
static

Definition at line 363 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), GPU_BlitBatchSeparate(), and GPU_TriangleBatch().

const GPU_BlitFlagEnum GPU_PASSTHROUGH_TEXCOORDS = 0x2
static

Definition at line 362 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), GPU_BlitBatchSeparate(), and GPU_TriangleBatch().

const GPU_BlitFlagEnum GPU_PASSTHROUGH_VERTICES = 0x1
static

Definition at line 361 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), and GPU_BlitBatchSeparate().

const GPU_RendererEnum GPU_RENDERER_D3D10 = 0x20000
static

Definition at line 46 of file SDL_gpu.h.

Referenced by GPU_GetRendererEnumString().

const GPU_RendererEnum GPU_RENDERER_D3D11 = 0x40000
static

Definition at line 47 of file SDL_gpu.h.

Referenced by GPU_GetRendererEnumString().

const GPU_RendererEnum GPU_RENDERER_D3D9 = 0x10000
static

Definition at line 45 of file SDL_gpu.h.

Referenced by GPU_GetRendererEnumString().

const GPU_RendererEnum GPU_RENDERER_GLES_1 = 0x100
static
const GPU_RendererEnum GPU_RENDERER_GLES_2 = 0x200
static
const GPU_RendererEnum GPU_RENDERER_GLES_3 = 0x400
static

Definition at line 44 of file SDL_gpu.h.

Referenced by GPU_GetRendererEnumString().

const GPU_RendererEnum GPU_RENDERER_OPENGL_1 = 0x2
static
const GPU_RendererEnum GPU_RENDERER_OPENGL_1_BASE = 0x1
static
const GPU_RendererEnum GPU_RENDERER_OPENGL_2 = 0x4
static
const GPU_RendererEnum GPU_RENDERER_OPENGL_3 = 0x8
static
const GPU_RendererEnum GPU_RENDERER_OPENGL_4 = 0x10
static

Definition at line 41 of file SDL_gpu.h.

Referenced by GPU_GetRendererEnumString().

const GPU_RendererEnum GPU_RENDERER_UNKNOWN = 0x0
static
const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400
static

Definition at line 373 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A
static

Definition at line 380 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406
static

Definition at line 379 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_INT = 0x1404
static

Definition at line 377 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402
static

Definition at line 375 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401
static

Definition at line 374 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405
static

Definition at line 378 of file SDL_gpu.h.

const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403
static

Definition at line 376 of file SDL_gpu.h.

const GPU_BlitFlagEnum GPU_USE_DEFAULT_COLORS = 0x20
static

Definition at line 366 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), and GPU_TriangleBatch().

const GPU_BlitFlagEnum GPU_USE_DEFAULT_POSITIONS = 0x8
static

Definition at line 364 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), and GPU_TriangleBatch().

const GPU_BlitFlagEnum GPU_USE_DEFAULT_SRC_RECTS = 0x10
static

Definition at line 365 of file SDL_gpu.h.

Referenced by GPU_BlitBatch(), and GPU_TriangleBatch().