9 #include "begin_code.h" 16 #define SDL_GPU_VERSION_MAJOR 0 17 #define SDL_GPU_VERSION_MINOR 11 18 #define SDL_GPU_VERSION_PATCH 0 21 #if SDL_VERSION_ATLEAST(2,0,0) 22 #define SDL_GPU_USE_SDL2 24 #define SDL_GPU_USE_SDL1 29 #ifdef __STDC_VERSION__ 30 #define GPU_HAVE_STDC 1 32 #define GPU_HAVE_STDC 0 35 #define GPU_HAVE_C99 (GPU_HAVE_STDC && (__STDC_VERSION__ >= 199901L)) 37 #ifdef __GNUC__ // catches both gcc and clang I believe 38 #define GPU_HAVE_GNUC 1 40 #define GPU_HAVE_GNUC 0 44 #define GPU_HAVE_MSVC 1 46 #define GPU_HAVE_MSVC 0 49 #define GPU_HAVE_MSVC18 (GPU_HAVE_MSVC && (_MSC_VER >= 1800)) // VS2013+ 51 #if defined(GPU_USE_REAL_BOOL) && GPU_USE_REAL_BOOL // allow user to specify 53 #elif defined(GPU_USE_INT_BOOL) && GPU_USE_INT_BOOL 55 #elif GPU_HAVE_C99 || GPU_HAVE_GNUC || GPU_HAVE_MSVC18 || (defined(GPU_HAVE_STDBOOL) && GPU_HAVE_STDBOOL) 95 #define GPU_RENDERER_ORDER_MAX 10 98 static const GPU_RendererEnum GPU_RENDERER_UNKNOWN = 0;
99 static const GPU_RendererEnum GPU_RENDERER_OPENGL_1_BASE = 1;
100 static const GPU_RendererEnum GPU_RENDERER_OPENGL_1 = 2;
101 static const GPU_RendererEnum GPU_RENDERER_OPENGL_2 = 3;
102 static const GPU_RendererEnum GPU_RENDERER_OPENGL_3 = 4;
103 static const GPU_RendererEnum GPU_RENDERER_OPENGL_4 = 5;
104 static const GPU_RendererEnum GPU_RENDERER_GLES_1 = 11;
105 static const GPU_RendererEnum GPU_RENDERER_GLES_2 = 12;
106 static const GPU_RendererEnum GPU_RENDERER_GLES_3 = 13;
107 static const GPU_RendererEnum GPU_RENDERER_D3D9 = 21;
108 static const GPU_RendererEnum GPU_RENDERER_D3D10 = 22;
109 static const GPU_RendererEnum GPU_RENDERER_D3D11 = 23;
110 #define GPU_RENDERER_CUSTOM_0 1000 330 #define GPU_MODELVIEW 0 331 #define GPU_PROJECTION 1 333 #ifndef GPU_MATRIX_STACK_MAX 334 #define GPU_MATRIX_STACK_MAX 5 435 static const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1;
436 static const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2;
437 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4;
438 static const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8;
439 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS_SEPARATE = 0x10;
440 static const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x20;
441 static const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x40;
442 static const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x80;
443 static const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100;
444 static const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200;
445 static const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200;
446 static const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400;
447 static const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800;
448 static const GPU_FeatureEnum GPU_FEATURE_CORE_FRAMEBUFFER_OBJECTS = 0x1000;
451 #define GPU_FEATURE_ALL_BASE GPU_FEATURE_RENDER_TARGETS 452 #define GPU_FEATURE_ALL_BLEND_PRESETS (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE) 453 #define GPU_FEATURE_ALL_GL_FORMATS (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR) 454 #define GPU_FEATURE_BASIC_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER) 455 #define GPU_FEATURE_ALL_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER | GPU_FEATURE_GEOMETRY_SHADER) 467 static const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x1;
468 static const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x2;
469 static const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x4;
470 static const GPU_InitFlagEnum GPU_INIT_DISABLE_AUTO_VIRTUAL_RESOLUTION = 0x8;
471 static const GPU_InitFlagEnum GPU_INIT_REQUEST_COMPATIBILITY_PROFILE = 0x10;
472 static const GPU_InitFlagEnum GPU_INIT_USE_ROW_BY_ROW_TEXTURE_UPLOAD_FALLBACK = 0x20;
473 static const GPU_InitFlagEnum GPU_INIT_USE_COPY_TEXTURE_UPLOAD_FALLBACK = 0x40;
475 #define GPU_DEFAULT_INIT_FLAGS 0 478 static const Uint32 GPU_NONE = 0x0;
486 static const GPU_BatchFlagEnum GPU_BATCH_XY = 0x1;
487 static const GPU_BatchFlagEnum GPU_BATCH_XYZ = 0x2;
488 static const GPU_BatchFlagEnum GPU_BATCH_ST = 0x4;
489 static const GPU_BatchFlagEnum GPU_BATCH_RGB = 0x8;
490 static const GPU_BatchFlagEnum GPU_BATCH_RGBA = 0x10;
491 static const GPU_BatchFlagEnum GPU_BATCH_RGB8 = 0x20;
492 static const GPU_BatchFlagEnum GPU_BATCH_RGBA8 = 0x40;
494 #define GPU_BATCH_XY_ST (GPU_BATCH_XY | GPU_BATCH_ST) 495 #define GPU_BATCH_XYZ_ST (GPU_BATCH_XYZ | GPU_BATCH_ST) 496 #define GPU_BATCH_XY_RGB (GPU_BATCH_XY | GPU_BATCH_RGB) 497 #define GPU_BATCH_XYZ_RGB (GPU_BATCH_XYZ | GPU_BATCH_RGB) 498 #define GPU_BATCH_XY_RGBA (GPU_BATCH_XY | GPU_BATCH_RGBA) 499 #define GPU_BATCH_XYZ_RGBA (GPU_BATCH_XYZ | GPU_BATCH_RGBA) 500 #define GPU_BATCH_XY_ST_RGBA (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA) 501 #define GPU_BATCH_XYZ_ST_RGBA (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA) 502 #define GPU_BATCH_XY_RGB8 (GPU_BATCH_XY | GPU_BATCH_RGB8) 503 #define GPU_BATCH_XYZ_RGB8 (GPU_BATCH_XYZ | GPU_BATCH_RGB8) 504 #define GPU_BATCH_XY_RGBA8 (GPU_BATCH_XY | GPU_BATCH_RGBA8) 505 #define GPU_BATCH_XYZ_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_RGBA8) 506 #define GPU_BATCH_XY_ST_RGBA8 (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA8) 507 #define GPU_BATCH_XYZ_ST_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA8) 515 static const GPU_FlipEnum GPU_FLIP_NONE = 0x0;
516 static const GPU_FlipEnum GPU_FLIP_HORIZONTAL = 0x1;
517 static const GPU_FlipEnum GPU_FLIP_VERTICAL = 0x2;
525 static const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400;
526 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401;
527 static const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402;
528 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403;
529 static const GPU_TypeEnum GPU_TYPE_INT = 0x1404;
530 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405;
531 static const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406;
532 static const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A;
689 static SDL_version SDLCALL GPU_GetCompiledVersion(
void)
691 static inline SDL_version SDLCALL GPU_GetCompiledVersion(
void)
755 DECLSPEC
GPU_Target* SDLCALL
GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
773 DECLSPEC
void SDLCALL
GPU_Quit(
void);
782 #define GPU_Log GPU_LogInfo 807 DECLSPEC
void SDLCALL
GPU_SetLogCallback(
int (*callback)(GPU_LogLevelEnum log_level,
const char*
format, va_list args));
1249 DECLSPEC
void SDLCALL
GPU_VectorCross(
float* result,
float* A,
float* B);
1262 DECLSPEC
void SDLCALL
GPU_MatrixCopy(
float* result,
const float* A);
1268 DECLSPEC
void SDLCALL
GPU_MatrixOrtho(
float* result,
float left,
float right,
float bottom,
float top,
float near,
float far);
1271 DECLSPEC
void SDLCALL
GPU_MatrixFrustum(
float* result,
float left,
float right,
float bottom,
float top,
float near,
float far);
1274 DECLSPEC
void SDLCALL
GPU_MatrixPerspective(
float* result,
float fovy,
float aspect,
float zNear,
float zFar);
1277 DECLSPEC
void SDLCALL
GPU_MatrixLookAt(
float* matrix,
float eye_x,
float eye_y,
float eye_z,
float target_x,
float target_y,
float target_z,
float up_x,
float up_y,
float up_z);
1283 DECLSPEC
void SDLCALL
GPU_MatrixScale(
float* result,
float sx,
float sy,
float sz);
1291 DECLSPEC
void SDLCALL
GPU_Multiply4x4(
float* result,
float* A,
float* B);
1330 DECLSPEC
void SDLCALL
GPU_Ortho(
float left,
float right,
float bottom,
float top,
float near,
float far);
1333 DECLSPEC
void SDLCALL
GPU_Frustum(
float left,
float right,
float bottom,
float top,
float near,
float far);
1339 DECLSPEC
void SDLCALL
GPU_Scale(
float sx,
float sy,
float sz);
1827 #include "close_code.h" struct GPU_Renderer * renderer
GPU_Target * context_target
DECLSPEC float SDLCALL GPU_GetLineThickness(void)
DECLSPEC void SDLCALL GPU_VectorCross(float *result, float *A, float *B)
DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void)
DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object)
GPU_bool GPU_bool use_desktop_resolution
DECLSPEC void SDLCALL GPU_RectangleRoundFilled2(GPU_Target *target, GPU_Rect rect, float radius, SDL_Color color)
DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer *(SDLCALL *create_renderer)(GPU_RendererID request), void(SDLCALL *free_renderer)(GPU_Renderer *renderer))
DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags)
DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float *value)
DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source)
DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void)
DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image *image)
GPU_BlendFuncEnum dest_alpha
GPU_Image GPU_Rect GPU_Target float float float pivot_x
DECLSPEC void SDLCALL GPU_MatrixOrtho(float *result, float left, float right, float bottom, float top, float near, float far)
DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target *target, Uint32 windowID)
GPU_BlendEqEnum color_equation
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface(const char *filename)
DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max)
DECLSPEC GPU_bool SDLCALL GPU_SaveSurface(SDL_Surface *surface, const char *filename, GPU_FileFormatEnum format)
DECLSPEC void SDLCALL GPU_GetDefaultAnchor(float *anchor_x, float *anchor_y)
DECLSPEC void SDLCALL GPU_BlitRectX(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, GPU_Rect *dest_rect, float degrees, float pivot_x, float pivot_y, GPU_FlipEnum flip_direction)
DECLSPEC float *SDLCALL GPU_GetProjection(void)
GPU_RendererID requested_id
DECLSPEC const char *SDLCALL GPU_GetShaderMessage(void)
DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target *target, Sint16 x, Sint16 y)
DECLSPEC void SDLCALL GPU_Flip(GPU_Target *target)
#define GPU_MATRIX_STACK_MAX
DECLSPEC GPU_Target *SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
#define SDL_GPU_VERSION_PATCH
DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z)
DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void)
DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object)
DECLSPEC void SDLCALL GPU_SetColor(GPU_Image *image, SDL_Color color)
#define SDL_GPU_VERSION_MAJOR
DECLSPEC GPU_bool SDLCALL GPU_ReplaceImage(GPU_Image *image, SDL_Surface *surface, const GPU_Rect *surface_rect)
DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen(void)
DECLSPEC GPU_Target *SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID)
DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target *target, GPU_bool use_camera)
DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void)
DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen(GPU_bool enable_fullscreen, GPU_bool use_desktop_resolution)
DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image *image, int location, int image_unit)
DECLSPEC GPU_bool SDLCALL GPU_SaveSurface_RW(SDL_Surface *surface, SDL_RWops *rwops, GPU_bool free_rwops, GPU_FileFormatEnum format)
Uint32 current_shader_program
DECLSPEC void SDLCALL GPU_TriangleBatchX(GPU_Image *image, GPU_Target *target, unsigned short num_vertices, void *values, unsigned int num_indices, unsigned short *indices, GPU_BatchFlagEnum flags)
GPU_Target Uint8 Uint8 Uint8 b
DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image *image, GPU_FilterEnum filter)
GPU_Image GPU_WrapEnum wrap_mode_x
int per_vertex_storage_size
DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void)
DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value)
GPU_ShaderBlock default_untextured_shader_block
DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int *order_size, GPU_RendererID *order)
DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, GPU_bool transpose, float *values)
struct GPU_Renderer * renderer
GPU_Image GPU_Target unsigned short num_vertices
DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
DECLSPEC float *SDLCALL GPU_GetModelView(void)
Uint32 const char * attrib_name
Uint32(SDLCALL *CreateShaderProgram)(GPU_Renderer *renderer)
int modelViewProjection_loc
DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode)
DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target *target, SDL_Color color)
DECLSPEC void SDLCALL GPU_SetLogCallback(int(*callback)(GPU_LogLevelEnum log_level, const char *format, va_list args))
DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void)
DECLSPEC GPU_Target *SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled(GPU_Target *target)
DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float *values)
GPU_Image GPU_FilterEnum filter
DECLSPEC void SDLCALL GPU_SetCoordinateMode(GPU_bool use_math_coords)
DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float *values)
GPU_MatrixStack modelview_matrix
DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void)
DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image *image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
GPU_Image GPU_WrapEnum GPU_WrapEnum wrap_mode_y
GPU_Image const GPU_Rect const unsigned char * bytes
DECLSPEC GPU_Target *SDLCALL GPU_CreateAliasTarget(GPU_Target *target)
GPU_BlendMode shapes_blend_mode
DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block)
GPU_bool shapes_use_blending
DECLSPEC GPU_Target *SDLCALL GPU_GetWindowTarget(Uint32 windowID)
DECLSPEC GPU_bool SDLCALL GPU_IntersectRect(GPU_Rect A, GPU_Rect B, GPU_Rect *result)
DECLSPEC GPU_Target *SDLCALL GPU_GetContextTarget(void)
DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target *target, float x, float y, float radius, SDL_Color color)
DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID *renderers_array)
DECLSPEC GPU_Image *SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, GPU_bool take_ownership)
GPU_BlendFuncEnum source_color
DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature)
DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image *image, GPU_bool enable)
GPU_WindowFlagEnum SDL_init_flags
DECLSPEC void SDLCALL GPU_MatrixRotate(float *result, float degrees, float x, float y, float z)
DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void)
DECLSPEC GPU_Image *SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format)
GPU_bool enable_fullscreen
DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void)
int int num_elements_per_value
GPU_Image const char GPU_FileFormatEnum format
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage(const char *filename)
DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
#define SDL_GPU_VERSION_MINOR
GPU_bool using_virtual_resolution
DECLSPEC GPU_Image *SDLCALL GPU_CopyImage(GPU_Image *image)
GPU_Target float float float float float float y3
GPU_Target * current_context_target
DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char *uniform_name)
GPU_ShaderLanguageEnum shader_language
GPU_Image const GPU_Rect SDL_Surface * surface
DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, GPU_bool normalize, int stride_bytes, int offset_bytes)
Uint32 const char const char const char * color_name
DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target *target, Uint16 w, Uint16 h)
DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far)
GPU_Image const GPU_Rect SDL_Surface const GPU_Rect * surface_rect
DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h)
DECLSPEC void SDLCALL GPU_Polygon(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float *vec3, float *matrix_4x4)
DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value)
DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
GPU_ShaderEnum shader_type
GPU_Image GPU_Target unsigned short void unsigned int unsigned short * indices
GPU_Target float float float float float x3
DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float *result, float *B)
DECLSPEC GPU_bool SDLCALL GPU_LinkShaderProgram(Uint32 program_object)
GPU_Target float float float float y2
DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char *shader_source)
DECLSPEC void SDLCALL GPU_UnsetImageVirtualResolution(GPU_Image *image)
DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int *value)
GPU_Image GPU_Rect * src_rect
DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target *target)
DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image *image)
DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
DECLSPEC void SDLCALL GPU_LogWarning(const char *format,...)
DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees)
DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
GPU_ShaderEnum SDL_RWops * shader_source
DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image *image)
static GLenum GLenum GLuint GLint level
GPU_Target unsigned int float * vertices
DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void)
DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
DECLSPEC void SDLCALL GPU_SetShapeBlending(GPU_bool enable)
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromTarget(GPU_Target *target)
DECLSPEC void SDLCALL GPU_GetModelViewProjection(float *result)
DECLSPEC void SDLCALL GPU_Pixel(GPU_Target *target, float x, float y, SDL_Color color)
GPU_AttributeFormat format
DECLSPEC const char *SDLCALL GPU_GetMatrixString(float *A)
GPU_MatrixStack projection_matrix
DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features)
DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target *target, float x, float y, float rx, float ry, float degrees, SDL_Color color)
DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image *image, const GPU_Rect *image_rect, SDL_Surface *surface, const GPU_Rect *surface_rect)
DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float scaleX, float scaleY)
DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char *filename)
DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image *image, GPU_BlendPresetEnum mode)
DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float *values)
DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target *target)
int int int int num_columns
DECLSPEC void SDLCALL GPU_Tri(GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
Uint32 const char * position_name
DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int *values)
DECLSPEC void SDLCALL GPU_RectangleRound2(GPU_Target *target, GPU_Rect rect, float radius, SDL_Color color)
GPU_Image GPU_Rect GPU_Target float float float float pivot_y
DECLSPEC void SDLCALL GPU_Sector(GPU_Target *target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color)
Uint32 const char const char * texcoord_name
DECLSPEC GPU_bool SDLCALL GPU_SaveImage_RW(GPU_Image *image, SDL_RWops *rwops, GPU_bool free_rwops, GPU_FileFormatEnum format)
DECLSPEC void SDLCALL GPU_Quit(void)
Uint32 GPU_WindowFlagEnum
DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image *image, float *anchor_x, float *anchor_y)
GPU_ShaderBlock current_shader_block
DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image *image, float anchor_x, float anchor_y)
DECLSPEC void SDLCALL GPU_MatrixTranslate(float *result, float x, float y, float z)
GPU_Image GPU_Target unsigned short void * values
DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID *order)
DECLSPEC void SDLCALL GPU_LogError(const char *format,...)
DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
DECLSPEC void SDLCALL GPU_Clear(GPU_Target *target)
GPU_Target Uint32 windowID
GPU_FilterEnum filter_mode
Uint32 const char const char const char const char * modelViewMatrix_name
DECLSPEC void SDLCALL GPU_Circle(GPU_Target *target, float x, float y, float radius, SDL_Color color)
DECLSPEC GPU_Attribute SDLCALL GPU_MakeAttribute(int location, void *values, GPU_AttributeFormat format)
DECLSPEC void SDLCALL GPU_MatrixPerspective(float *result, float fovy, float aspect, float zNear, float zFar)
GPU_Image const GPU_Rect const unsigned char int bytes_per_row
DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target *target)
DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
GPU_Image GPU_Rect GPU_Target float float float float scaleY
DECLSPEC void SDLCALL GPU_MatrixLookAt(float *matrix, float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z)
DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID *renderers_array)
void * per_vertex_storage
DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz)
GPU_Target float float float radius
DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target *target, float x, float y, float rx, float ry, float degrees, SDL_Color color)
DECLSPEC GPU_bool SDLCALL GPU_GetCoordinateMode(void)
GPU_InitFlagEnum GPU_init_flags
DECLSPEC void SDLCALL GPU_BlitTransform(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees, float scaleX, float scaleY)
DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image *image, const GPU_Rect *image_rect, const unsigned char *bytes, int bytes_per_row)
Uint32 default_untextured_shader_program
GPU_Target float float float float start_angle
DECLSPEC GPU_Target *SDLCALL GPU_LoadTarget(GPU_Image *image)
DECLSPEC void SDLCALL GPU_Line(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
GPU_Target float float float float ry
float default_image_anchor_y
GPU_Target float float SDL_Color color
GPU_Target float float float rx
DECLSPEC void SDLCALL GPU_BlitRect(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, GPU_Rect *dest_rect)
DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object)
DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target *target, GPU_Rect rect)
DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b)
DECLSPEC GPU_Renderer *SDLCALL GPU_GetRenderer(GPU_RendererID id)
GPU_ShaderEnum SDL_RWops GPU_bool free_rwops
DECLSPEC float *SDLCALL GPU_GetCurrentMatrix(void)
SDL_Color(SDLCALL *GetPixel)(GPU_Renderer *renderer
DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object)
int per_vertex_storage_stride_bytes
GPU_bool using_virtual_resolution
GPU_Target float float y1
DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image *image)
DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target *target, float *x, float *y, float displayX, float displayY)
GPU_Target float float float float float end_angle
DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char *name, GPU_RendererEnum renderer, int major_version, int minor_version)
GPU_Target float float float inner_radius
GPU_Target * context_target
DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value)
DECLSPEC void SDLCALL GPU_GetVirtualResolution(GPU_Target *target, Uint16 *w, Uint16 *h)
DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock *block)
DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void)
int int int int GPU_bool transpose
GPU_BlendEqEnum alpha_equation
DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id)
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage_RW(SDL_RWops *rwops, GPU_bool free_rwops)
Uint32 GPU_ShaderBlock * block
DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int *values)
DECLSPEC float SDLCALL GPU_VectorLength(float *vec3)
DECLSPEC void SDLCALL GPU_MatrixCopy(float *result, const float *A)
DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target *target, SDL_Color color)
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface_RW(SDL_RWops *rwops, GPU_bool free_rwops)
DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target *target)
DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
GPU_Target float float float float outer_radius
DECLSPEC void SDLCALL GPU_Frustum(float left, float right, float bottom, float top, float near, float far)
DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2)
DECLSPEC void SDLCALL GPU_LogInfo(const char *format,...)
DECLSPEC void SDLCALL GPU_Blit(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y)
DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image *image)
DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value)
DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target *target, GPU_Camera *cam)
DECLSPEC void SDLCALL GPU_SectorFilled(GPU_Target *target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color)
struct GPU_RendererImpl * impl
DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode)
DECLSPEC void SDLCALL GPU_MultMatrix(float *matrix4x4)
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromImage(GPU_Image *image)
DECLSPEC void SDLCALL GPU_PopMatrix(void)
DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target *target)
DECLSPEC void SDLCALL GPU_VectorNormalize(float *vec3)
DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
GPU_BlendFuncEnum source_alpha
DECLSPEC void SDLCALL GPU_MatrixIdentity(float *result)
DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void)
GPU_Target GPU_Camera * cam
DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID)
GPU_Image GPU_Target unsigned short void unsigned int unsigned short GPU_BatchFlagEnum flags
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromTarget(GPU_Target *target)
DECLSPEC void SDLCALL GPU_Arc(GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void)
DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void)
DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image *image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
DECLSPEC void SDLCALL GPU_LoadIdentity(void)
DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops *shader_source, GPU_bool free_rwops)
GPU_Image const GPU_Rect * image_rect
GPU_BlendFuncEnum dest_color
DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value)
DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target *target, GPU_Rect B, GPU_Rect *result)
DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int *value)
DECLSPEC void SDLCALL GPU_ResetRendererState(void)
DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z)
DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h)
GPU_Image GPU_Target unsigned short void unsigned int num_indices
float default_image_anchor_x
GPU_Image GPU_Rect GPU_Target float float float degrees
GPU_RendererEnum renderer
DECLSPEC void SDLCALL GPU_UnsetViewport(GPU_Target *target)
DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset)
DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image *image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y)
DECLSPEC GPU_Image *SDLCALL GPU_CreateAliasImage(GPU_Image *image)
GPU_Image const char * filename
DECLSPEC void SDLCALL GPU_PushErrorCode(const char *function, GPU_ErrorEnum error, const char *details,...)
DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value)
DECLSPEC void SDLCALL GPU_MatrixFrustum(float *result, float left, float right, float bottom, float top, float near, float far)
DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image *image, GPU_SnapEnum mode)
GPU_Image int int image_unit
GPU_Image GPU_Rect GPU_Target float float float scaleX
DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
DECLSPEC void SDLCALL GPU_SetDefaultAnchor(float anchor_x, float anchor_y)
DECLSPEC void SDLCALL GPU_GetRendererOrder(int *order_size, GPU_RendererID *order)
DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target *target, GPU_Rect viewport)
GPU_Target float float float x2
DECLSPEC void SDLCALL GPU_MatrixScale(float *result, float sx, float sy, float sz)
DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void)
DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void)
DECLSPEC float SDLCALL GPU_VectorDot(float *A, float *B)
GPU_FeatureEnum enabled_features
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromSurface(SDL_Surface *surface)
DECLSPEC void SDLCALL GPU_TriangleBatch(GPU_Image *image, GPU_Target *target, unsigned short num_vertices, float *values, unsigned int num_indices, unsigned short *indices, GPU_BatchFlagEnum flags)
DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int *values)
DECLSPEC const char *SDLCALL GPU_GetErrorString(GPU_ErrorEnum error)
DECLSPEC GPU_Target *SDLCALL GPU_GetTarget(GPU_Image *image)
DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
DECLSPEC void SDLCALL GPU_Multiply4x4(float *result, float *A, float *B)
DECLSPEC GPU_Target *SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
DECLSPEC void SDLCALL GPU_PushMatrix(void)
GPU_Target Uint8 Uint8 Uint8 Uint8 a
DECLSPEC GPU_bool SDLCALL GPU_SaveImage(GPU_Image *image, const char *filename, GPU_FileFormatEnum format)
GPU_ShaderBlock default_textured_shader_block
DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer)
DECLSPEC void SDLCALL GPU_FreeRenderer(GPU_Renderer *renderer)
DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness)
DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
DECLSPEC void SDLCALL GPU_VectorCopy(float *result, float *A)
DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int *values)
DECLSPEC GPU_ShaderBlock SDLCALL GPU_LoadShaderBlock(Uint32 program_object, const char *position_name, const char *texcoord_name, const char *color_name, const char *modelViewMatrix_name)
DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level)
DECLSPEC GPU_Renderer *SDLCALL GPU_GetCurrentRenderer(void)
DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char *attrib_name)
Uint32 default_textured_shader_program
DECLSPEC void SDLCALL 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)
DECLSPEC void SDLCALL GPU_SetImageVirtualResolution(GPU_Image *image, Uint16 w, Uint16 h)
DECLSPEC GPU_bool SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object)
Uint32 const char * uniform_name
DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count)
DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
int per_vertex_storage_offset_bytes
DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h)