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 {
239 
247 typedef enum {
253 
254 
255 
266 typedef struct GPU_Image
267 {
271  Uint16 w, h;
276  Uint16 base_w, base_h; // Original image dimensions
277  Uint16 texture_w, texture_h; // Underlying texture dimensions
279 
280  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.
281  float anchor_y; // These are interpreted according to GPU_SetCoordinateMode() and range from (0.0 - 1.0) normally.
282 
283  SDL_Color color;
290 
291  void* data;
292  int refcount;
294 } GPU_Image;
295 
296 
303 typedef struct GPU_Camera
304 {
305  float x, y, z;
306  float angle;
307  float zoom;
308 } GPU_Camera;
309 
310 
316 typedef struct GPU_ShaderBlock
317 {
318  // Attributes
322  // Uniforms
325 
326 
327 
328 
329 
330 #define GPU_MODELVIEW 0
331 #define GPU_PROJECTION 1
332 
333 #ifndef GPU_MATRIX_STACK_MAX
334 #define GPU_MATRIX_STACK_MAX 5
335 #endif
336 
339 typedef struct GPU_MatrixStack
340 {
341  unsigned int size;
342  float matrix[GPU_MATRIX_STACK_MAX][16];
344 
345 
348 typedef struct GPU_Context
349 {
351  void* context;
353 
355  Uint32 windowID;
356 
358  int window_w;
359  int window_h;
360 
364 
368 
373 
377 
382 
386 
387  int refcount;
388 
389  void* data;
390 } GPU_Context;
391 
392 
404 {
408  void* data;
409  Uint16 w, h;
411  Uint16 base_w, base_h; // The true dimensions of the underlying image or window
415  SDL_Color color;
416 
418 
422 
425  int refcount;
427 };
428 
434 typedef Uint32 GPU_FeatureEnum;
435 static const GPU_FeatureEnum GPU_FEATURE_NON_POWER_OF_TWO = 0x1;
436 static const GPU_FeatureEnum GPU_FEATURE_RENDER_TARGETS = 0x2;
437 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS = 0x4;
438 static const GPU_FeatureEnum GPU_FEATURE_BLEND_FUNC_SEPARATE = 0x8;
439 static const GPU_FeatureEnum GPU_FEATURE_BLEND_EQUATIONS_SEPARATE = 0x10;
440 static const GPU_FeatureEnum GPU_FEATURE_GL_BGR = 0x20;
441 static const GPU_FeatureEnum GPU_FEATURE_GL_BGRA = 0x40;
442 static const GPU_FeatureEnum GPU_FEATURE_GL_ABGR = 0x80;
443 static const GPU_FeatureEnum GPU_FEATURE_VERTEX_SHADER = 0x100;
444 static const GPU_FeatureEnum GPU_FEATURE_FRAGMENT_SHADER = 0x200;
445 static const GPU_FeatureEnum GPU_FEATURE_PIXEL_SHADER = 0x200;
446 static const GPU_FeatureEnum GPU_FEATURE_GEOMETRY_SHADER = 0x400;
447 static const GPU_FeatureEnum GPU_FEATURE_WRAP_REPEAT_MIRRORED = 0x800;
448 static const GPU_FeatureEnum GPU_FEATURE_CORE_FRAMEBUFFER_OBJECTS = 0x1000;
449 
451 #define GPU_FEATURE_ALL_BASE GPU_FEATURE_RENDER_TARGETS
452 #define GPU_FEATURE_ALL_BLEND_PRESETS (GPU_FEATURE_BLEND_EQUATIONS | GPU_FEATURE_BLEND_FUNC_SEPARATE)
453 #define GPU_FEATURE_ALL_GL_FORMATS (GPU_FEATURE_GL_BGR | GPU_FEATURE_GL_BGRA | GPU_FEATURE_GL_ABGR)
454 #define GPU_FEATURE_BASIC_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER)
455 #define GPU_FEATURE_ALL_SHADERS (GPU_FEATURE_FRAGMENT_SHADER | GPU_FEATURE_VERTEX_SHADER | GPU_FEATURE_GEOMETRY_SHADER)
456 
457 
458 typedef Uint32 GPU_WindowFlagEnum;
459 
466 typedef Uint32 GPU_InitFlagEnum;
467 static const GPU_InitFlagEnum GPU_INIT_ENABLE_VSYNC = 0x1;
468 static const GPU_InitFlagEnum GPU_INIT_DISABLE_VSYNC = 0x2;
469 static const GPU_InitFlagEnum GPU_INIT_DISABLE_DOUBLE_BUFFER = 0x4;
470 static const GPU_InitFlagEnum GPU_INIT_DISABLE_AUTO_VIRTUAL_RESOLUTION = 0x8;
471 static const GPU_InitFlagEnum GPU_INIT_REQUEST_COMPATIBILITY_PROFILE = 0x10;
472 static const GPU_InitFlagEnum GPU_INIT_USE_ROW_BY_ROW_TEXTURE_UPLOAD_FALLBACK = 0x20;
473 static const GPU_InitFlagEnum GPU_INIT_USE_COPY_TEXTURE_UPLOAD_FALLBACK = 0x40;
474 
475 #define GPU_DEFAULT_INIT_FLAGS 0
476 
477 
478 static const Uint32 GPU_NONE = 0x0;
479 
485 typedef Uint32 GPU_BatchFlagEnum;
486 static const GPU_BatchFlagEnum GPU_BATCH_XY = 0x1;
487 static const GPU_BatchFlagEnum GPU_BATCH_XYZ = 0x2;
488 static const GPU_BatchFlagEnum GPU_BATCH_ST = 0x4;
489 static const GPU_BatchFlagEnum GPU_BATCH_RGB = 0x8;
490 static const GPU_BatchFlagEnum GPU_BATCH_RGBA = 0x10;
491 static const GPU_BatchFlagEnum GPU_BATCH_RGB8 = 0x20;
492 static const GPU_BatchFlagEnum GPU_BATCH_RGBA8 = 0x40;
493 
494 #define GPU_BATCH_XY_ST (GPU_BATCH_XY | GPU_BATCH_ST)
495 #define GPU_BATCH_XYZ_ST (GPU_BATCH_XYZ | GPU_BATCH_ST)
496 #define GPU_BATCH_XY_RGB (GPU_BATCH_XY | GPU_BATCH_RGB)
497 #define GPU_BATCH_XYZ_RGB (GPU_BATCH_XYZ | GPU_BATCH_RGB)
498 #define GPU_BATCH_XY_RGBA (GPU_BATCH_XY | GPU_BATCH_RGBA)
499 #define GPU_BATCH_XYZ_RGBA (GPU_BATCH_XYZ | GPU_BATCH_RGBA)
500 #define GPU_BATCH_XY_ST_RGBA (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA)
501 #define GPU_BATCH_XYZ_ST_RGBA (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA)
502 #define GPU_BATCH_XY_RGB8 (GPU_BATCH_XY | GPU_BATCH_RGB8)
503 #define GPU_BATCH_XYZ_RGB8 (GPU_BATCH_XYZ | GPU_BATCH_RGB8)
504 #define GPU_BATCH_XY_RGBA8 (GPU_BATCH_XY | GPU_BATCH_RGBA8)
505 #define GPU_BATCH_XYZ_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_RGBA8)
506 #define GPU_BATCH_XY_ST_RGBA8 (GPU_BATCH_XY | GPU_BATCH_ST | GPU_BATCH_RGBA8)
507 #define GPU_BATCH_XYZ_ST_RGBA8 (GPU_BATCH_XYZ | GPU_BATCH_ST | GPU_BATCH_RGBA8)
508 
509 
514 typedef Uint32 GPU_FlipEnum;
515 static const GPU_FlipEnum GPU_FLIP_NONE = 0x0;
516 static const GPU_FlipEnum GPU_FLIP_HORIZONTAL = 0x1;
517 static const GPU_FlipEnum GPU_FLIP_VERTICAL = 0x2;
518 
519 
523 typedef Uint32 GPU_TypeEnum;
524 // Use OpenGL's values for simpler translation
525 static const GPU_TypeEnum GPU_TYPE_BYTE = 0x1400;
526 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_BYTE = 0x1401;
527 static const GPU_TypeEnum GPU_TYPE_SHORT = 0x1402;
528 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_SHORT = 0x1403;
529 static const GPU_TypeEnum GPU_TYPE_INT = 0x1404;
530 static const GPU_TypeEnum GPU_TYPE_UNSIGNED_INT = 0x1405;
531 static const GPU_TypeEnum GPU_TYPE_FLOAT = 0x1406;
532 static const GPU_TypeEnum GPU_TYPE_DOUBLE = 0x140A;
533 
534 
535 
536 
537 
538 
545 typedef enum {
551 
552 
553 
557 typedef enum {
565 
567 typedef struct GPU_AttributeFormat
568 {
569  GPU_bool is_per_sprite; // Per-sprite values are expanded to 4 vertices
571  GPU_TypeEnum type; // GPU_TYPE_FLOAT, GPU_TYPE_INT, GPU_TYPE_UNSIGNED_INT, etc.
573  int stride_bytes; // Number of bytes between two vertex specifications
574  int offset_bytes; // Number of bytes to skip at the beginning of 'values'
576 
578 typedef struct GPU_Attribute
579 {
580  int location;
581  void* values; // Expect 4 values for each sprite
583 } GPU_Attribute;
584 
586 typedef struct GPU_AttributeSource
587 {
590  void* next_value;
591  // Automatic storage format
594  int per_vertex_storage_size; // Over 0 means that the per-vertex storage has been automatically allocated
595  void* per_vertex_storage; // Could point to the attribute's values or to allocated storage
598 
599 
605 typedef enum {
613 } GPU_ErrorEnum;
614 
616 typedef struct GPU_ErrorObject
617 {
618  char* function;
620  char* details;
622 
623 
629 typedef enum {
636 
637 
642 typedef enum {
647 
648 
649 /* Private implementation of renderer members */
650 struct GPU_RendererImpl;
651 
654 {
658  GPU_WindowFlagEnum SDL_init_flags;
659  GPU_InitFlagEnum GPU_init_flags;
660 
664  GPU_FeatureEnum enabled_features;
665 
668 
671 
675 
677 };
678 
679 
680 
681 
682 
683 
687 // Visual C does not support static inline
688 #ifdef _MSC_VER
689 static SDL_version SDLCALL GPU_GetCompiledVersion(void)
690 #else
691 static inline SDL_version SDLCALL GPU_GetCompiledVersion(void)
692 #endif
693 {
695  return v;
696 }
697 
698 DECLSPEC SDL_version SDLCALL GPU_GetLinkedVersion(void);
699 
701 DECLSPEC void SDLCALL GPU_SetInitWindow(Uint32 windowID);
702 
704 DECLSPEC Uint32 SDLCALL GPU_GetInitWindow(void);
705 
708 DECLSPEC void SDLCALL GPU_SetPreInitFlags(GPU_InitFlagEnum GPU_flags);
709 
711 DECLSPEC GPU_InitFlagEnum SDLCALL GPU_GetPreInitFlags(void);
712 
715 DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features);
716 
718 DECLSPEC GPU_FeatureEnum SDLCALL GPU_GetRequiredFeatures(void);
719 
721 DECLSPEC void SDLCALL GPU_GetDefaultRendererOrder(int* order_size, GPU_RendererID* order);
722 
724 DECLSPEC void SDLCALL GPU_GetRendererOrder(int* order_size, GPU_RendererID* order);
725 
727 DECLSPEC void SDLCALL GPU_SetRendererOrder(int order_size, GPU_RendererID* order);
728 
752 DECLSPEC GPU_Target* SDLCALL GPU_Init(Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
753 
755 DECLSPEC GPU_Target* SDLCALL GPU_InitRenderer(GPU_RendererEnum renderer_enum, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
756 
761 DECLSPEC GPU_Target* SDLCALL GPU_InitRendererByID(GPU_RendererID renderer_request, Uint16 w, Uint16 h, GPU_WindowFlagEnum SDL_flags);
762 
767 DECLSPEC GPU_bool SDLCALL GPU_IsFeatureEnabled(GPU_FeatureEnum feature);
768 
770 DECLSPEC void SDLCALL GPU_CloseCurrentRenderer(void);
771 
773 DECLSPEC void SDLCALL GPU_Quit(void);
774 
775 // End of Initialization
780 // Debugging, logging, and error handling
781 
782 #define GPU_Log GPU_LogInfo
783 
792 DECLSPEC void SDLCALL GPU_SetDebugLevel(GPU_DebugLevelEnum level);
793 
795 DECLSPEC GPU_DebugLevelEnum SDLCALL GPU_GetDebugLevel(void);
796 
798 DECLSPEC void SDLCALL GPU_LogInfo(const char* format, ...);
799 
801 DECLSPEC void SDLCALL GPU_LogWarning(const char* format, ...);
802 
804 DECLSPEC void SDLCALL GPU_LogError(const char* format, ...);
805 
807 DECLSPEC void SDLCALL GPU_SetLogCallback(int (*callback)(GPU_LogLevelEnum log_level, const char* format, va_list args));
808 
814 DECLSPEC void SDLCALL GPU_PushErrorCode(const char* function, GPU_ErrorEnum error, const char* details, ...);
815 
817 DECLSPEC GPU_ErrorObject SDLCALL GPU_PopErrorCode(void);
818 
820 DECLSPEC const char* SDLCALL GPU_GetErrorString(GPU_ErrorEnum error);
821 
823 DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max);
824 
825 // End of Logging
838 DECLSPEC GPU_RendererID SDLCALL GPU_MakeRendererID(const char* name, GPU_RendererEnum renderer, int major_version, int minor_version);
839 
841 DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer);
842 
844 DECLSPEC int SDLCALL GPU_GetNumRegisteredRenderers(void);
845 
847 DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID* renderers_array);
848 
850 DECLSPEC void SDLCALL GPU_RegisterRenderer(GPU_RendererID id, GPU_Renderer* (SDLCALL *create_renderer)(GPU_RendererID request), void (SDLCALL *free_renderer)(GPU_Renderer* renderer));
851 
852 // End of RendererSetup
861 DECLSPEC GPU_RendererEnum SDLCALL GPU_ReserveNextRendererEnum(void);
862 
864 DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void);
865 
867 DECLSPEC void SDLCALL GPU_GetActiveRendererList(GPU_RendererID* renderers_array);
868 
870 DECLSPEC GPU_Renderer* SDLCALL GPU_GetCurrentRenderer(void);
871 
873 DECLSPEC void SDLCALL GPU_SetCurrentRenderer(GPU_RendererID id);
874 
876 DECLSPEC GPU_Renderer* SDLCALL GPU_GetRenderer(GPU_RendererID id);
877 
878 DECLSPEC void SDLCALL GPU_FreeRenderer(GPU_Renderer* renderer);
879 
881 DECLSPEC void SDLCALL GPU_ResetRendererState(void);
882 
886 DECLSPEC void SDLCALL GPU_SetCoordinateMode(GPU_bool use_math_coords);
887 
888 DECLSPEC GPU_bool SDLCALL GPU_GetCoordinateMode(void);
889 
893 DECLSPEC void SDLCALL GPU_SetDefaultAnchor(float anchor_x, float anchor_y);
894 
898 DECLSPEC void SDLCALL GPU_GetDefaultAnchor(float* anchor_x, float* anchor_y);
899 
900 // End of RendererControls
906 // Context / window controls
907 
912 DECLSPEC GPU_Target* SDLCALL GPU_GetContextTarget(void);
913 
915 DECLSPEC GPU_Target* SDLCALL GPU_GetWindowTarget(Uint32 windowID);
916 
918 DECLSPEC GPU_Target* SDLCALL GPU_CreateTargetFromWindow(Uint32 windowID);
919 
924 DECLSPEC void SDLCALL GPU_MakeCurrent(GPU_Target* target, Uint32 windowID);
925 
928 DECLSPEC GPU_bool SDLCALL GPU_SetWindowResolution(Uint16 w, Uint16 h);
929 
936 
938 DECLSPEC GPU_bool SDLCALL GPU_GetFullscreen(void);
939 
941 DECLSPEC void SDLCALL GPU_SetShapeBlending(GPU_bool enable);
942 
945 
947 DECLSPEC void SDLCALL GPU_SetShapeBlendFunction(GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
948 
950 DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
951 
953 DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode);
954 
959 DECLSPEC float SDLCALL GPU_SetLineThickness(float thickness);
960 
962 DECLSPEC float SDLCALL GPU_GetLineThickness(void);
963 
964 // End of ContextControls
976 
978 DECLSPEC GPU_Target* SDLCALL GPU_LoadTarget(GPU_Image* image);
979 
981 DECLSPEC GPU_Target* SDLCALL GPU_GetTarget(GPU_Image* image);
982 
984 DECLSPEC void SDLCALL GPU_FreeTarget(GPU_Target* target);
985 
987 DECLSPEC void SDLCALL GPU_SetVirtualResolution(GPU_Target* target, Uint16 w, Uint16 h);
988 
990 DECLSPEC void SDLCALL GPU_GetVirtualResolution(GPU_Target* target, Uint16* w, Uint16* h);
991 
993 DECLSPEC void SDLCALL GPU_GetVirtualCoords(GPU_Target* target, float* x, float* y, float displayX, float displayY);
994 
996 DECLSPEC void SDLCALL GPU_UnsetVirtualResolution(GPU_Target* target);
997 
999 DECLSPEC GPU_Rect SDLCALL GPU_MakeRect(float x, float y, float w, float h);
1000 
1002 DECLSPEC SDL_Color SDLCALL GPU_MakeColor(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1003 
1005 DECLSPEC void SDLCALL GPU_SetViewport(GPU_Target* target, GPU_Rect viewport);
1006 
1008 DECLSPEC void SDLCALL GPU_UnsetViewport(GPU_Target* target);
1009 
1011 DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera(void);
1012 
1014 DECLSPEC GPU_Camera SDLCALL GPU_GetCamera(GPU_Target* target);
1015 
1021 
1023 DECLSPEC void SDLCALL GPU_EnableCamera(GPU_Target* target, GPU_bool use_camera);
1024 
1026 DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled(GPU_Target* target);
1027 
1029 DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target* target, Sint16 x, Sint16 y);
1030 
1032 DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target* target, GPU_Rect rect);
1033 
1035 DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target* target, Sint16 x, Sint16 y, Uint16 w, Uint16 h);
1036 
1038 DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target* target);
1039 
1041 DECLSPEC GPU_bool SDLCALL GPU_IntersectRect(GPU_Rect A, GPU_Rect B, GPU_Rect* result);
1042 
1046 DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target* target, GPU_Rect B, GPU_Rect* result);
1047 
1053 DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target* target, SDL_Color color);
1054 
1060 DECLSPEC void SDLCALL GPU_SetTargetRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
1061 
1067 DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1068 
1072 DECLSPEC void SDLCALL GPU_UnsetTargetColor(GPU_Target* target);
1073 
1074 // End of TargetControls
1083 DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface(const char* filename);
1084 
1086 DECLSPEC SDL_Surface* SDLCALL GPU_LoadSurface_RW(SDL_RWops* rwops, GPU_bool free_rwops);
1087 
1091 DECLSPEC GPU_bool SDLCALL GPU_SaveSurface(SDL_Surface* surface, const char* filename, GPU_FileFormatEnum format);
1092 
1096 DECLSPEC GPU_bool SDLCALL GPU_SaveSurface_RW(SDL_Surface* surface, SDL_RWops* rwops, GPU_bool free_rwops, GPU_FileFormatEnum format);
1097 
1098 // End of SurfaceControls
1112 DECLSPEC GPU_Image* SDLCALL GPU_CreateImage(Uint16 w, Uint16 h, GPU_FormatEnum format);
1113 
1115 DECLSPEC GPU_Image* SDLCALL GPU_CreateImageUsingTexture(Uint32 handle, GPU_bool take_ownership);
1116 
1118 DECLSPEC GPU_Image* SDLCALL GPU_LoadImage(const char* filename);
1119 
1121 DECLSPEC GPU_Image* SDLCALL GPU_LoadImage_RW(SDL_RWops* rwops, GPU_bool free_rwops);
1122 
1125 DECLSPEC GPU_Image* SDLCALL GPU_CreateAliasImage(GPU_Image* image);
1126 
1128 DECLSPEC GPU_Image* SDLCALL GPU_CopyImage(GPU_Image* image);
1129 
1131 DECLSPEC void SDLCALL GPU_FreeImage(GPU_Image* image);
1132 
1134 DECLSPEC void SDLCALL GPU_SetImageVirtualResolution(GPU_Image* image, Uint16 w, Uint16 h);
1135 
1137 DECLSPEC void SDLCALL GPU_UnsetImageVirtualResolution(GPU_Image* image);
1138 
1140 DECLSPEC void SDLCALL GPU_UpdateImage(GPU_Image* image, const GPU_Rect* image_rect, SDL_Surface* surface, const GPU_Rect* surface_rect);
1141 
1143 DECLSPEC void SDLCALL GPU_UpdateImageBytes(GPU_Image* image, const GPU_Rect* image_rect, const unsigned char* bytes, int bytes_per_row);
1144 
1146 DECLSPEC GPU_bool SDLCALL GPU_ReplaceImage(GPU_Image* image, SDL_Surface* surface, const GPU_Rect* surface_rect);
1147 
1151 DECLSPEC GPU_bool SDLCALL GPU_SaveImage(GPU_Image* image, const char* filename, GPU_FileFormatEnum format);
1152 
1156 DECLSPEC GPU_bool SDLCALL GPU_SaveImage_RW(GPU_Image* image, SDL_RWops* rwops, GPU_bool free_rwops, GPU_FileFormatEnum format);
1157 
1159 DECLSPEC void SDLCALL GPU_GenerateMipmaps(GPU_Image* image);
1160 
1162 DECLSPEC void SDLCALL GPU_SetColor(GPU_Image* image, SDL_Color color);
1163 
1165 DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b);
1166 
1168 DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image* image, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1169 
1172 DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image* image);
1173 
1175 DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image* image);
1176 
1178 DECLSPEC void SDLCALL GPU_SetBlending(GPU_Image* image, GPU_bool enable);
1179 
1181 DECLSPEC void SDLCALL GPU_SetBlendFunction(GPU_Image* image, GPU_BlendFuncEnum source_color, GPU_BlendFuncEnum dest_color, GPU_BlendFuncEnum source_alpha, GPU_BlendFuncEnum dest_alpha);
1182 
1184 DECLSPEC void SDLCALL GPU_SetBlendEquation(GPU_Image* image, GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation);
1185 
1187 DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image* image, GPU_BlendPresetEnum mode);
1188 
1190 DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image* image, GPU_FilterEnum filter);
1191 
1193 DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image* image, float anchor_x, float anchor_y);
1194 
1196 DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image* image, float* anchor_x, float* anchor_y);
1197 
1199 DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image* image);
1200 
1202 DECLSPEC void SDLCALL GPU_SetSnapMode(GPU_Image* image, GPU_SnapEnum mode);
1203 
1206 
1207 // End of ImageControls
1211 // Surface / Image / Target conversions
1216 DECLSPEC GPU_Image* SDLCALL GPU_CopyImageFromSurface(SDL_Surface* surface);
1217 
1220 
1222 DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromTarget(GPU_Target* target);
1223 
1225 DECLSPEC SDL_Surface* SDLCALL GPU_CopySurfaceFromImage(GPU_Image* image);
1226 
1227 // End of Conversions
1237 // Basic vector operations (3D)
1238 
1240 DECLSPEC float SDLCALL GPU_VectorLength(float* vec3);
1241 
1243 DECLSPEC void SDLCALL GPU_VectorNormalize(float* vec3);
1244 
1246 DECLSPEC float SDLCALL GPU_VectorDot(float* A, float* B);
1247 
1249 DECLSPEC void SDLCALL GPU_VectorCross(float* result, float* A, float* B);
1250 
1252 DECLSPEC void SDLCALL GPU_VectorCopy(float* result, float* A);
1253 
1255 DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float* vec3, float* matrix_4x4);
1256 
1257 
1258 
1259 // Basic matrix operations (4x4)
1260 
1262 DECLSPEC void SDLCALL GPU_MatrixCopy(float* result, const float* A);
1263 
1265 DECLSPEC void SDLCALL GPU_MatrixIdentity(float* result);
1266 
1268 DECLSPEC void SDLCALL GPU_MatrixOrtho(float* result, float left, float right, float bottom, float top, float near, float far);
1269 
1271 DECLSPEC void SDLCALL GPU_MatrixFrustum(float* result, float left, float right, float bottom, float top, float near, float far);
1272 
1274 DECLSPEC void SDLCALL GPU_MatrixPerspective(float* result, float fovy, float aspect, float zNear, float zFar);
1275 
1277 DECLSPEC void SDLCALL GPU_MatrixLookAt(float* matrix, float eye_x, float eye_y, float eye_z, float target_x, float target_y, float target_z, float up_x, float up_y, float up_z);
1278 
1280 DECLSPEC void SDLCALL GPU_MatrixTranslate(float* result, float x, float y, float z);
1281 
1283 DECLSPEC void SDLCALL GPU_MatrixScale(float* result, float sx, float sy, float sz);
1284 
1286 DECLSPEC void SDLCALL GPU_MatrixRotate(float* result, float degrees, float x, float y, float z);
1287 
1291 DECLSPEC void SDLCALL GPU_Multiply4x4(float* result, float* A, float* B);
1292 
1294 DECLSPEC void SDLCALL GPU_MultiplyAndAssign(float* result, float* B);
1295 
1296 
1297 // Matrix stack accessors
1298 
1300 DECLSPEC const char* SDLCALL GPU_GetMatrixString(float* A);
1301 
1303 DECLSPEC float* SDLCALL GPU_GetCurrentMatrix(void);
1304 
1306 DECLSPEC float* SDLCALL GPU_GetModelView(void);
1307 
1309 DECLSPEC float* SDLCALL GPU_GetProjection(void);
1310 
1312 DECLSPEC void SDLCALL GPU_GetModelViewProjection(float* result);
1313 
1314 
1315 // Matrix stack manipulators
1316 
1318 DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode);
1319 
1321 DECLSPEC void SDLCALL GPU_PushMatrix(void);
1322 
1324 DECLSPEC void SDLCALL GPU_PopMatrix(void);
1325 
1327 DECLSPEC void SDLCALL GPU_LoadIdentity(void);
1328 
1330 DECLSPEC void SDLCALL GPU_Ortho(float left, float right, float bottom, float top, float near, float far);
1331 
1333 DECLSPEC void SDLCALL GPU_Frustum(float left, float right, float bottom, float top, float near, float far);
1334 
1336 DECLSPEC void SDLCALL GPU_Translate(float x, float y, float z);
1337 
1339 DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz);
1340 
1342 DECLSPEC void SDLCALL GPU_Rotate(float degrees, float x, float y, float z);
1343 
1345 DECLSPEC void SDLCALL GPU_MultMatrix(float* matrix4x4);
1346 
1347 // End of Matrix
1359 DECLSPEC void SDLCALL GPU_Clear(GPU_Target* target);
1360 
1362 DECLSPEC void SDLCALL GPU_ClearColor(GPU_Target* target, SDL_Color color);
1363 
1365 DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b);
1366 
1368 DECLSPEC void SDLCALL GPU_ClearRGBA(GPU_Target* target, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
1369 
1374 DECLSPEC void SDLCALL GPU_Blit(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y);
1375 
1381 DECLSPEC void SDLCALL GPU_BlitRotate(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float degrees);
1382 
1389 DECLSPEC void SDLCALL GPU_BlitScale(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, float x, float y, float scaleX, float scaleY);
1390 
1398 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);
1399 
1409 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);
1410 
1415 DECLSPEC void SDLCALL GPU_BlitRect(GPU_Image* image, GPU_Rect* src_rect, GPU_Target* target, GPU_Rect* dest_rect);
1416 
1425 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);
1426 
1427 
1433 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);
1434 
1440 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);
1441 
1443 DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void);
1444 
1446 DECLSPEC void SDLCALL GPU_Flip(GPU_Target* target);
1447 
1448 // End of Rendering
1464 DECLSPEC void SDLCALL GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color);
1465 
1474 DECLSPEC void SDLCALL GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1475 
1485 DECLSPEC void SDLCALL GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1486 
1496 DECLSPEC void SDLCALL GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color);
1497 
1505 DECLSPEC void SDLCALL GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1506 
1514 DECLSPEC void SDLCALL GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color);
1515 
1525 DECLSPEC void SDLCALL GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1526 
1536 DECLSPEC void SDLCALL GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color);
1537 
1548 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);
1549 
1560 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);
1561 
1572 DECLSPEC void SDLCALL GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1573 
1584 DECLSPEC void SDLCALL GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color);
1585 
1594 DECLSPEC void SDLCALL GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1595 
1601 DECLSPEC void SDLCALL GPU_Rectangle2(GPU_Target* target, GPU_Rect rect, SDL_Color color);
1602 
1611 DECLSPEC void SDLCALL GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color);
1612 
1618 DECLSPEC void SDLCALL GPU_RectangleFilled2(GPU_Target* target, GPU_Rect rect, SDL_Color color);
1619 
1629 DECLSPEC void SDLCALL GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1630 
1637 DECLSPEC void SDLCALL GPU_RectangleRound2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color);
1638 
1648 DECLSPEC void SDLCALL GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color);
1649 
1656 DECLSPEC void SDLCALL GPU_RectangleRoundFilled2(GPU_Target* target, GPU_Rect rect, float radius, SDL_Color color);
1657 
1664 DECLSPEC void SDLCALL GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1665 
1672 DECLSPEC void SDLCALL GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
1673 
1674 // End of Shapes
1688 DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void);
1689 
1691 DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object);
1692 
1695 
1697 DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char* shader_source);
1698 
1700 DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char* filename);
1701 
1703 DECLSPEC Uint32 SDLCALL GPU_LinkShaders(Uint32 shader_object1, Uint32 shader_object2);
1704 
1706 DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count);
1707 
1709 DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object);
1710 
1713 
1716 
1719 
1721 DECLSPEC Uint32 SDLCALL GPU_GetCurrentShaderProgram(void);
1722 
1725 
1728 
1730 DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void);
1731 
1733 DECLSPEC const char* SDLCALL GPU_GetShaderMessage(void);
1734 
1736 DECLSPEC int SDLCALL GPU_GetAttributeLocation(Uint32 program_object, const char* attrib_name);
1737 
1739 DECLSPEC GPU_AttributeFormat SDLCALL GPU_MakeAttributeFormat(int num_elems_per_vertex, GPU_TypeEnum type, GPU_bool normalize, int stride_bytes, int offset_bytes);
1740 
1743 
1745 DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char* uniform_name);
1746 
1748 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);
1749 
1751 DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block);
1752 
1754 DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void);
1755 
1760 DECLSPEC void SDLCALL GPU_SetShaderImage(GPU_Image* image, int location, int image_unit);
1761 
1763 DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int* values);
1764 
1767 DECLSPEC void SDLCALL GPU_SetUniformi(int location, int value);
1768 
1770 DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int* values);
1771 
1773 DECLSPEC void SDLCALL GPU_GetUniformuiv(Uint32 program_object, int location, unsigned int* values);
1774 
1777 DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value);
1778 
1780 DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int* values);
1781 
1783 DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float* values);
1784 
1787 DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value);
1788 
1790 DECLSPEC void SDLCALL GPU_SetUniformfv(int location, int num_elements_per_value, int num_values, float* values);
1791 
1793 DECLSPEC void SDLCALL GPU_GetUniformMatrixfv(Uint32 program_object, int location, float* values);
1794 
1796 DECLSPEC void SDLCALL GPU_SetUniformMatrixfv(int location, int num_matrices, int num_rows, int num_columns, GPU_bool transpose, float* values);
1797 
1799 DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value);
1800 
1802 DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value);
1803 
1805 DECLSPEC void SDLCALL GPU_SetAttributeui(int location, unsigned int value);
1806 
1808 DECLSPEC void SDLCALL GPU_SetAttributefv(int location, int num_elements, float* value);
1809 
1811 DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int* value);
1812 
1814 DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int* value);
1815 
1817 DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source);
1818 
1819 // End of ShaderInterface
1823 #ifdef __cplusplus
1824 }
1825 #endif
1826 
1827 #include "close_code.h"
1828 
1829 
1830 #endif
1831 
struct GPU_Renderer * renderer
Definition: SDL_gpu.h:405
int minor_version
Definition: SDL_gpu.h:124
Uint16 w
Definition: SDL_gpu.h:409
GPU_Target * context_target
Definition: SDL_gpu.h:269
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:2180
GPU_bool GPU_bool use_desktop_resolution
void * values
Definition: SDL_gpu.h:581
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:2422
DECLSPEC void SDLCALL GPU_SetAttributeSource(int num_values, GPU_Attribute source)
Definition: SDL_gpu.c:2446
GPU_FileFormatEnum
Definition: SDL_gpu.h:247
DECLSPEC GPU_ShaderBlock SDLCALL GPU_GetShaderBlock(void)
Definition: SDL_gpu.c:2283
DECLSPEC GPU_SnapEnum SDLCALL GPU_GetSnapMode(GPU_Image *image)
Definition: SDL_gpu.c:1948
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:580
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:629
DECLSPEC void SDLCALL GPU_SetErrorQueueMax(unsigned int max)
Definition: SDL_gpu.c:624
int position_loc
Definition: SDL_gpu.h:319
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:1915
Uint16 base_w
Definition: SDL_gpu.h:276
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:1436
GPU_bool use_clip_rect
Definition: SDL_gpu.h:412
DECLSPEC float *SDLCALL GPU_GetProjection(void)
GPU_RendererID requested_id
Definition: SDL_gpu.h:657
DECLSPEC const char *SDLCALL GPU_GetShaderMessage(void)
Definition: SDL_gpu.c:2215
DECLSPEC SDL_Color SDLCALL GPU_GetPixel(GPU_Target *target, Sint16 x, Sint16 y)
Definition: SDL_gpu.c:1975
DECLSPEC void SDLCALL GPU_Flip(GPU_Target *target)
Definition: SDL_gpu.c:2044
#define GPU_MATRIX_STACK_MAX
Definition: SDL_gpu.h:334
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:355
int drawable_h
Definition: SDL_gpu.h:363
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:287
DECLSPEC int SDLCALL GPU_GetNumActiveRenderers(void)
DECLSPEC void SDLCALL GPU_SetShapeBlendEquation(GPU_BlendEqEnum color_equation, GPU_BlendEqEnum alpha_equation)
Definition: SDL_gpu.c:1872
DECLSPEC void SDLCALL GPU_AttachShader(Uint32 program_object, Uint32 shader_object)
Definition: SDL_gpu.c:2172
DECLSPEC void SDLCALL GPU_SetColor(GPU_Image *image, SDL_Color color)
Definition: SDL_gpu.c:1623
#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:596
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:2298
GPU_bool enabled
Definition: SDL_gpu.h:588
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:370
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:1496
GPU_Target Uint8 Uint8 Uint8 b
DECLSPEC void SDLCALL GPU_SetImageFilter(GPU_Image *image, GPU_FilterEnum filter)
Definition: SDL_gpu.c:1895
GPU_Image GPU_WrapEnum wrap_mode_x
GPU_Rect viewport
Definition: SDL_gpu.h:417
int per_vertex_storage_size
Definition: SDL_gpu.h:594
DECLSPEC void SDLCALL GPU_FlushBlitBuffer(void)
Definition: SDL_gpu.c:2036
DECLSPEC void SDLCALL GPU_SetAttributei(int location, int value)
Definition: SDL_gpu.c:2406
GPU_TypeEnum type
Definition: SDL_gpu.h:571
GPU_ShaderBlock default_untextured_shader_block
Definition: SDL_gpu.h:376
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:2389
struct GPU_Renderer * renderer
Definition: SDL_gpu.h:268
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:307
GPU_RendererID id
Definition: SDL_gpu.h:656
int modelViewProjection_loc
Definition: SDL_gpu.h:323
float line_thickness
Definition: SDL_gpu.h:380
int window_w
Definition: SDL_gpu.h:358
DECLSPEC void SDLCALL GPU_MatrixMode(int matrix_mode)
DECLSPEC void SDLCALL GPU_SetTargetColor(GPU_Target *target, SDL_Color color)
Definition: SDL_gpu.c:1668
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:2381
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:2372
Uint32 GPU_InitFlagEnum
Definition: SDL_gpu.h:466
GPU_MatrixStack modelview_matrix
Definition: SDL_gpu.h:385
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:1827
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:283
DECLSPEC GPU_Target *SDLCALL GPU_CreateAliasTarget(GPU_Target *target)
Definition: SDL_gpu.c:486
GPU_BlendMode shapes_blend_mode
Definition: SDL_gpu.h:379
DECLSPEC void SDLCALL GPU_SetShaderBlock(GPU_ShaderBlock block)
Definition: SDL_gpu.c:2275
GPU_bool shapes_use_blending
Definition: SDL_gpu.h:378
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:1559
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:663
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:1726
GPU_WindowFlagEnum SDL_init_flags
Definition: SDL_gpu.h:658
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:275
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:1677
#define SDL_GPU_VERSION_MINOR
Definition: SDL_gpu.h:17
GPU_bool using_virtual_resolution
Definition: SDL_gpu.h:272
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:667
DECLSPEC int SDLCALL GPU_GetUniformLocation(Uint32 program_object, const char *uniform_name)
Definition: SDL_gpu.c:2252
GPU_ShaderLanguageEnum shader_language
Definition: SDL_gpu.h:661
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:2231
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:292
int GPU_Attribute source
GPU_bool normalize
Definition: SDL_gpu.h:572
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:485
DECLSPEC void SDLCALL GPU_ClearRGB(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:2014
DECLSPEC void SDLCALL GPU_VectorApplyMatrix(float *vec3, float *matrix_4x4)
DECLSPEC void SDLCALL GPU_SetUniformf(int location, float value)
Definition: SDL_gpu.c:2364
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:411
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:2109
GPU_Target float float float float y2
DECLSPEC Uint32 SDLCALL GPU_CompileShader(GPU_ShaderEnum shader_type, const char *shader_source)
Definition: SDL_gpu.c:2101
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:389
DECLSPEC void SDLCALL GPU_SetAttributeuiv(int location, int num_elements, unsigned int *value)
Definition: SDL_gpu.c:2438
GPU_Image GPU_Rect * src_rect
DECLSPEC void SDLCALL GPU_UnsetClip(GPU_Target *target)
Definition: SDL_gpu.c:1550
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:1350
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:1517
void * context
Definition: SDL_gpu.h:351
static GLenum GLenum GLuint GLint level
GPU_Target unsigned int float * vertices
DECLSPEC Uint32 SDLCALL GPU_CreateShaderProgram(void)
Definition: SDL_gpu.c:2117
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:1734
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:366
GPU_bool use_camera
Definition: SDL_gpu.h:421
DECLSPEC void SDLCALL GPU_GetModelViewProjection(float *result)
GPU_bool is_alias
Definition: SDL_gpu.h:426
DECLSPEC void SDLCALL GPU_Pixel(GPU_Target *target, float x, float y, SDL_Color color)
GPU_AttributeFormat format
Definition: SDL_gpu.h:582
DECLSPEC const char *SDLCALL GPU_GetMatrixString(float *A)
GPU_bool coordinate_mode
Definition: SDL_gpu.h:670
unsigned int size
Definition: SDL_gpu.h:341
GPU_MatrixStack projection_matrix
Definition: SDL_gpu.h:384
DECLSPEC void SDLCALL GPU_SetRequiredFeatures(GPU_FeatureEnum features)
Definition: SDL_gpu.c:230
int stored_window_h
Definition: SDL_gpu.h:367
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:1366
DECLSPEC Uint32 SDLCALL GPU_LoadShader(GPU_ShaderEnum shader_type, const char *filename)
Definition: SDL_gpu.c:2081
DECLSPEC void SDLCALL GPU_SetBlendMode(GPU_Image *image, GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1847
GPU_BlendFuncEnum
Definition: SDL_gpu.h:133
DECLSPEC void SDLCALL GPU_GetUniformfv(Uint32 program_object, int location, float *values)
Definition: SDL_gpu.c:2356
GPU_bool use_blending
Definition: SDL_gpu.h:284
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:293
GPU_BlendPresetEnum
Definition: SDL_gpu.h:175
DECLSPEC void SDLCALL GPU_GetUniformiv(Uint32 program_object, int location, int *values)
Definition: SDL_gpu.c:2306
char * details
Definition: SDL_gpu.h:620
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:271
int matrix_mode
Definition: SDL_gpu.h:383
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:320
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:458
DECLSPEC void SDLCALL GPU_GetAnchor(GPU_Image *image, float *anchor_x, float *anchor_y)
Definition: SDL_gpu.c:1936
GPU_ShaderBlock current_shader_block
Definition: SDL_gpu.h:374
GPU_BlendMode blend_mode
Definition: SDL_gpu.h:285
DECLSPEC void SDLCALL GPU_SetAnchor(GPU_Image *image, float anchor_x, float anchor_y)
Definition: SDL_gpu.c:1927
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:1992
float anchor_y
Definition: SDL_gpu.h:281
GPU_Target Uint32 windowID
GPU_FilterEnum filter_mode
Definition: SDL_gpu.h:286
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:2243
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:274
GPU_Image GPU_Rect GPU_Target float float float float scaleY
GPU_ErrorEnum error
Definition: SDL_gpu.h:619
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:557
GPU_FormatEnum format
Definition: SDL_gpu.h:273
DECLSPEC void SDLCALL GPU_GetRegisteredRendererList(GPU_RendererID *renderers_array)
void * per_vertex_storage
Definition: SDL_gpu.h:595
DECLSPEC void SDLCALL GPU_Scale(float sx, float sy, float sz)
GPU_Target float float float radius
int window_h
Definition: SDL_gpu.h:359
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:569
DECLSPEC GPU_bool SDLCALL GPU_GetCoordinateMode(void)
Definition: SDL_gpu.c:105
GPU_InitFlagEnum GPU_init_flags
Definition: SDL_gpu.h:659
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:1382
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:372
Uint32 GPU_TypeEnum
Definition: SDL_gpu.h:523
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:352
GPU_Target float float float float ry
GPU_WrapEnum wrap_mode_y
Definition: SDL_gpu.h:289
float default_image_anchor_y
Definition: SDL_gpu.h:674
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:1414
DECLSPEC void SDLCALL GPU_FreeShaderProgram(Uint32 program_object)
Definition: SDL_gpu.c:2164
DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect(GPU_Target *target, GPU_Rect rect)
Definition: SDL_gpu.c:1528
DECLSPEC void SDLCALL GPU_SetRGB(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b)
Definition: SDL_gpu.c:1631
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:408
DECLSPEC void SDLCALL GPU_FreeShader(Uint32 shader_object)
Definition: SDL_gpu.c:2156
int per_vertex_storage_stride_bytes
Definition: SDL_gpu.h:592
SDL_Color color
Definition: SDL_gpu.h:415
GPU_bool using_virtual_resolution
Definition: SDL_gpu.h:410
GPU_Target float float y1
DECLSPEC void SDLCALL GPU_UnsetColor(GPU_Image *image)
Definition: SDL_gpu.c:1659
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:406
DECLSPEC void SDLCALL GPU_SetUniformui(int location, unsigned int value)
Definition: SDL_gpu.c:2339
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:2199
DECLSPEC void SDLCALL GPU_SetTargetRGBA(GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1692
DECLSPEC void SDLCALL GPU_DeactivateShaderProgram(void)
Definition: SDL_gpu.c:2207
int int int int GPU_bool transpose
GPU_ErrorEnum
Definition: SDL_gpu.h:605
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:642
DECLSPEC void SDLCALL GPU_SetUniformuiv(int location, int num_elements_per_value, int num_values, unsigned int *values)
Definition: SDL_gpu.c:2347
DECLSPEC float SDLCALL GPU_VectorLength(float *vec3)
GPU_bool has_mipmaps
Definition: SDL_gpu.h:278
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:2003
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:1323
int min_shader_version
Definition: SDL_gpu.h:662
GPU_Image * image
Definition: SDL_gpu.h:407
DECLSPEC void SDLCALL GPU_SetRGBA(GPU_Image *image, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Definition: SDL_gpu.c:1645
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:2125
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:1333
Uint32 GPU_FlipEnum
Definition: SDL_gpu.h:514
DECLSPEC GPU_bool SDLCALL GPU_GetBlending(GPU_Image *image)
Definition: SDL_gpu.c:1717
GPU_bool use_texturing
Definition: SDL_gpu.h:381
DECLSPEC void SDLCALL GPU_SetAttributef(int location, float value)
Definition: SDL_gpu.c:2398
DECLSPEC GPU_Camera SDLCALL GPU_SetCamera(GPU_Target *target, GPU_Camera *cam)
Definition: SDL_gpu.c:880
int refcount
Definition: SDL_gpu.h:387
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:676
DECLSPEC void SDLCALL GPU_SetShapeBlendMode(GPU_BlendPresetEnum mode)
Definition: SDL_gpu.c:1884
DECLSPEC void SDLCALL GPU_MultMatrix(float *matrix4x4)
float anchor_x
Definition: SDL_gpu.h:280
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:1707
void * data
Definition: SDL_gpu.h:291
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:277
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:414
DECLSPEC SDL_Surface *SDLCALL GPU_CopySurfaceFromTarget(GPU_Target *target)
Definition: SDL_gpu.c:1265
float z
Definition: SDL_gpu.h:305
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:362
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:1838
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:2069
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:2314
DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect(GPU_Target *target, GPU_Rect B, GPU_Rect *result)
Definition: SDL_gpu.c:1608
DECLSPEC void SDLCALL GPU_SetAttributeiv(int location, int num_elements, int *value)
Definition: SDL_gpu.c:2430
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:673
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:1743
DECLSPEC void SDLCALL GPU_SetWrapMode(GPU_Image *image, GPU_WrapEnum wrap_mode_x, GPU_WrapEnum wrap_mode_y)
Definition: SDL_gpu.c:1964
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:2414
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:1956
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:1906
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:664
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:1491
DECLSPEC void SDLCALL GPU_SetUniformiv(int location, int num_elements_per_value, int num_values, int *values)
Definition: SDL_gpu.c:2322
Uint32 GPU_FeatureEnum
Definition: SDL_gpu.h:434
GPU_Context * context
Definition: SDL_gpu.h:424
DECLSPEC const char *SDLCALL GPU_GetErrorString(GPU_ErrorEnum error)
Definition: SDL_gpu.c:765
DECLSPEC GPU_Target *SDLCALL GPU_GetTarget(GPU_Image *image)
Definition: SDL_gpu.c:1313
float angle
Definition: SDL_gpu.h:306
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:1858
GPU_ShaderEnum
Definition: SDL_gpu.h:545
GPU_Rect clip_rect
Definition: SDL_gpu.h:413
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:288
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:375
DECLSPEC GPU_RendererID SDLCALL GPU_GetRendererID(GPU_RendererEnum renderer)
GPU_Target * target
Definition: SDL_gpu.h:270
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:2025
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:2331
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:2260
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:2223
Uint32 default_textured_shader_program
Definition: SDL_gpu.h:371
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:1398
GPU_Camera camera
Definition: SDL_gpu.h:420
int refcount
Definition: SDL_gpu.h:425
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:2188
Uint32 const char * uniform_name
DECLSPEC Uint32 SDLCALL GPU_LinkManyShaders(Uint32 *shader_objects, int count)
Definition: SDL_gpu.c:2133
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:593
DECLSPEC GPU_Rect SDLCALL GPU_SetClip(GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h)
Definition: SDL_gpu.c:1539