1#ifndef _SDL_GPU_OPENGL_3_H__
2#define _SDL_GPU_OPENGL_3_H__
6#if !defined(SDL_GPU_DISABLE_OPENGL) && !defined(SDL_GPU_DISABLE_OPENGL_3)
16 #if defined(GL_EXT_bgr) && !defined(GL_BGR)
17 #define GL_BGR GL_BGR_EXT
19 #if defined(GL_EXT_bgra) && !defined(GL_BGRA)
20 #define GL_BGRA GL_BGRA_EXT
22 #if defined(GL_EXT_abgr) && !defined(GL_ABGR)
23 #define GL_ABGR GL_ABGR_EXT
28#define GPU_CONTEXT_DATA ContextData_OpenGL_3
29#define GPU_IMAGE_DATA ImageData_OpenGL_3
30#define GPU_TARGET_DATA TargetData_OpenGL_3
33#define GPU_DEFAULT_TEXTURED_VERTEX_SHADER_SOURCE \
37in vec2 gpu_TexCoord;\n\
39uniform mat4 gpu_ModelViewProjectionMatrix;\n\
47 texCoord = vec2(gpu_TexCoord);\n\
48 gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 0.0, 1.0);\n\
52#define GPU_DEFAULT_UNTEXTURED_VERTEX_SHADER_SOURCE \
57uniform mat4 gpu_ModelViewProjectionMatrix;\n\
64 gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 0.0, 1.0);\n\
68#define GPU_DEFAULT_TEXTURED_FRAGMENT_SHADER_SOURCE \
74uniform sampler2D tex;\n\
78 gl_FragColor = texture2D(tex, texCoord) * color;\n\
81#define GPU_DEFAULT_UNTEXTURED_FRAGMENT_SHADER_SOURCE \
88 gl_FragColor = color;\n\
96#define GPU_DEFAULT_TEXTURED_VERTEX_SHADER_SOURCE_CORE \
100in vec2 gpu_TexCoord;\n\
102uniform mat4 gpu_ModelViewProjectionMatrix;\n\
109 color = gpu_Color;\n\
110 texCoord = vec2(gpu_TexCoord);\n\
111 gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 0.0, 1.0);\n\
114#define GPU_DEFAULT_UNTEXTURED_VERTEX_SHADER_SOURCE_CORE \
117in vec2 gpu_Vertex;\n\
119uniform mat4 gpu_ModelViewProjectionMatrix;\n\
125 color = gpu_Color;\n\
126 gl_Position = gpu_ModelViewProjectionMatrix * vec4(gpu_Vertex, 0.0, 1.0);\n\
130#define GPU_DEFAULT_TEXTURED_FRAGMENT_SHADER_SOURCE_CORE \
136uniform sampler2D tex;\n\
138out vec4 fragColor;\n\
142 fragColor = texture(tex, texCoord) * color;\n\
145#define GPU_DEFAULT_UNTEXTURED_FRAGMENT_SHADER_SOURCE_CORE \
150out vec4 fragColor;\n\
154 fragColor = color;\n\
160 SDL_Color last_color;
161 GPU_bool last_use_texturing;
162 unsigned int last_shape;
163 GPU_bool last_use_blending;
167 GPU_bool last_camera_inverted;
169 GPU_bool last_depth_test;
170 GPU_bool last_depth_write;
175 unsigned short blit_buffer_num_vertices;
176 unsigned short blit_buffer_max_num_vertices;
177 unsigned short* index_buffer;
178 unsigned int index_buffer_num_vertices;
179 unsigned int index_buffer_max_num_vertices;
182 unsigned int blit_VAO;
183 unsigned int blit_VBO[2];
184 unsigned int blit_IBO;
185 GPU_bool blit_VBO_flop;
188 unsigned int attribute_VBO[16];
194 GPU_bool owns_handle;
GPU_ComparisonEnum
Definition: SDL_gpu.h:183
Definition: SDL_gpu_OpenGL_3.h:159
Definition: SDL_gpu.h:710
Definition: SDL_gpu.h:227
Definition: SDL_gpu.h:380
Definition: SDL_gpu.h:334
Definition: SDL_gpu.h:138
Definition: SDL_gpu_OpenGL_3.h:192
Definition: SDL_gpu_OpenGL_3.h:200