SDL_gpu  0.11.0
A hardware-accelerated, cross-platform 2D graphics API
SDL_gpu.h
Go to the documentation of this file.
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;
126 
127 
133 typedef enum {
145 
151 typedef enum {
152  GPU_EQ_ADD = 0x8006,
153  GPU_EQ_SUBTRACT = 0x800A,
156 
159 typedef struct GPU_BlendMode
160 {
165 
168 } GPU_BlendMode;
169 
175 typedef enum {
188 
193 typedef enum {
198 
204 typedef enum {
209 } GPU_SnapEnum;
210 
211 
216 typedef enum {
220 } GPU_WrapEnum;
221 
226 typedef enum {
236 
244 typedef enum {
250 
251 
252 
263 typedef struct GPU_Image
264 {
268  Uint16 w, h;
273  Uint16 base_w, base_h; // Original image dimensions
274  Uint16 texture_w, texture_h; // Underlying texture dimensions
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;
287 
288  void* data;
289  int refcount;
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
319  // Uniforms
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;
350 
352  Uint32 windowID;
353 
355  int window_w;
356  int window_h;
357 
361 
365 
370 
374 
379 
383 
384  void* data;
385 } GPU_Context;
386 
387 
399 {
403  void* data;
404  Uint16 w, h;
406  Uint16 base_w, base_h; // The true dimensions of the underlying image or window
410  SDL_Color color;
411 
413 
417 
420  int refcount;
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 {
543 
544 
545 
549 typedef enum {
557 
559 typedef struct GPU_AttributeFormat
560 {
561  GPU_bool is_per_sprite; // Per-sprite values are expanded to 4 vertices
563  GPU_TypeEnum type; // GPU_TYPE_FLOAT, GPU_TYPE_INT, GPU_TYPE_UNSIGNED_INT, etc.
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
575 } GPU_Attribute;
576 
578 typedef struct GPU_AttributeSource
579 {
582  void* next_value;
583  // Automatic storage format
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
590 
591 
597 typedef enum {
605 } GPU_ErrorEnum;
606 
608 typedef struct GPU_ErrorObject
609 {
610  char* function;
612  char* details;
614 
615 
621 typedef enum {
628 
629 
634 typedef enum {
639 
640 
641 /* Private implementation of renderer members */
642 struct GPU_RendererImpl;
643 
646 {
650  GPU_WindowFlagEnum SDL_init_flags;
651  GPU_InitFlagEnum GPU_init_flags;
652 
656  GPU_FeatureEnum enabled_features;
657 
660 
663 
667 
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 {
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 
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
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 
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 
1175 
1176 // End of ImageControls
1180 // Surface / Image / Target conversions
1185 DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromSurface(SDL_Surface* surface);
1186 
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 
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 
1682 
1685 
1688 
1690 DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void);
1691 
1694 
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 
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 
struct GPU_Renderer * renderer
Definition: SDL_gpu.h:400
int minor_version
Definition: SDL_gpu.h:124
Uint16 w
Definition: SDL_gpu.h:404
GPU_Target * context_target
Definition: SDL_gpu.h:266
DECLSPEC float SDLCALL GPU_GetLineThickness(void)
DECLSPEC void SDLCALL GPU_VectorCross(float *result, float *A, float *B)
DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void)
Definition: SDL_gpu.c:215
DECLSPEC void SDLCALL GPU_DetachShader(Uint32 program_object, Uint32 shader_object)
Definition: SDL_gpu.c:2161
GPU_bool GPU_bool use_desktop_resolution
void * values
Definition: SDL_gpu.h:573
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))
GPU_FilterEnum
Definition: SDL_gpu.h:193
DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags)
Definition: SDL_gpu.c:220
DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float *value)
Definition: SDL_gpu.c:2403
DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source)
Definition: SDL_gpu.c:2427
GPU_FileFormatEnum
Definition: SDL_gpu.h:244
DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void)
Definition: SDL_gpu.c:2264
DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image *image)
Definition: SDL_gpu.c:1929
GPU_WrapEnum
Definition: SDL_gpu.h:216
GPU_BlendFuncEnum dest_alpha
Definition: SDL_gpu.h:164
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)
Definition: SDL_gpu.c:497
int location
Definition: SDL_gpu.h:572
GPU_BlendEqEnum color_equation
Definition: SDL_gpu.h:166
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface(const char *filename)
Definition: SDL_gpu.c:1135
GPU_DebugLevelEnum
Definition: SDL_gpu.h:621
DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max)
Definition: SDL_gpu.c:624
int position_loc
Definition: SDL_gpu.h:316
DECLSPEC GPU_bool SDLCALL GPU_SaveSurface(SDL_Surface *surface, const char *filename, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:1149
DECLSPEC void SDLCALL GPU_GetDefaultAnchor(float *anchor_x, float *anchor_y)
Definition: SDL_gpu.c:1896
Uint16 base_w
Definition: SDL_gpu.h:273
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
GPU_bool use_clip_rect
Definition: SDL_gpu.h:407
DECLSPEC float *SDLCALL GPU_GetProjection(void)
GPU_RendererID requested_id
Definition: SDL_gpu.h:649
DECLSPEC const char *SDLCALL GPU_GetShaderMessage(void)
Definition: SDL_gpu.c:2196
DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target *target, Sint16 x, Sint16 y)
Definition: SDL_gpu.c:1956
DECLSPEC void SDLCALL GPU_Flip(GPU_Target *target)
Definition: SDL_gpu.c:2025
#define GPU_MATRIX_STACK_MAX
Definition: SDL_gpu.h:331
DECLSPEC GPU_Target *SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
Definition: SDL_gpu.c:433
Uint32 windowID
Definition: SDL_gpu.h:352
int drawable_h
Definition: SDL_gpu.h:360
GPU_BlendEqEnum
Definition: SDL_gpu.h:151
#define SDL_GPU_VERSION_PATCH
Definition: SDL_gpu.h:18
DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z)
GPU_SnapEnum snap_mode
Definition: SDL_gpu.h:284
DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void)
DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
Definition: SDL_gpu.c:1853
DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object)
Definition: SDL_gpu.c:2153
DECLSPEC void SDLCALL GPU_SetColor(GPU_Image *image, SDL_Color color)
Definition: SDL_gpu.c:1604
#define SDL_GPU_VERSION_MAJOR
Definition: SDL_gpu.h:16
DECLSPEC GPU_bool SDLCALL GPU_ReplaceImage(GPU_Image *image, SDL_Surface *surface, const GPU_Rect *surface_rect)
Definition: SDL_gpu.c:999
DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen(void)
Definition: SDL_gpu.c:513
DECLSPEC GPU_Target *SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID)
Definition: SDL_gpu.c:478
DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target *target, GPU_bool use_camera)
Definition: SDL_gpu.c:891
DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void)
Definition: SDL_gpu.c:225
GPU_Attribute attribute
Definition: SDL_gpu.h:588
DECLSPEC GPU_bool SDLCALL GPU_SetFullscreen(GPU_bool enable_fullscreen, GPU_bool use_desktop_resolution)
Definition: SDL_gpu.c:505
DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image *image, int location, int image_unit)
Definition: SDL_gpu.c:2279
GPU_bool enabled
Definition: SDL_gpu.h:580
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
Uint32 current_shader_program
Definition: SDL_gpu.h:367
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:1477
GPU_Target Uint8 Uint8 Uint8 b
DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image *image, GPU_FilterEnum filter)
Definition: SDL_gpu.c:1876
GPU_Image GPU_WrapEnum wrap_mode_x
GPU_Rect viewport
Definition: SDL_gpu.h:412
int per_vertex_storage_size
Definition: SDL_gpu.h:586
DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void)
Definition: SDL_gpu.c:2017
DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value)
Definition: SDL_gpu.c:2387
GPU_TypeEnum type
Definition: SDL_gpu.h:563
GPU_ShaderBlock default_untextured_shader_block
Definition: SDL_gpu.h:373
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)
Definition: SDL_gpu.c:2370
struct GPU_Renderer * renderer
Definition: SDL_gpu.h:265
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)
float zoom
Definition: SDL_gpu.h:304
GPU_RendererID id
Definition: SDL_gpu.h:648
int modelViewProjection_loc
Definition: SDL_gpu.h:320
float line_thickness
Definition: SDL_gpu.h:377
int window_w
Definition: SDL_gpu.h:355
DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode)
DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target *target, SDL_Color color)
Definition: SDL_gpu.c:1649
DECLSPEC void SDLCALL GPU_SetLogCallback(int(*callback)(GPU_LogLevelEnum log_level, const char *format, va_list args))
Definition: SDL_gpu.c:151
DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void)
Definition: SDL_gpu.c:76
DECLSPEC GPU_Target *SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags)
Definition: SDL_gpu.c:439
DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled(GPU_Target *target)
Definition: SDL_gpu.c:899
DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float *values)
Definition: SDL_gpu.c:2362
GPU_Image GPU_FilterEnum filter
DECLSPEC void SDLCALL GPU_SetCoordinateMode(GPU_bool use_math_coords)
Definition: SDL_gpu.c:97
DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float *values)
Definition: SDL_gpu.c:2353
Uint32 GPU_InitFlagEnum
Definition: SDL_gpu.h:460
GPU_MatrixStack modelview_matrix
Definition: SDL_gpu.h:382
DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void)
Definition: SDL_gpu.c:633
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:1808
GPU_Image GPU_WrapEnum GPU_WrapEnum wrap_mode_y
GPU_Image const GPU_Rect const unsigned char * bytes
SDL_Color color
Definition: SDL_gpu.h:280
DECLSPEC GPU_Target *SDLCALL GPU_CreateAliasTarget(GPU_Target *target)
Definition: SDL_gpu.c:486
GPU_BlendMode shapes_blend_mode
Definition: SDL_gpu.h:376
DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block)
Definition: SDL_gpu.c:2256
GPU_bool shapes_use_blending
Definition: SDL_gpu.h:375
DECLSPEC GPU_Target *SDLCALL GPU_GetWindowTarget(Uint32 windowID)
Definition: SDL_gpu.c:385
DECLSPEC GPU_bool SDLCALL GPU_IntersectRect(GPU_Rect A, GPU_Rect B, GPU_Rect *result)
Definition: SDL_gpu.c:1540
DECLSPEC GPU_Target *SDLCALL GPU_GetContextTarget(void)
Definition: SDL_gpu.c:1293
float w
Definition: SDL_gpu.h:92
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)
int max_shader_version
Definition: SDL_gpu.h:655
DECLSPEC GPU_Image *SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, GPU_bool take_ownership)
Definition: SDL_gpu.c:914
GPU_BlendFuncEnum source_color
Definition: SDL_gpu.h:161
DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature)
Definition: SDL_gpu.c:470
DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image *image, GPU_bool enable)
Definition: SDL_gpu.c:1707
GPU_WindowFlagEnum SDL_init_flags
Definition: SDL_gpu.h:650
DECLSPEC void SDLCALL GPU_MatrixRotate(float *result, float degrees, float x, float y, float z)
DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void)
int bytes_per_pixel
Definition: SDL_gpu.h:272
DECLSPEC GPU_Image *SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format)
Definition: SDL_gpu.c:906
DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void)
Definition: SDL_gpu.c:235
GPU_Image const char GPU_FileFormatEnum format
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage(const char *filename)
Definition: SDL_gpu.c:922
DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1658
#define SDL_GPU_VERSION_MINOR
Definition: SDL_gpu.h:17
GPU_bool using_virtual_resolution
Definition: SDL_gpu.h:269
DECLSPEC GPU_Image *SDLCALL GPU_CopyImage(GPU_Image *image)
Definition: SDL_gpu.c:975
GPU_Target float float float float float float y3
GPU_Target * current_context_target
Definition: SDL_gpu.h:659
DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char *uniform_name)
Definition: SDL_gpu.c:2233
GPU_ShaderLanguageEnum shader_language
Definition: SDL_gpu.h:653
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)
Definition: SDL_gpu.c:2212
Uint32 const char const char const char * color_name
DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target *target, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:552
float y
Definition: SDL_gpu.h:91
DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far)
int refcount
Definition: SDL_gpu.h:289
int GPU_Attribute source
GPU_bool normalize
Definition: SDL_gpu.h:564
GPU_Image const GPU_Rect SDL_Surface const GPU_Rect * surface_rect
DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h)
Definition: SDL_gpu.c:529
DECLSPEC void SDLCALL GPU_Polygon(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
Uint32 GPU_BatchFlagEnum
Definition: SDL_gpu.h:477
DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1995
DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float *vec3, float *matrix_4x4)
DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value)
Definition: SDL_gpu.c:2345
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
Uint16 base_w
Definition: SDL_gpu.h:406
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)
Definition: SDL_gpu.c:2090
GPU_Target float float float float y2
DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char *shader_source)
Definition: SDL_gpu.c:2082
DECLSPEC void SDLCALL GPU_UnsetImageVirtualResolution(GPU_Image *image)
Definition: SDL_gpu.c:589
float x
Definition: SDL_gpu.h:91
void * data
Definition: SDL_gpu.h:384
DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int *value)
Definition: SDL_gpu.c:2419
GPU_Image GPU_Rect * src_rect
DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target *target)
Definition: SDL_gpu.c:1531
DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image *image)
Definition: SDL_gpu.c:1284
GPU_SnapEnum
Definition: SDL_gpu.h:204
DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
DECLSPEC void SDLCALL GPU_LogWarning(const char *format,...)
Definition: SDL_gpu.c:167
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_PolygonFilled(GPU_Target *target, unsigned int num_vertices, float *vertices, SDL_Color color)
GPU_ShaderEnum SDL_RWops * shader_source
const char * name
Definition: SDL_gpu.h:121
DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image *image)
Definition: SDL_gpu.c:1498
void * context
Definition: SDL_gpu.h:348
GPU_Target unsigned int float * vertices
DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void)
Definition: SDL_gpu.c:2098
DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:833
DECLSPEC void SDLCALL GPU_SetShapeBlending(GPU_bool enable)
Definition: SDL_gpu.c:1715
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromTarget(GPU_Target *target)
Definition: SDL_gpu.c:1254
GPU_FormatEnum
Definition: SDL_gpu.h:226
int stored_window_w
Definition: SDL_gpu.h:363
GPU_bool use_camera
Definition: SDL_gpu.h:416
DECLSPEC void SDLCALL GPU_GetModelViewProjection(float *result)
GPU_bool is_alias
Definition: SDL_gpu.h:421
DECLSPEC void SDLCALL GPU_Pixel(GPU_Target *target, float x, float y, SDL_Color color)
GPU_AttributeFormat format
Definition: SDL_gpu.h:574
DECLSPEC const char *SDLCALL GPU_GetMatrixString(float *A)
GPU_bool coordinate_mode
Definition: SDL_gpu.h:662
unsigned int size
Definition: SDL_gpu.h:338
GPU_MatrixStack projection_matrix
Definition: SDL_gpu.h:381
DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features)
Definition: SDL_gpu.c:230
int stored_window_h
Definition: SDL_gpu.h:364
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)
Definition: SDL_gpu.c:983
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 Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char *filename)
Definition: SDL_gpu.c:2062
DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image *image, GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1828
GPU_BlendFuncEnum
Definition: SDL_gpu.h:133
DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float *values)
Definition: SDL_gpu.c:2337
GPU_bool use_blending
Definition: SDL_gpu.h:281
DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target *target)
Definition: SDL_gpu.c:565
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
GPU_bool is_alias
Definition: SDL_gpu.h:290
GPU_BlendPresetEnum
Definition: SDL_gpu.h:175
DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int *values)
Definition: SDL_gpu.c:2287
char * details
Definition: SDL_gpu.h:612
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
Uint16 w
Definition: SDL_gpu.h:268
int matrix_mode
Definition: SDL_gpu.h:380
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)
int texcoord_loc
Definition: SDL_gpu.h:317
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)
Definition: SDL_gpu.c:963
DECLSPEC void SDLCALL GPU_Quit(void)
Definition: SDL_gpu.c:642
Uint32 GPU_WindowFlagEnum
Definition: SDL_gpu.h:452
DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image *image, float *anchor_x, float *anchor_y)
Definition: SDL_gpu.c:1917
GPU_ShaderBlock current_shader_block
Definition: SDL_gpu.h:371
GPU_BlendMode blend_mode
Definition: SDL_gpu.h:282
DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image *image, float anchor_x, float anchor_y)
Definition: SDL_gpu.c:1908
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)
int major_version
Definition: SDL_gpu.h:123
DECLSPEC void SDLCALL GPU_LogError(const char *format,...)
Definition: SDL_gpu.c:175
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)
Definition: SDL_gpu.c:1973
float anchor_y
Definition: SDL_gpu.h:278
GPU_Target Uint32 windowID
GPU_FilterEnum filter_mode
Definition: SDL_gpu.h:283
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)
Definition: SDL_gpu.c:2224
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)
Definition: SDL_gpu.c:873
DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target *target, GPU_Rect rect, SDL_Color color)
int num_layers
Definition: SDL_gpu.h:271
GPU_Image GPU_Rect GPU_Target float float float float scaleY
GPU_ErrorEnum error
Definition: SDL_gpu.h:611
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)
GPU_ShaderLanguageEnum
Definition: SDL_gpu.h:549
GPU_FormatEnum format
Definition: SDL_gpu.h:270
DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID *renderers_array)
void * per_vertex_storage
Definition: SDL_gpu.h:587
DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz)
GPU_Target float float float radius
int window_h
Definition: SDL_gpu.h:356
DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target *target, float x, float y, float rx, float ry, float degrees, SDL_Color color)
GPU_bool is_per_sprite
Definition: SDL_gpu.h:561
DECLSPEC GPU_bool SDLCALL GPU_GetCoordinateMode(void)
Definition: SDL_gpu.c:105
GPU_InitFlagEnum GPU_init_flags
Definition: SDL_gpu.h:651
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_UpdateImageBytes(GPU_Image *image, const GPU_Rect *image_rect, const unsigned char *bytes, int bytes_per_row)
Definition: SDL_gpu.c:991
Uint32 default_untextured_shader_program
Definition: SDL_gpu.h:369
Uint32 GPU_TypeEnum
Definition: SDL_gpu.h:515
GPU_Target float float float float start_angle
GPU_Target Uint8 Uint8 g
DECLSPEC GPU_Target *SDLCALL GPU_LoadTarget(GPU_Image *image)
Definition: SDL_gpu.c:1302
DECLSPEC void SDLCALL GPU_Line(GPU_Target *target, float x1, float y1, float x2, float y2, SDL_Color color)
GPU_Target float x1
GPU_bool failed
Definition: SDL_gpu.h:349
GPU_Target float float float float ry
GPU_WrapEnum wrap_mode_y
Definition: SDL_gpu.h:286
float default_image_anchor_y
Definition: SDL_gpu.h:666
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)
Definition: SDL_gpu.c:1403
DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2145
DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target *target, GPU_Rect rect)
Definition: SDL_gpu.c:1509
DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1612
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
void * data
Definition: SDL_gpu.h:403
DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object)
Definition: SDL_gpu.c:2137
int per_vertex_storage_stride_bytes
Definition: SDL_gpu.h:584
SDL_Color color
Definition: SDL_gpu.h:410
GPU_bool using_virtual_resolution
Definition: SDL_gpu.h:405
GPU_Target float float y1
DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image *image)
Definition: SDL_gpu.c:1640
DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target *target, float *x, float *y, float displayX, float displayY)
Definition: SDL_gpu.c:788
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)
Definition: SDL_gpu.c:844
GPU_Target float float float inner_radius
GPU_Target * context_target
Definition: SDL_gpu.h:401
DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value)
Definition: SDL_gpu.c:2320
Uint32 GPU_RendererEnum
Definition: SDL_gpu.h:97
DECLSPEC void SDLCALL GPU_GetVirtualResolution(GPU_Target *target, Uint16 *w, Uint16 *h)
Definition: SDL_gpu.c:538
DECLSPEC void SDLCALL GPU_ActivateShaderProgram(Uint32 program_object, GPU_ShaderBlock *block)
Definition: SDL_gpu.c:2180
DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1673
DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void)
Definition: SDL_gpu.c:2188
int int int int GPU_bool transpose
GPU_ErrorEnum
Definition: SDL_gpu.h:597
GPU_BlendEqEnum alpha_equation
Definition: SDL_gpu.h:167
DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id)
Definition: SDL_gpu.c:81
DECLSPEC GPU_Image *SDLCALL GPU_LoadImage_RW(SDL_RWops *rwops, GPU_bool free_rwops)
Definition: SDL_gpu.c:927
Uint32 GPU_ShaderBlock * block
GPU_LogLevelEnum
Definition: SDL_gpu.h:634
DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int *values)
Definition: SDL_gpu.c:2328
DECLSPEC float SDLCALL GPU_VectorLength(float *vec3)
GPU_bool has_mipmaps
Definition: SDL_gpu.h:275
DECLSPEC void SDLCALL GPU_MatrixCopy(float *result, const float *A)
DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target *target, SDL_Color color)
Definition: SDL_gpu.c:1984
DECLSPEC SDL_Surface *SDLCALL GPU_LoadSurface_RW(SDL_RWops *rwops, GPU_bool free_rwops)
Definition: SDL_gpu.c:1089
DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target *target)
Definition: SDL_gpu.c:1312
int min_shader_version
Definition: SDL_gpu.h:654
GPU_Image * image
Definition: SDL_gpu.h:402
DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1626
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)
Definition: SDL_gpu.c:2106
DECLSPEC void SDLCALL GPU_LogInfo(const char *format,...)
Definition: SDL_gpu.c:159
DECLSPEC void SDLCALL GPU_Blit(GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y)
Definition: SDL_gpu.c:1322
Uint32 GPU_FlipEnum
Definition: SDL_gpu.h:506
DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image *image)
Definition: SDL_gpu.c:1698
GPU_bool use_texturing
Definition: SDL_gpu.h:378
DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value)
Definition: SDL_gpu.c:2379
DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target *target, GPU_Camera *cam)
Definition: SDL_gpu.c:880
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
Definition: SDL_gpu.h:668
DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1865
DECLSPEC void SDLCALL GPU_MultMatrix(float *matrix4x4)
float anchor_x
Definition: SDL_gpu.h:277
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromImage(GPU_Image *image)
Definition: SDL_gpu.c:1276
DECLSPEC void SDLCALL GPU_PopMatrix(void)
DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target *target)
Definition: SDL_gpu.c:1688
void * data
Definition: SDL_gpu.h:288
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
Definition: SDL_gpu.h:163
DECLSPEC void SDLCALL GPU_MatrixIdentity(float *result)
DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void)
Definition: SDL_gpu.c:118
GPU_Target GPU_Camera * cam
Uint16 texture_w
Definition: SDL_gpu.h:274
DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID)
Definition: SDL_gpu.c:210
GPU_Image GPU_Target unsigned short void unsigned int unsigned short GPU_BatchFlagEnum flags
GPU_bool use_color
Definition: SDL_gpu.h:409
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromTarget(GPU_Target *target)
Definition: SDL_gpu.c:1265
float z
Definition: SDL_gpu.h:302
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)
Definition: SDL_gpu.c:736
int drawable_w
Definition: SDL_gpu.h:359
DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void)
GPU_Target Uint8 r
DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image *image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
Definition: SDL_gpu.c:1819
DECLSPEC void SDLCALL GPU_LoadIdentity(void)
DECLSPEC Uint32 SDLCALL GPU_CompileShader_RW(GPU_ShaderEnum shader_type, SDL_RWops *shader_source, GPU_bool free_rwops)
Definition: SDL_gpu.c:2050
GPU_Image const GPU_Rect * image_rect
GPU_BlendFuncEnum dest_color
Definition: SDL_gpu.h:162
DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value)
Definition: SDL_gpu.c:2295
DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target *target, GPU_Rect B, GPU_Rect *result)
Definition: SDL_gpu.c:1589
DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int *value)
Definition: SDL_gpu.c:2411
DECLSPEC void SDLCALL GPU_ResetRendererState(void)
Definition: SDL_gpu.c:89
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)
Definition: SDL_gpu.c:822
GPU_Image GPU_Target unsigned short void unsigned int num_indices
float default_image_anchor_x
Definition: SDL_gpu.h:665
GPU_Image GPU_Rect GPU_Target float float float degrees
GPU_RendererEnum renderer
Definition: SDL_gpu.h:122
DECLSPEC void SDLCALL GPU_UnsetViewport(GPU_Target *target)
Definition: SDL_gpu.c:861
DECLSPEC GPU_BlendMode SDLCALL GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum preset)
Definition: SDL_gpu.c:1724
DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image *image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y)
Definition: SDL_gpu.c:1945
DECLSPEC GPU_Image *SDLCALL GPU_CreateAliasImage(GPU_Image *image)
Definition: SDL_gpu.c:947
GPU_Image const char * filename
DECLSPEC void SDLCALL GPU_PushErrorCode(const char *function, GPU_ErrorEnum error, const char *details,...)
Definition: SDL_gpu.c:692
DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value)
Definition: SDL_gpu.c:2395
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)
Definition: SDL_gpu.c:1937
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)
Definition: SDL_gpu.c:1887
DECLSPEC void SDLCALL GPU_GetRendererOrder(int *order_size, GPU_RendererID *order)
DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target *target, GPU_Rect viewport)
Definition: SDL_gpu.c:855
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)
Definition: SDL_gpu.c:687
DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void)
Definition: SDL_gpu.c:867
DECLSPEC float SDLCALL GPU_VectorDot(float *A, float *B)
GPU_FeatureEnum enabled_features
Definition: SDL_gpu.h:656
float h
Definition: SDL_gpu.h:92
DECLSPEC GPU_Image *SDLCALL GPU_CopyImageFromSurface(SDL_Surface *surface)
Definition: SDL_gpu.c:1246
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:1472
DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int *values)
Definition: SDL_gpu.c:2303
Uint32 GPU_FeatureEnum
Definition: SDL_gpu.h:429
GPU_Context * context
Definition: SDL_gpu.h:419
DECLSPEC const char *SDLCALL GPU_GetErrorString(GPU_ErrorEnum error)
Definition: SDL_gpu.c:765
float angle
Definition: SDL_gpu.h:303
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:1839
GPU_ShaderEnum
Definition: SDL_gpu.h:537
GPU_Rect clip_rect
Definition: SDL_gpu.h:408
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)
Definition: SDL_gpu.c:405
DECLSPEC void SDLCALL GPU_PushMatrix(void)
GPU_WrapEnum wrap_mode_x
Definition: SDL_gpu.h:285
GPU_Target Uint8 Uint8 Uint8 Uint8 a
DECLSPEC GPU_bool SDLCALL GPU_SaveImage(GPU_Image *image, const char *filename, GPU_FileFormatEnum format)
Definition: SDL_gpu.c:955
GPU_ShaderBlock default_textured_shader_block
Definition: SDL_gpu.h:372
DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer)
GPU_Target * target
Definition: SDL_gpu.h:267
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)
Definition: SDL_gpu.c:2006
DECLSPEC void SDLCALL GPU_VectorCopy(float *result, float *A)
DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int *values)
Definition: SDL_gpu.c:2312
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:2241
DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level)
Definition: SDL_gpu.c:680
DECLSPEC GPU_Renderer *SDLCALL GPU_GetCurrentRenderer(void)
Definition: SDL_gpu.c:113
DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char *attrib_name)
Definition: SDL_gpu.c:2204
Uint32 default_textured_shader_program
Definition: SDL_gpu.h:368
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
GPU_Camera camera
Definition: SDL_gpu.h:415
int refcount
Definition: SDL_gpu.h:420
DECLSPEC void SDLCALL GPU_SetImageVirtualResolution(GPU_Image *image, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:576
#define GPU_bool
Definition: SDL_gpu.h:59
DECLSPEC GPU_bool SDLCALL GPU_IsDefaultShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2169
Uint32 const char * uniform_name
DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count)
Definition: SDL_gpu.c:2114
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
Definition: SDL_gpu.h:585
DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:1520