All Classes Functions Variables Typedefs Enumerations Groups
SDL_gpu.h
1 #ifndef _SDL_GPU_H__
2 #define _SDL_GPU_H__
3 
4 #include "SDL.h"
5 #include <stdio.h>
6 #include <stdarg.h>
7 
8 // Use SDL's DLL defines
9 #include "begin_code.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 // Compile-time versions
16 #define SDL_GPU_VERSION_MAJOR 0
17 #define SDL_GPU_VERSION_MINOR 11
18 #define SDL_GPU_VERSION_PATCH 0
19 
20 /* Auto-detect if we're using the SDL2 API by the headers available. */
21 #if SDL_VERSION_ATLEAST(2,0,0)
22  #define SDL_GPU_USE_SDL2
23 #else
24  #define SDL_GPU_USE_SDL1
25 #endif
26 
27 
28 // Check for bool support
29 #ifdef __STDC_VERSION__
30  #define GPU_HAVE_STDC 1
31 #else
32  #define GPU_HAVE_STDC 0
33 #endif
34 
35 #define GPU_HAVE_C99 (GPU_HAVE_STDC && (__STDC_VERSION__ >= 199901L))
36 
37 #ifdef __GNUC__ // catches both gcc and clang I believe
38  #define GPU_HAVE_GNUC 1
39 #else
40  #define GPU_HAVE_GNUC 0
41 #endif
42 
43 #ifdef _MSC_VER
44  #define GPU_HAVE_MSVC 1
45 #else
46  #define GPU_HAVE_MSVC 0
47 #endif
48 
49 #define GPU_HAVE_MSVC18 (GPU_HAVE_MSVC && (_MSC_VER >= 1800)) // VS2013+
50 
51 #if defined(GPU_USE_REAL_BOOL) && GPU_USE_REAL_BOOL // allow user to specify
52  #define GPU_bool bool
53 #elif defined(GPU_USE_INT_BOOL) && GPU_USE_INT_BOOL
54  #define GPU_bool int
55 #elif GPU_HAVE_C99 || GPU_HAVE_GNUC || GPU_HAVE_MSVC18 || (defined(GPU_HAVE_STDBOOL) && GPU_HAVE_STDBOOL)
56  #include <stdbool.h>
57  #define GPU_bool bool
58 #else
59  #define GPU_bool int
60 #endif
61 
62 #define GPU_FALSE 0
63 #define GPU_TRUE 1
64 
65 
66 typedef struct GPU_Renderer GPU_Renderer;
67 typedef struct GPU_Target GPU_Target;
68 
89 typedef struct GPU_Rect
90 {
91  float x, y;
92  float w, h;
93 } GPU_Rect;
94 
95 #define GPU_RENDERER_ORDER_MAX 10
96 
97 typedef Uint32 GPU_RendererEnum;
98 static const GPU_RendererEnum GPU_RENDERER_UNKNOWN = 0; // invalid value
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
111 
119 typedef struct GPU_RendererID
120 {
121  const char* name;
122  GPU_RendererEnum renderer;
123  int major_version;
124  int minor_version;
126 
127 
133 typedef enum {
134  GPU_FUNC_ZERO = 0,
135  GPU_FUNC_ONE = 1,
136  GPU_FUNC_SRC_COLOR = 0x0300,
137  GPU_FUNC_DST_COLOR = 0x0306,
138  GPU_FUNC_ONE_MINUS_SRC = 0x0301,
139  GPU_FUNC_ONE_MINUS_DST = 0x0307,
140  GPU_FUNC_SRC_ALPHA = 0x0302,
141  GPU_FUNC_DST_ALPHA = 0x0304,
142  GPU_FUNC_ONE_MINUS_SRC_ALPHA = 0x0303,
143  GPU_FUNC_ONE_MINUS_DST_ALPHA = 0x0305
145 
151 typedef enum {
152  GPU_EQ_ADD = 0x8006,
153  GPU_EQ_SUBTRACT = 0x800A,
154  GPU_EQ_REVERSE_SUBTRACT = 0x800B
156 
159 typedef struct GPU_BlendMode
160 {
161  GPU_BlendFuncEnum source_color;
162  GPU_BlendFuncEnum dest_color;
163  GPU_BlendFuncEnum source_alpha;
164  GPU_BlendFuncEnum dest_alpha;
165 
166  GPU_BlendEqEnum color_equation;
167  GPU_BlendEqEnum alpha_equation;
168 } GPU_BlendMode;
169 
175 typedef enum {
176  GPU_BLEND_NORMAL = 0,
177  GPU_BLEND_PREMULTIPLIED_ALPHA = 1,
178  GPU_BLEND_MULTIPLY = 2,
179  GPU_BLEND_ADD = 3,
180  GPU_BLEND_SUBTRACT = 4,
181  GPU_BLEND_MOD_ALPHA = 5,
182  GPU_BLEND_SET_ALPHA = 6,
183  GPU_BLEND_SET = 7,
184  GPU_BLEND_NORMAL_KEEP_ALPHA = 8,
185  GPU_BLEND_NORMAL_ADD_ALPHA = 9,
186  GPU_BLEND_NORMAL_FACTOR_ALPHA = 10
188 
193 typedef enum {
194  GPU_FILTER_NEAREST = 0,
195  GPU_FILTER_LINEAR = 1,
196  GPU_FILTER_LINEAR_MIPMAP = 2
198 
204 typedef enum {
205  GPU_SNAP_NONE = 0,
206  GPU_SNAP_POSITION = 1,
207  GPU_SNAP_DIMENSIONS = 2,
208  GPU_SNAP_POSITION_AND_DIMENSIONS = 3
209 } GPU_SnapEnum;
210 
211 
216 typedef enum {
217  GPU_WRAP_NONE = 0,
218  GPU_WRAP_REPEAT = 1,
219  GPU_WRAP_MIRRORED = 2
220 } GPU_WrapEnum;
221 
226 typedef enum {
227  GPU_FORMAT_LUMINANCE = 1,
228  GPU_FORMAT_LUMINANCE_ALPHA = 2,
229  GPU_FORMAT_RGB = 3,
230  GPU_FORMAT_RGBA = 4,
231  GPU_FORMAT_ALPHA = 5,
232  GPU_FORMAT_RG = 6,
233  GPU_FORMAT_YCbCr422 = 7,
234  GPU_FORMAT_YCbCr420P = 8
236 
244 typedef enum {
245  GPU_FILE_AUTO = 0,
246  GPU_FILE_PNG,
247  GPU_FILE_BMP,
248  GPU_FILE_TGA
250 
251 
252 
263 typedef struct GPU_Image
264 {
265  struct GPU_Renderer* renderer;
266  GPU_Target* context_target;
267  GPU_Target* target;
268  Uint16 w, h;
269  GPU_bool using_virtual_resolution;
270  GPU_FormatEnum format;
271  int num_layers;
272  int bytes_per_pixel;
273  Uint16 base_w, base_h; // Original image dimensions
274  Uint16 texture_w, texture_h; // Underlying texture dimensions
275  GPU_bool has_mipmaps;
276 
277  float anchor_x; // Normalized coords for the point at which the image is blitted. Default is (0.5, 0.5), that is, the image is drawn centered.
278  float anchor_y; // These are interpreted according to GPU_SetCoordinateMode() and range from (0.0 - 1.0) normally.
279 
280  SDL_Color color;
281  GPU_bool use_blending;
282  GPU_BlendMode blend_mode;
283  GPU_FilterEnum filter_mode;
284  GPU_SnapEnum snap_mode;
285  GPU_WrapEnum wrap_mode_x;
286  GPU_WrapEnum wrap_mode_y;
287 
288  void* data;
289  int refcount;
290  GPU_bool is_alias;
291 } GPU_Image;
292 
293 
300 typedef struct GPU_Camera
301 {
302  float x, y, z;
303  float angle;
304  float zoom;
305 } GPU_Camera;
306 
307 
313 typedef struct GPU_ShaderBlock
314 {
315  // Attributes
316  int position_loc;
317  int texcoord_loc;
318  int color_loc;
319  // Uniforms
320  int modelViewProjection_loc;
322 
323 
324 
325 
326 
327 #define GPU_MODELVIEW 0
328 #define GPU_PROJECTION 1
329 
330 #ifndef GPU_MATRIX_STACK_MAX
331 #define GPU_MATRIX_STACK_MAX 5
332 #endif
333 
336 typedef struct GPU_MatrixStack
337 {
338  unsigned int size;
339  float matrix[GPU_MATRIX_STACK_MAX][16];
341 
342 
345 typedef struct GPU_Context
346 {
348  void* context;
349  GPU_bool failed;
350 
352  Uint32 windowID;
353 
355  int window_w;
356  int window_h;
357 
360  int drawable_h;
361 
364  int stored_window_h;
365 
368  Uint32 default_textured_shader_program;
369  Uint32 default_untextured_shader_program;
370 
371  GPU_ShaderBlock current_shader_block;
372  GPU_ShaderBlock default_textured_shader_block;
373  GPU_ShaderBlock default_untextured_shader_block;
374 
375  GPU_bool shapes_use_blending;
376  GPU_BlendMode shapes_blend_mode;
377  float line_thickness;
378  GPU_bool use_texturing;
379 
380  int matrix_mode;
381  GPU_MatrixStack projection_matrix;
382  GPU_MatrixStack modelview_matrix;
383 
384  void* data;
385 } GPU_Context;
386 
387 
399 {
400  struct GPU_Renderer* renderer;
401  GPU_Target* context_target;
402  GPU_Image* image;
403  void* data;
404  Uint16 w, h;
405  GPU_bool using_virtual_resolution;
406  Uint16 base_w, base_h; // The true dimensions of the underlying image or window
407  GPU_bool use_clip_rect;
408  GPU_Rect clip_rect;
409  GPU_bool use_color;
410  SDL_Color color;
411 
412  GPU_Rect viewport;
413 
416  GPU_bool use_camera;
417 
420  int refcount;
421  GPU_bool is_alias;
422 };
423 
429 typedef Uint32 GPU_FeatureEnum;
430 static const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1;
431 static const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2;
432 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4;
433 static const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8;
434 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS_SEPARATE = 0x10;
435 static const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x20;
436 static const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x40;
437 static const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x80;
438 static const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100;
439 static const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200;
440 static const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200;
441 static const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400;
442 static const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800;
443 
445 #define GPU_FEATURE_ALL_BASE GPU_FEATURE_RENDER_TARGETS
446 #define GPU_FEATURE_ALL_BLEND_PRESETS (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE)
447 #define GPU_FEATURE_ALL_GL_FORMATS (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR)
448 #define GPU_FEATURE_BASIC_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER)
449 #define GPU_FEATURE_ALL_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER | GPU_FEATURE_GEOMETRY_SHADER)
450 
451 
452 typedef Uint32 GPU_WindowFlagEnum;
453 
460 typedef Uint32 GPU_InitFlagEnum;
461 static const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x1;
462 static const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x2;
463 static const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x4;
464 static const GPU_InitFlagEnum GPU_INIT_DISABLE_AUTO_VIRTUAL_RESOLUTION = 0x8;
465 static const GPU_InitFlagEnum GPU_INIT_REQUEST_COMPATIBILITY_PROFILE = 0x10;
466 
467 #define GPU_DEFAULT_INIT_FLAGS 0
468 
469 
470 static const Uint32 GPU_NONE = 0x0;
471 
477 typedef Uint32 GPU_BatchFlagEnum;
478 static const GPU_BatchFlagEnum GPU_BATCH_XY = 0x1;
479 static const GPU_BatchFlagEnum GPU_BATCH_XYZ = 0x2;
480 static const GPU_BatchFlagEnum GPU_BATCH_ST = 0x4;
481 static const GPU_BatchFlagEnum GPU_BATCH_RGB = 0x8;
482 static const GPU_BatchFlagEnum GPU_BATCH_RGBA = 0x10;
483 static const GPU_BatchFlagEnum GPU_BATCH_RGB8 = 0x20;
484 static const GPU_BatchFlagEnum GPU_BATCH_RGBA8 = 0x40;
485 
486 #define GPU_BATCH_XY_ST (GPU_BATCH_XY | GPU_BATCH_ST)
487 #define GPU_BATCH_XYZ_ST (GPU_BATCH_XYZ | GPU_BATCH_ST)
488 #define GPU_BATCH_XY_RGB (GPU_BATCH_XY | GPU_BATCH_RGB)
489 #define GPU_BATCH_XYZ_RGB (GPU_BATCH_XYZ | GPU_BATCH_RGB)
490 #define GPU_BATCH_XY_RGBA (GPU_BATCH_XY | GPU_BATCH_RGBA)
491 #define GPU_BATCH_XYZ_RGBA (GPU_BATCH_XYZ | GPU_BATCH_RGBA)
492 #define GPU_BATCH_XY_ST_RGBA (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA)
493 #define GPU_BATCH_XYZ_ST_RGBA (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA)
494 #define GPU_BATCH_XY_RGB8 (GPU_BATCH_XY | GPU_BATCH_RGB8)
495 #define GPU_BATCH_XYZ_RGB8 (GPU_BATCH_XYZ | GPU_BATCH_RGB8)
496 #define GPU_BATCH_XY_RGBA8 (GPU_BATCH_XY | GPU_BATCH_RGBA8)
497 #define GPU_BATCH_XYZ_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_RGBA8)
498 #define GPU_BATCH_XY_ST_RGBA8 (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA8)
499 #define GPU_BATCH_XYZ_ST_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA8)
500 
501 
506 typedef Uint32 GPU_FlipEnum;
507 static const GPU_FlipEnum GPU_FLIP_NONE = 0x0;
508 static const GPU_FlipEnum GPU_FLIP_HORIZONTAL = 0x1;
509 static const GPU_FlipEnum GPU_FLIP_VERTICAL = 0x2;
510 
511 
515 typedef Uint32 GPU_TypeEnum;
516 // Use OpenGL's values for simpler translation
517 static const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400;
518 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401;
519 static const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402;
520 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403;
521 static const GPU_TypeEnum GPU_TYPE_INT = 0x1404;
522 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405;
523 static const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406;
524 static const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A;
525 
526 
527 
528 
529 
530 
537 typedef enum {
538  GPU_VERTEX_SHADER = 0,
539  GPU_FRAGMENT_SHADER = 1,
540  GPU_PIXEL_SHADER = 1,
541  GPU_GEOMETRY_SHADER = 2
543 
544 
545 
549 typedef enum {
550  GPU_LANGUAGE_NONE = 0,
551  GPU_LANGUAGE_ARB_ASSEMBLY = 1,
552  GPU_LANGUAGE_GLSL = 2,
553  GPU_LANGUAGE_GLSLES = 3,
554  GPU_LANGUAGE_HLSL = 4,
555  GPU_LANGUAGE_CG = 5
557 
559 typedef struct GPU_AttributeFormat
560 {
561  GPU_bool is_per_sprite; // Per-sprite values are expanded to 4 vertices
562  int num_elems_per_value;
563  GPU_TypeEnum type; // GPU_TYPE_FLOAT, GPU_TYPE_INT, GPU_TYPE_UNSIGNED_INT, etc.
564  GPU_bool normalize;
565  int stride_bytes; // Number of bytes between two vertex specifications
566  int offset_bytes; // Number of bytes to skip at the beginning of 'values'
568 
570 typedef struct GPU_Attribute
571 {
572  int location;
573  void* values; // Expect 4 values for each sprite
574  GPU_AttributeFormat format;
575 } GPU_Attribute;
576 
578 typedef struct GPU_AttributeSource
579 {
580  GPU_bool enabled;
581  int num_values;
582  void* next_value;
583  // Automatic storage format
584  int per_vertex_storage_stride_bytes;
585  int per_vertex_storage_offset_bytes;
586  int per_vertex_storage_size; // Over 0 means that the per-vertex storage has been automatically allocated
587  void* per_vertex_storage; // Could point to the attribute's values or to allocated storage
588  GPU_Attribute attribute;
590 
591 
597 typedef enum {
598  GPU_ERROR_NONE = 0,
599  GPU_ERROR_BACKEND_ERROR = 1,
600  GPU_ERROR_DATA_ERROR = 2,
601  GPU_ERROR_USER_ERROR = 3,
602  GPU_ERROR_UNSUPPORTED_FUNCTION = 4,
603  GPU_ERROR_NULL_ARGUMENT = 5,
604  GPU_ERROR_FILE_NOT_FOUND = 6
605 } GPU_ErrorEnum;
606 
608 typedef struct GPU_ErrorObject
609 {
610  char* function;
611  GPU_ErrorEnum error;
612  char* details;
614 
615 
621 typedef enum {
622  GPU_DEBUG_LEVEL_0 = 0,
623  GPU_DEBUG_LEVEL_1 = 1,
624  GPU_DEBUG_LEVEL_2 = 2,
625  GPU_DEBUG_LEVEL_3 = 3,
626  GPU_DEBUG_LEVEL_MAX = 3
628 
629 
634 typedef enum {
635  GPU_LOG_INFO = 0,
636  GPU_LOG_WARNING,
637  GPU_LOG_ERROR
639 
640 
641 /* Private implementation of renderer members */
642 struct GPU_RendererImpl;
643 
646 {
649  GPU_RendererID requested_id;
650  GPU_WindowFlagEnum SDL_init_flags;
651  GPU_InitFlagEnum GPU_init_flags;
652 
653  GPU_ShaderLanguageEnum shader_language;
654  int min_shader_version;
655  int max_shader_version;
656  GPU_FeatureEnum enabled_features;
657 
660 
662  GPU_bool coordinate_mode;
663 
666  float default_image_anchor_y;
667 
668  struct GPU_RendererImpl* impl;
669 };
670 
671 
672 
673 
674 
675 
679 // Visual C does not support static inline
680 #ifdef _MSC_VER
681 static SDL_version SDLCALL GPU_GetCompiledVersion(void)
682 #else
683 static inline SDL_version SDLCALL GPU_GetCompiledVersion(void)
684 #endif
685 {
686  SDL_version v = {SDL_GPU_VERSION_MAJOR, SDL_GPU_VERSION_MINOR, SDL_GPU_VERSION_PATCH};
687  return v;
688 }
689 
690 DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void);
691 
693 DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID);
694 
696 DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void);
697 
700 DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags);
701 
703 DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void);
704 
707 DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features);
708 
710 DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void);
711 
713 DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order);
714 
716 DECLSPEC void SDLCALL GPU_GetRendererOrder(int* order_size, GPU_RendererID* order);
717 
719 DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID* order);
720 
724 DECLSPEC GPU_Target* SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
725 
727 DECLSPEC GPU_Target* SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
728 
733 DECLSPEC GPU_Target* SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
734 
739 DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature);
740 
742 DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void);
743 
745 DECLSPEC void SDLCALL GPU_Quit(void);
746 
747 // End of Initialization
752 // Debugging, logging, and error handling
753 
754 #define GPU_Log GPU_LogInfo
755 
764 DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level);
765 
767 DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void);
768 
770 DECLSPEC void SDLCALL GPU_LogInfo(const char* format, ...);
771 
773 DECLSPEC void SDLCALL GPU_LogWarning(const char* format, ...);
774 
776 DECLSPEC void SDLCALL GPU_LogError(const char* format, ...);
777 
779 DECLSPEC void SDLCALL GPU_SetLogCallback(int (*callback)(GPU_LogLevelEnum log_level, const char* format, va_list args));
780 
786 DECLSPEC void SDLCALL GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...);
787 
789 DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void);
790 
792 DECLSPEC const char* SDLCALL GPU_GetErrorString(GPU_ErrorEnum error);
793 
795 DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max);
796 
797 // End of Logging
810 DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version);
811 
813 DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer);
814 
816 DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void);
817 
819 DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array);
820 
822 DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (SDLCALL *create_renderer)(GPU_RendererID request), void (SDLCALL *free_renderer)(GPU_Renderer* renderer));
823 
824 // End of RendererSetup
833 DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void);
834 
836 DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void);
837 
839 DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID* renderers_array);
840 
842 DECLSPEC GPU_Renderer* SDLCALL GPU_GetCurrentRenderer(void);
843 
845 DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id);
846 
848 DECLSPEC GPU_Renderer* SDLCALL GPU_GetRenderer(GPU_RendererID id);
849 
850 DECLSPEC void SDLCALL GPU_FreeRenderer(GPU_Renderer* renderer);
851 
853 DECLSPEC void SDLCALL GPU_ResetRendererState(void);
854 
858 DECLSPEC void SDLCALL GPU_SetCoordinateMode(GPU_bool use_math_coords);
859 
860 DECLSPEC GPU_bool SDLCALL GPU_GetCoordinateMode(void);
861 
865 DECLSPEC void SDLCALL GPU_SetDefaultAnchor(float anchor_x, float anchor_y);
866 
870 DECLSPEC void SDLCALL GPU_GetDefaultAnchor(float* anchor_x, float* anchor_y);
871 
872 // End of RendererControls
878 // Context / window controls
879 
884 DECLSPEC GPU_Target* SDLCALL GPU_GetContextTarget(void);
885 
887 DECLSPEC GPU_Target* SDLCALL GPU_GetWindowTarget(Uint32 windowID);
888 
890 DECLSPEC GPU_Target* SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID);
891 
896 DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target* target, Uint32 windowID);
897 
900 DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h);
901 
907 DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen(GPU_bool enable_fullscreen, GPU_bool use_desktop_resolution);
908 
910 DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen(void);
911 
913 DECLSPEC void SDLCALL GPU_SetShapeBlending(GPU_bool enable);
914 
917 
919 DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
920 
922 DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
923 
925 DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode);
926 
931 DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness);
932 
934 DECLSPEC float SDLCALL GPU_GetLineThickness(void);
935 
936 // End of ContextControls
947 DECLSPEC GPU_Target* SDLCALL GPU_CreateAliasTarget(GPU_Target* target);
948 
950 DECLSPEC GPU_Target* SDLCALL GPU_LoadTarget(GPU_Image* image);
951 
953 DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target* target);
954 
956 DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h);
957 
959 DECLSPEC void SDLCALL GPU_GetVirtualResolution(GPU_Target* target, Uint16* w, Uint16* h);
960 
962 DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY);
963 
965 DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target* target);
966 
968 DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h);
969 
971 DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
972 
974 DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target* target, GPU_Rect viewport);
975 
977 DECLSPEC void SDLCALL GPU_UnsetViewport(GPU_Target* target);
978 
980 DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void);
981 
983 DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target* target);
984 
989 DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target* target, GPU_Camera* cam);
990 
992 DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target* target, GPU_bool use_camera);
993 
995 DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled(GPU_Target* target);
996 
998 DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
999 
1001 DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target* target, GPU_Rect rect);
1002 
1004 DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h);
1005 
1007 DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target* target);
1008 
1010 DECLSPEC GPU_bool SDLCALL GPU_IntersectRect(GPU_Rect A, GPU_Rect B, GPU_Rect* result);
1011 
1015 DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target* target, GPU_Rect B, GPU_Rect* result);
1016 
1022 DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target* target, SDL_Color color);
1023 
1029 DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
1030 
1036 DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1037 
1041 DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target* target);
1042 
1043 // End of TargetControls
1052 DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface(const char* filename);
1053 
1055 DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface_RW(SDL_RWops* rwops, GPU_bool free_rwops);
1056 
1060 DECLSPEC GPU_bool SDLCALL GPU_SaveSurface(SDL_Surface* surface, const char* filename, GPU_FileFormatEnum format);
1061 
1065 DECLSPEC GPU_bool SDLCALL GPU_SaveSurface_RW(SDL_Surface* surface, SDL_RWops* rwops, GPU_bool free_rwops, GPU_FileFormatEnum format);
1066 
1067 // End of SurfaceControls
1081 DECLSPEC GPU_Image* SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format);
1082 
1084 DECLSPEC GPU_Image* SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, GPU_bool take_ownership);
1085 
1087 DECLSPEC GPU_Image* SDLCALL GPU_LoadImage(const char* filename);
1088 
1090 DECLSPEC GPU_Image* SDLCALL GPU_LoadImage_RW(SDL_RWops* rwops, GPU_bool free_rwops);
1091 
1094 DECLSPEC GPU_Image* SDLCALL GPU_CreateAliasImage(GPU_Image* image);
1095 
1097 DECLSPEC GPU_Image* SDLCALL GPU_CopyImage(GPU_Image* image);
1098 
1100 DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image* image);
1101 
1103 DECLSPEC void SDLCALL GPU_SetImageVirtualResolution(GPU_Image* image, Uint16 w, Uint16 h);
1104 
1106 DECLSPEC void SDLCALL GPU_UnsetImageVirtualResolution(GPU_Image* image);
1107 
1109 DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect);
1110 
1112 DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row);
1113 
1115 DECLSPEC GPU_bool SDLCALL GPU_ReplaceImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect);
1116 
1120 DECLSPEC GPU_bool SDLCALL GPU_SaveImage(GPU_Image* image, const char* filename, GPU_FileFormatEnum format);
1121 
1125 DECLSPEC GPU_bool SDLCALL GPU_SaveImage_RW(GPU_Image* image, SDL_RWops* rwops, GPU_bool free_rwops, GPU_FileFormatEnum format);
1126 
1128 DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image* image);
1129 
1131 DECLSPEC void SDLCALL GPU_SetColor(GPU_Image* image, SDL_Color color);
1132 
1134 DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b);
1135 
1137 DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1138 
1141 DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image* image);
1142 
1144 DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image* image);
1145 
1147 DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image* image, GPU_bool enable);
1148 
1150 DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
1151 
1153 DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
1154 
1156 DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode);
1157 
1159 DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter);
1160 
1162 DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image* image, float anchor_x, float anchor_y);
1163 
1165 DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image* image, float* anchor_x, float* anchor_y);
1166 
1168 DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image* image);
1169 
1171 DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode);
1172 
1174 DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image* image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y);
1175 
1176 // End of ImageControls
1180 // Surface / Image / Target conversions
1185 DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromSurface(SDL_Surface* surface);
1186 
1188 DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromTarget(GPU_Target* target);
1189 
1191 DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromTarget(GPU_Target* target);
1192 
1194 DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromImage(GPU_Image* image);
1195 
1196 // End of Conversions
1206 // Basic vector operations (3D)
1207 
1209 DECLSPEC float SDLCALL GPU_VectorLength(float* vec3);
1210 
1212 DECLSPEC void SDLCALL GPU_VectorNormalize(float* vec3);
1213 
1215 DECLSPEC float SDLCALL GPU_VectorDot(float* A, float* B);
1216 
1218 DECLSPEC void SDLCALL GPU_VectorCross(float* result, float* A, float* B);
1219 
1221 DECLSPEC void SDLCALL GPU_VectorCopy(float* result, float* A);
1222 
1224 DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float* vec3, float* matrix_4x4);
1225 
1226 
1227 
1228 // Basic matrix operations (4x4)
1229 
1231 DECLSPEC void SDLCALL GPU_MatrixCopy(float* result, const float* A);
1232 
1234 DECLSPEC void SDLCALL GPU_MatrixIdentity(float* result);
1235 
1237 DECLSPEC void SDLCALL GPU_MatrixOrtho(float* result, float left, float right, float bottom, float top, float near, float far);
1238 
1240 DECLSPEC void SDLCALL GPU_MatrixFrustum(float* result, float left, float right, float bottom, float top, float near, float far);
1241 
1243 DECLSPEC void SDLCALL GPU_MatrixPerspective(float* result, float fovy, float aspect, float zNear, float zFar);
1244 
1246 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);
1247 
1249 DECLSPEC void SDLCALL GPU_MatrixTranslate(float* result, float x, float y, float z);
1250 
1252 DECLSPEC void SDLCALL GPU_MatrixScale(float* result, float sx, float sy, float sz);
1253 
1255 DECLSPEC void SDLCALL GPU_MatrixRotate(float* result, float degrees, float x, float y, float z);
1256 
1260 DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B);
1261 
1263 DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* B);
1264 
1265 
1266 // Matrix stack accessors
1267 
1269 DECLSPEC const char* SDLCALL GPU_GetMatrixString(float* A);
1270 
1272 DECLSPEC float* SDLCALL GPU_GetCurrentMatrix(void);
1273 
1275 DECLSPEC float* SDLCALL GPU_GetModelView(void);
1276 
1278 DECLSPEC float* SDLCALL GPU_GetProjection(void);
1279 
1281 DECLSPEC void SDLCALL GPU_GetModelViewProjection(float* result);
1282 
1283 
1284 // Matrix stack manipulators
1285 
1287 DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode);
1288 
1290 DECLSPEC void SDLCALL GPU_PushMatrix(void);
1291 
1293 DECLSPEC void SDLCALL GPU_PopMatrix(void);
1294 
1296 DECLSPEC void SDLCALL GPU_LoadIdentity(void);
1297 
1299 DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
1300 
1302 DECLSPEC void SDLCALL GPU_Frustum(float left, float right, float bottom, float top, float near, float far);
1303 
1305 DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z);
1306 
1308 DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz);
1309 
1311 DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z);
1312 
1314 DECLSPEC void SDLCALL GPU_MultMatrix(float* matrix4x4);
1315 
1316 // End of Matrix
1328 DECLSPEC void SDLCALL GPU_Clear(GPU_Target* target);
1329 
1331 DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target* target, SDL_Color color);
1332 
1334 DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
1335 
1337 DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1338 
1343 DECLSPEC void SDLCALL GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y);
1344 
1350 DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees);
1351 
1358 DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY);
1359 
1367 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);
1368 
1378 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);
1379 
1384 DECLSPEC void SDLCALL GPU_BlitRect(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, GPU_Rect* dest_rect);
1385 
1394 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);
1395 
1396 
1402 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);
1403 
1409 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);
1410 
1412 DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void);
1413 
1415 DECLSPEC void SDLCALL GPU_Flip(GPU_Target* target);
1416 
1417 // End of Rendering
1433 DECLSPEC void SDLCALL GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color);
1434 
1443 DECLSPEC void SDLCALL GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1444 
1454 DECLSPEC void SDLCALL GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1455 
1465 DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1466 
1474 DECLSPEC void SDLCALL GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1475 
1483 DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1484 
1494 DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1495 
1505 DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1506 
1517 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);
1518 
1529 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);
1530 
1541 DECLSPEC void SDLCALL GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1542 
1553 DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1554 
1563 DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1564 
1570 DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target* target, GPU_Rect rect, SDL_Color color);
1571 
1580 DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1581 
1587 DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target* target, GPU_Rect rect, SDL_Color color);
1588 
1598 DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1599 
1606 DECLSPEC void SDLCALL GPU_RectangleRound2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color);
1607 
1617 DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1618 
1625 DECLSPEC void SDLCALL GPU_RectangleRoundFilled2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color);
1626 
1633 DECLSPEC void SDLCALL GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1634 
1641 DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1642 
1643 // End of Shapes
1657 DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void);
1658 
1660 DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object);
1661 
1663 DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops* shader_source, GPU_bool free_rwops);
1664 
1666 DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source);
1667 
1669 DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename);
1670 
1672 DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2);
1673 
1675 DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count);
1676 
1678 DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object);
1679 
1681 DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object);
1682 
1684 DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object);
1685 
1687 DECLSPEC GPU_bool SDLCALL GPU_LinkShaderProgram(Uint32 program_object);
1688 
1690 DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void);
1691 
1693 DECLSPEC GPU_bool SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object);
1694 
1696 DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock* block);
1697 
1699 DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void);
1700 
1702 DECLSPEC const char* SDLCALL GPU_GetShaderMessage(void);
1703 
1705 DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name);
1706 
1708 DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, GPU_bool normalize, int stride_bytes, int offset_bytes);
1709 
1711 DECLSPEC GPU_Attribute SDLCALL GPU_MakeAttribute(int location, void* values, GPU_AttributeFormat format);
1712 
1714 DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name);
1715 
1717 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);
1718 
1720 DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block);
1721 
1723 DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void);
1724 
1729 DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image* image, int location, int image_unit);
1730 
1732 DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int* values);
1733 
1736 DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value);
1737 
1739 DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values);
1740 
1742 DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values);
1743 
1746 DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value);
1747 
1749 DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values);
1750 
1752 DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float* values);
1753 
1756 DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value);
1757 
1759 DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values);
1760 
1762 DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values);
1763 
1765 DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, GPU_bool transpose, float* values);
1766 
1768 DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value);
1769 
1771 DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value);
1772 
1774 DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value);
1775 
1777 DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float* value);
1778 
1780 DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int* value);
1781 
1783 DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value);
1784 
1786 DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source);
1787 
1788 // End of ShaderInterface
1792 #ifdef __cplusplus
1793 }
1794 #endif
1795 
1796 #include "close_code.h"
1797 
1798 
1799 #endif
1800 
DECLSPEC float SDLCALL GPU_VectorDot(float *A, float *B)
Definition: SDL_gpu_matrix.c:71
DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image *image, const GPU_Rect *image_rect, SDL_Surface *surface, const GPU_Rect *surface_rect)
Definition: SDL_gpu.c:983
Definition: SDL_gpu.h:578
DECLSPEC void SDLCALL GPU_MatrixCopy(float *result, const float *A)
Definition: SDL_gpu_matrix.c:122
DECLSPEC void SDLCALL GPU_Clear(GPU_Target *target)
Definition: SDL_gpu.c:1981
DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target *target, GPU_bool use_camera)
Definition: SDL_gpu.c:891
Definition: SDL_gpu.h:119
DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object)
Definition: SDL_gpu.c:2145
DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen(GPU_bool enable_fullscreen, GPU_bool use_desktop_resolution)
Definition: SDL_gpu.c:505
DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void)
Definition: SDL_gpu.c:2196
DECLSPEC void SDLCALL GPU_ResetRendererState(void)
Definition: SDL_gpu.c:89
DECLSPEC void SDLCALL GPU_PushMatrix(void)
Definition: SDL_gpu_matrix.c:432
DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image *image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y)
Definition: SDL_gpu.c:1953
Definition: SDL_gpu.h:608
DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1681
DECLSPEC void SDLCALL GPU_MultMatrix(float *matrix4x4)
Definition: SDL_gpu_matrix.c:508
DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target *target)
Definition: SDL_gpu.c:1539
DECLSPEC void SDLCALL GPU_SetShapeBlending(GPU_bool enable)
Definition: SDL_gpu.c:1723
DECLSPEC GPU_bool SDLCALL GPU_ReplaceImage(GPU_Image *image, SDL_Surface *surface, const GPU_Rect *surface_rect)
Definition: SDL_gpu.c:999
Definition: SDL_gpu.h:570
DECLSPEC void SDLCALL GPU_Line(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
Definition: SDL_gpu_shapes.c:34
DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2)
Definition: SDL_gpu.c:2114
DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float scaleX, float scaleY)
Definition: SDL_gpu.c:1355
DECLSPEC GPU_Target *SDLCALL GPU_GetWindowTarget(Uint32 windowID)
Definition: SDL_gpu.c:385
DECLSPEC GPU_bool SDLCALL GPU_SaveSurface_RW(SDL_Surface *surface, SDL_RWops *rwops, GPU_bool free_rwops, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:1204
DECLSPEC void SDLCALL GPU_MatrixFrustum(float *result, float left, float right, float bottom, float top, float near, float far)
Definition: SDL_gpu_matrix.c:163
DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void)
Definition: SDL_gpu.c:2025
DECLSPEC void SDLCALL GPU_SetLogCallback(int(*callback)(GPU_LogLevelEnum log_level, const char *format, va_list args))
Definition: SDL_gpu.c:151
DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image *image, GPU_SnapEnum mode)
Definition: SDL_gpu.c:1945
DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char *shader_source)
Definition: SDL_gpu.c:2090
Definition: SDL_gpu.h:300
DECLSPEC void SDLCALL GPU_GetVirtualResolution(GPU_Target *target, Uint16 *w, Uint16 *h)
Definition: SDL_gpu.c:538
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)
Definition: SDL_gpu.c:1371
DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target *target, SDL_Color color)
Definition: SDL_gpu.c:1657
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)
Definition: SDL_gpu_shapes.c:78
DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source)
Definition: SDL_gpu.c:2435
DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void)
Definition: SDL_gpu.c:215
DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char *attrib_name)
Definition: SDL_gpu.c:2212
DECLSPEC float SDLCALL GPU_GetLineThickness(void)
Definition: SDL_gpu_shapes.c:22
DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level)
Definition: SDL_gpu.c:680
DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled(GPU_Target *target)
Definition: SDL_gpu.c:899
DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void)
Definition: SDL_gpu_renderer.c:43
DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target *target, GPU_Rect viewport)
Definition: SDL_gpu.c:855
DECLSPEC GPU_Image *SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format)
Definition: SDL_gpu.c:906
GPU_LogLevelEnum
Definition: SDL_gpu.h:634
DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen(void)
Definition: SDL_gpu.c:513
DECLSPEC void SDLCALL GPU_MatrixTranslate(float *result, float x, float y, float z)
Definition: SDL_gpu_matrix.c:233
struct GPU_BlendMode GPU_BlendMode
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)
Definition: SDL_gpu_matrix.c:194
DECLSPEC void SDLCALL GPU_VectorCross(float *result, float *A, float *B)
Definition: SDL_gpu_matrix.c:76
DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features)
Definition: SDL_gpu.c:230
DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void)
Definition: SDL_gpu.c:867
DECLSPEC void SDLCALL GPU_Tri(GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
Definition: SDL_gpu_shapes.c:90
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromTarget(GPU_Target *target)
Definition: SDL_gpu.c:1254
Definition: SDL_gpu_RendererImpl.h:16
DECLSPEC void SDLCALL GPU_PushErrorCode(const char *function, GPU_ErrorEnum error, const char *details,...)
Definition: SDL_gpu.c:692
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromImage(GPU_Image *image)
Definition: SDL_gpu.c:1276
DECLSPEC void SDLCALL GPU_GetModelViewProjection(float *result)
Definition: SDL_gpu_matrix.c:519
DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int *order_size, GPU_RendererID *order)
Definition: SDL_gpu_renderer.c:323
DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z)
Definition: SDL_gpu_matrix.c:490
GPU_FileFormatEnum
Definition: SDL_gpu.h:244
DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int *values)
Definition: SDL_gpu.c:2311
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)
Definition: SDL_gpu.c:1425
DECLSPEC GPU_bool SDLCALL GPU_IntersectRect(GPU_Rect A, GPU_Rect B, GPU_Rect *result)
Definition: SDL_gpu.c:1548
struct GPU_AttributeFormat GPU_AttributeFormat
Uint32 GPU_BatchFlagEnum
Definition: SDL_gpu.h:477
DECLSPEC GPU_Image *SDLCALL GPU_CreateAliasImage(GPU_Image *image)
Definition: SDL_gpu.c:947
DECLSPEC void SDLCALL GPU_LogInfo(const char *format,...)
Definition: SDL_gpu.c:159
DECLSPEC GPU_Target *SDLCALL GPU_LoadTarget(GPU_Image *image)
Definition: SDL_gpu.c:1302
DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target *target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color)
Definition: SDL_gpu_shapes.c:96
DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target *target)
Definition: SDL_gpu.c:1696
DECLSPEC float *SDLCALL GPU_GetProjection(void)
Definition: SDL_gpu_matrix.c:402
Definition: SDL_gpu.h:313
DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image *image, GPU_bool enable)
Definition: SDL_gpu.c:1715
DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target *target, float x, float y, float rx, float ry, float degrees, SDL_Color color)
Definition: SDL_gpu_shapes.c:72
DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1666
DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, GPU_bool transpose, float *values)
Definition: SDL_gpu.c:2378
DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void)
Definition: SDL_gpu.c:225
DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void)
Definition: SDL_gpu.c:235
DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z)
Definition: SDL_gpu_matrix.c:502
DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1634
DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:126
GPU_bool(SDLCALL *SetWindowResolution)(GPU_Renderer *renderer
DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void)
Definition: SDL_gpu.c:2106
GPU_WrapEnum
Definition: SDL_gpu.h:216
GPU_Camera camera
Definition: SDL_gpu.h:415
Definition: SDL_gpu.h:645
DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void)
Definition: SDL_gpu.c:2272
DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object)
Definition: SDL_gpu.c:2169
DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
Definition: SDL_gpu.c:1847
GPU_BlendPresetEnum
Definition: SDL_gpu.h:175
DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target *target)
Definition: SDL_gpu.c:873
DECLSPEC void SDLCALL GPU_Flip(GPU_Target *target)
Definition: SDL_gpu.c:2033
DECLSPEC void SDLCALL GPU_MatrixRotate(float *result, float degrees, float x, float y, float z)
Definition: SDL_gpu_matrix.c:279
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)
Definition: SDL_gpu_shapes.c:84
DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int *values)
Definition: SDL_gpu.c:2336
DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int *value)
Definition: SDL_gpu.c:2427
Definition: SDL_gpu.h:336
GPU_FilterEnum
Definition: SDL_gpu.h:193
DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max)
Definition: SDL_gpu.c:624
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface_RW(SDL_RWops *rwops, GPU_bool free_rwops)
Definition: SDL_gpu.c:1089
DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock *block)
Definition: SDL_gpu.c:2188
Definition: SDL_gpu.h:559
DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target *target, SDL_Color color)
Definition: SDL_gpu.c:1992
DECLSPEC GPU_bool SDLCALL GPU_LinkShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2098
DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:1528
DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value)
Definition: SDL_gpu.c:2353
Uint32 GPU_FeatureEnum
Definition: SDL_gpu.h:429
GPU_SnapEnum
Definition: SDL_gpu.h:204
DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
Definition: SDL_gpu_shapes.c:48
DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target *target, Sint16 x, Sint16 y)
Definition: SDL_gpu.c:1964
GPU_ShaderLanguageEnum
Definition: SDL_gpu.h:549
int drawable_w
Definition: SDL_gpu.h:359
DECLSPEC void SDLCALL GPU_MatrixPerspective(float *result, float fovy, float aspect, float zNear, float zFar)
Definition: SDL_gpu_matrix.c:181
DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image *image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha)
Definition: SDL_gpu.c:1816
DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char *name, GPU_RendererEnum renderer, int major_version, int minor_version)
Definition: SDL_gpu.c:844
DECLSPEC void SDLCALL GPU_MatrixIdentity(float *result)
Definition: SDL_gpu_matrix.c:127
DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image *image, int location, int image_unit)
Definition: SDL_gpu.c:2287
DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
Definition: SDL_gpu_shapes.c:102
DECLSPEC void SDLCALL GPU_Quit(void)
Definition: SDL_gpu.c:642
DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target *target, GPU_Camera *cam)
Definition: SDL_gpu.c:880
GPU_FormatEnum
Definition: SDL_gpu.h:226
DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1873
DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value)
Definition: SDL_gpu.c:2328
DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image *image, const GPU_Rect *image_rect, const unsigned char *bytes, int bytes_per_row)
Definition: SDL_gpu.c:991
DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image *image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
Definition: SDL_gpu.c:1827
Uint32 windowID
Definition: SDL_gpu.h:352
DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target *target, float x1, float y1, float x2, float y2, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:138
DECLSPEC float *SDLCALL GPU_GetCurrentMatrix(void)
Definition: SDL_gpu_matrix.c:415
DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image *image)
Definition: SDL_gpu.c:1506
Definition: SDL_gpu.h:345
DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
Definition: SDL_gpu_shapes.c:114
DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void)
Definition: SDL_gpu_renderer.c:37
GPU_ErrorEnum
Definition: SDL_gpu.h:597
DECLSPEC void SDLCALL GPU_VectorCopy(float *result, float *A)
Definition: SDL_gpu_matrix.c:83
GPU_Target * current_context_target
Definition: SDL_gpu.h:659
DECLSPEC GPU_bool SDLCALL GPU_SaveImage_RW(GPU_Image *image, SDL_RWops *rwops, GPU_bool free_rwops, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:963
DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h)
Definition: SDL_gpu.c:822
DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void)
Definition: SDL_gpu.c:633
DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int *values)
Definition: SDL_gpu.c:2320
DECLSPEC void SDLCALL GPU_UnsetImageVirtualResolution(GPU_Image *image)
Definition: SDL_gpu.c:589
DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image *image)
Definition: SDL_gpu.c:1706
DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, GPU_bool normalize, int stride_bytes, int offset_bytes)
Definition: SDL_gpu.c:2220
DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer *(SDLCALL *create_renderer)(GPU_RendererID request), void(SDLCALL *free_renderer)(GPU_Renderer *renderer))
DECLSPEC GPU_Target *SDLCALL GPU_CreateAliasTarget(GPU_Target *target)
Definition: SDL_gpu.c:486
DECLSPEC GPU_Target *SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
Definition: SDL_gpu.c:433
void * context
Definition: SDL_gpu.h:348
DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness)
Definition: SDL_gpu_shapes.c:16
int window_w
Definition: SDL_gpu.h:355
DECLSPEC GPU_Target *SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID)
Definition: SDL_gpu.c:478
GPU_ShaderEnum
Definition: SDL_gpu.h:537
DECLSPEC void SDLCALL GPU_Polygon(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
Definition: SDL_gpu_shapes.c:150
DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
Definition: SDL_gpu_shapes.c:156
DECLSPEC float SDLCALL GPU_VectorLength(float *vec3)
Definition: SDL_gpu_matrix.c:58
DECLSPEC void SDLCALL GPU_GetRendererOrder(int *order_size, GPU_RendererID *order)
Definition: SDL_gpu_renderer.c:287
DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h)
Definition: SDL_gpu.c:529
struct GPU_Camera GPU_Camera
DECLSPEC GPU_Target *SDLCALL GPU_GetContextTarget(void)
Definition: SDL_gpu.c:1293
int stored_window_w
Definition: SDL_gpu.h:363
DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:2003
DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2153
DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID *renderers_array)
Definition: SDL_gpu_renderer.c:59
DECLSPEC GPU_bool SDLCALL GPU_SaveSurface(SDL_Surface *surface, const char *filename, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:1149
DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float *values)
Definition: SDL_gpu.c:2361
GPU_BlendEqEnum
Definition: SDL_gpu.h:151
DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode)
Definition: SDL_gpu_matrix.c:380
Definition: SDL_gpu.h:159
DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value)
Definition: SDL_gpu.c:2403
GPU_RendererID id
Definition: SDL_gpu.h:648
DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID *order)
Definition: SDL_gpu_renderer.c:296
DECLSPEC void SDLCALL GPU_SetCoordinateMode(GPU_bool use_math_coords)
Definition: SDL_gpu.c:97
DECLSPEC void SDLCALL GPU_Circle(GPU_Target *target, float x, float y, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:54
DECLSPEC float *SDLCALL GPU_GetModelView(void)
Definition: SDL_gpu_matrix.c:389
DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer)
Definition: SDL_gpu_renderer.c:113
Definition: SDL_gpu.h:398
DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:833
DECLSPEC void SDLCALL GPU_Arc(GPU_Target *target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color)
Definition: SDL_gpu_shapes.c:41
float default_image_anchor_x
Definition: SDL_gpu.h:665
DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int *values)
Definition: SDL_gpu.c:2295
Uint32 GPU_TypeEnum
Definition: SDL_gpu.h:515
DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image *image, float *anchor_x, float *anchor_y)
Definition: SDL_gpu.c:1925
DECLSPEC void SDLCALL GPU_MatrixScale(float *result, float sx, float sy, float sz)
Definition: SDL_gpu_matrix.c:261
DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image *image, GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1836
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromSurface(SDL_Surface *surface)
Definition: SDL_gpu.c:1246
DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target *target, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:552
Uint32(SDLCALL *CreateShaderProgram)(GPU_Renderer *renderer)
DECLSPEC void SDLCALL GPU_UnsetViewport(GPU_Target *target)
Definition: SDL_gpu.c:861
DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value)
Definition: SDL_gpu.c:2387
DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far)
Definition: SDL_gpu_matrix.c:478
GPU_DebugLevelEnum
Definition: SDL_gpu.h:621
DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target *target, GPU_Rect rect)
Definition: SDL_gpu.c:1517
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)
Definition: SDL_gpu.c:1387
DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float *vec3, float *matrix_4x4)
Definition: SDL_gpu_matrix.c:90
DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value)
Definition: SDL_gpu.c:2395
GPU_BlendFuncEnum
Definition: SDL_gpu.h:133
Uint32 GPU_InitFlagEnum
Definition: SDL_gpu.h:460
DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
Definition: SDL_gpu.c:1861
DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target *target, GPU_Rect B, GPU_Rect *result)
Definition: SDL_gpu.c:1597
DECLSPEC const char *SDLCALL GPU_GetMatrixString(float *A)
Definition: SDL_gpu_matrix.c:360
DECLSPEC GPU_Target *SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
Definition: SDL_gpu.c:405
DECLSPEC void SDLCALL GPU_MatrixOrtho(float *result, float left, float right, float bottom, float top, float near, float far)
Definition: SDL_gpu_matrix.c:134
DECLSPEC void SDLCALL GPU_PopMatrix(void)
Definition: SDL_gpu_matrix.c:450
DECLSPEC GPU_Image *SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, GPU_bool take_ownership)
Definition: SDL_gpu.c:914
DECLSPEC GPU_bool SDLCALL GPU_SaveImage(GPU_Image *image, const char *filename, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:955
DECLSPEC void SDLCALL GPU_LogWarning(const char *format,...)
Definition: SDL_gpu.c:167
DECLSPEC void SDLCALL GPU_Frustum(float left, float right, float bottom, float top, float near, float far)
Definition: SDL_gpu_matrix.c:484
DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image *image)
Definition: SDL_gpu.c:1648
DECLSPEC void SDLCALL GPU_RectangleRound2(GPU_Target *target, GPU_Rect rect, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:132
DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void)
Definition: SDL_gpu.c:736
DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature)
Definition: SDL_gpu.c:470
GPU_Context * context
Definition: SDL_gpu.h:419
DECLSPEC void SDLCALL GPU_BlitRect(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, GPU_Rect *dest_rect)
Definition: SDL_gpu.c:1403
DECLSPEC void SDLCALL GPU_RectangleRoundFilled2(GPU_Target *target, GPU_Rect rect, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:144
DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id)
Definition: SDL_gpu.c:81
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)
Definition: SDL_gpu.c:1485
DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image *image)
Definition: SDL_gpu.c:1937
struct GPU_Attribute GPU_Attribute
DECLSPEC void SDLCALL GPU_SetImageVirtualResolution(GPU_Image *image, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:576
Definition: SDL_gpu.h:263
DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object)
Definition: SDL_gpu.c:2161
GPU_bool coordinate_mode
Definition: SDL_gpu.h:662
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage_RW(SDL_RWops *rwops, GPU_bool free_rwops)
Definition: SDL_gpu.c:927
DECLSPEC void SDLCALL GPU_LogError(const char *format,...)
Definition: SDL_gpu.c:175
DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops *shader_source, GPU_bool free_rwops)
Definition: SDL_gpu.c:2058
DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char *uniform_name)
Definition: SDL_gpu.c:2241
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)
Definition: SDL_gpu.c:1480
DECLSPEC void SDLCALL GPU_SetColor(GPU_Image *image, SDL_Color color)
Definition: SDL_gpu.c:1612
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromTarget(GPU_Target *target)
Definition: SDL_gpu.c:1265
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage(const char *filename)
Definition: SDL_gpu.c:922
struct GPU_Image GPU_Image
DECLSPEC GPU_Image *SDLCALL GPU_CopyImage(GPU_Image *image)
Definition: SDL_gpu.c:975
DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:2014
DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target *target)
Definition: SDL_gpu.c:565
DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int *value)
Definition: SDL_gpu.c:2419
DECLSPEC GPU_Attribute SDLCALL GPU_MakeAttribute(int location, void *values, GPU_AttributeFormat format)
Definition: SDL_gpu.c:2232
DECLSPEC void SDLCALL GPU_Blit(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y)
Definition: SDL_gpu.c:1322
DECLSPEC GPU_Renderer *SDLCALL GPU_GetCurrentRenderer(void)
Definition: SDL_gpu.c:113
DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char *filename)
Definition: SDL_gpu.c:2070
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface(const char *filename)
Definition: SDL_gpu.c:1135
DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float *value)
Definition: SDL_gpu.c:2411
DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value)
Definition: SDL_gpu.c:2303
DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target *target)
Definition: SDL_gpu.c:1312
DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID *renderers_array)
Definition: SDL_gpu_renderer.c:94
DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image *image, GPU_FilterEnum filter)
Definition: SDL_gpu.c:1884
struct GPU_RendererID GPU_RendererID
DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target *target, float x, float y, float radius, SDL_Color color)
Definition: SDL_gpu_shapes.c:60
DECLSPEC void SDLCALL GPU_VectorNormalize(float *vec3)
Definition: SDL_gpu_matrix.c:63
DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float *values)
Definition: SDL_gpu.c:2345
struct GPU_ErrorObject GPU_ErrorObject
DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float *result, float *B)
Definition: SDL_gpu_matrix.c:348
Uint32 current_shader_program
Definition: SDL_gpu.h:367
DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void)
Definition: SDL_gpu_renderer.c:78
DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset)
Definition: SDL_gpu.c:1732
DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image *image)
Definition: SDL_gpu.c:1284
DECLSPEC GPU_Renderer *SDLCALL GPU_GetRenderer(GPU_RendererID id)
Definition: SDL_gpu_renderer.c:411
struct GPU_Context GPU_Context
DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target *target, Uint32 windowID)
Definition: SDL_gpu.c:497
DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID)
Definition: SDL_gpu.c:210
DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image *image, float anchor_x, float anchor_y)
Definition: SDL_gpu.c:1916
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)
Definition: SDL_gpu.c:2249
struct GPU_Rect GPU_Rect
DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz)
Definition: SDL_gpu_matrix.c:496
struct GPU_AttributeSource GPU_AttributeSource
struct GPU_MatrixStack GPU_MatrixStack
DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block)
Definition: SDL_gpu.c:2264
DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float *values)
Definition: SDL_gpu.c:2370
DECLSPEC void SDLCALL GPU_Multiply4x4(float *result, float *A, float *B)
Definition: SDL_gpu_matrix.c:325
DECLSPEC void SDLCALL GPU_GetDefaultAnchor(float *anchor_x, float *anchor_y)
Definition: SDL_gpu.c:1904
Definition: SDL_gpu.h:89
DECLSPEC GPU_bool SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2177
DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags)
Definition: SDL_gpu.c:220
DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees)
Definition: SDL_gpu.c:1339
DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1620
DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target *target, float *x, float *y, float displayX, float displayY)
Definition: SDL_gpu.c:788
DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void)
Definition: SDL_gpu.c:687
DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void)
Definition: SDL_gpu.c:118
DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
Definition: SDL_gpu_shapes.c:108
struct GPU_ShaderBlock GPU_ShaderBlock
DECLSPEC GPU_Target *SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
Definition: SDL_gpu.c:439
DECLSPEC const char *SDLCALL GPU_GetShaderMessage(void)
Definition: SDL_gpu.c:2204
DECLSPEC const char *SDLCALL GPU_GetErrorString(GPU_ErrorEnum error)
Definition: SDL_gpu.c:765
DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target *target, float x, float y, float rx, float ry, float degrees, SDL_Color color)
Definition: SDL_gpu_shapes.c:66
DECLSPEC void SDLCALL GPU_Pixel(GPU_Target *target, float x, float y, SDL_Color color)
Definition: SDL_gpu_shapes.c:28
SDL_Color(SDLCALL *GetPixel)(GPU_Renderer *renderer
DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count)
Definition: SDL_gpu.c:2122
DECLSPEC void SDLCALL GPU_SetDefaultAnchor(float anchor_x, float anchor_y)
Definition: SDL_gpu.c:1895
DECLSPEC void SDLCALL GPU_LoadIdentity(void)
Definition: SDL_gpu_matrix.c:468
DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
Definition: SDL_gpu_shapes.c:120