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 \
36 in vec2 gpu_Vertex;\n\
37 in vec2 gpu_TexCoord;\n\
39 uniform 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 \
55 in vec2 gpu_Vertex;\n\
57 uniform 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 \
74 uniform 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 \
99 in vec2 gpu_Vertex;\n\
100 in vec2 gpu_TexCoord;\n\
101 in vec4 gpu_Color;\n\
102 uniform mat4 gpu_ModelViewProjectionMatrix;\n\
105 out vec2 texCoord;\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 \
117 in vec2 gpu_Vertex;\n\
118 in vec4 gpu_Color;\n\
119 uniform 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 \
136 uniform sampler2D tex;\n\
138 out vec4 fragColor;\n\
142 fragColor = texture(tex, texCoord) * color;\n\
145 #define GPU_DEFAULT_UNTEXTURED_FRAGMENT_SHADER_SOURCE_CORE \
150 out 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;
172 unsigned short blit_buffer_num_vertices;
173 unsigned short blit_buffer_max_num_vertices;
174 unsigned short* index_buffer;
175 unsigned int index_buffer_num_vertices;
176 unsigned int index_buffer_max_num_vertices;
179 unsigned int blit_VAO;
180 unsigned int blit_VBO[2];
181 unsigned int blit_IBO;
182 GPU_bool blit_VBO_flop;
185 unsigned int attribute_VBO[16];
191 GPU_bool owns_handle;
Definition: SDL_gpu.h:578
Definition: SDL_gpu.h:300
Definition: SDL_gpu_OpenGL_3.h:188
Definition: SDL_gpu.h:159
Definition: SDL_gpu.h:398
Definition: SDL_gpu.h:263
Definition: SDL_gpu_OpenGL_3.h:158
Definition: SDL_gpu_OpenGL_3.h:196