The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SDL_gpu_GLES_1.h
Go to the documentation of this file.
1 #ifndef _SDL_GPU_GLES_1_H__
2 #define _SDL_GPU_GLES_1_H__
3 
4 #include "SDL_gpu.h"
5 #include "SDL_platform.h"
6 
7 #if !defined(SDL_GPU_DISABLE_GLES) && !defined(SDL_GPU_DISABLE_GLES_1)
8 
9 #ifdef __IPHONEOS__
10  #include <OpenGLES/ES1/gl.h>
11  #include <OpenGLES/ES1/glext.h>
12 #else
13  #include "GLES/gl.h"
14  #include "GLES/glext.h"
15 #endif
16 
17  #define glFrustum glFrustumf
18  #define glOrtho glOrthof
19  #define glGenerateMipmap glGenerateMipmapOES
20  #define glDeleteFramebuffers glDeleteFramebuffersOES
21  #define glGenFramebuffers glGenFramebuffersOES
22  #define glFramebufferTexture2D glFramebufferTexture2DOES
23  #define glCheckFramebufferStatus glCheckFramebufferStatusOES
24  #define glBindFramebuffer glBindFramebufferOES
25  #define GL_FRAMEBUFFER GL_FRAMEBUFFER_OES
26  #define GL_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING_OES
27  #define GL_COLOR_ATTACHMENT0 GL_COLOR_ATTACHMENT0_OES
28  #define GL_FRAMEBUFFER_COMPLETE GL_FRAMEBUFFER_COMPLETE_OES
29 
30  #define glBlendEquation glBlendEquationOES
31  #define glBlendEquationSeparate glBlendEquationSeparateOES
32  #define glBlendFuncSeparate glBlendFuncSeparateOES
33 
34  #define GL_FUNC_ADD GL_FUNC_ADD_OES
35  #define GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES
36  #define GL_FUNC_REVERSE_SUBTRACT GL_FUNC_REVERSE_SUBTRACT_OES
37 
38  #define GL_MIRRORED_REPEAT GL_MIRRORED_REPEAT_OES
39 
40 #endif
41 
42 
43 #define GPU_CONTEXT_DATA ContextData_GLES_1
44 #define GPU_IMAGE_DATA ImageData_GLES_1
45 #define GPU_TARGET_DATA TargetData_GLES_1
46 
47 
48 
49 typedef struct ContextData_GLES_1
50 {
51  SDL_Color last_color;
53  unsigned int last_shape;
59 
62  float* blit_buffer; // Holds sets of 4 vertices and 4 tex coords interleaved (e.g. [x0, y0, z0, s0, t0, ...]).
63  unsigned short blit_buffer_num_vertices;
65  unsigned short* index_buffer; // Indexes into the blit buffer so we can use 4 vertices for every 2 triangles (1 quad)
69 
70 typedef struct ImageData_GLES_1
71 {
72  int refcount;
73  Uint32 handle;
74  Uint32 format;
76 
77 typedef struct TargetData_GLES_1
78 {
79  int refcount;
80  Uint32 handle;
81  Uint32 format;
83 
84 
85 
86 #endif
unsigned int index_buffer_num_vertices
unsigned short blit_buffer_num_vertices
unsigned short * index_buffer
GPU_Image * last_image
unsigned int last_shape
GPU_Target * last_target
GPU_Camera last_camera
struct ImageData_GLES_1 ImageData_GLES_1
struct TargetData_GLES_1 TargetData_GLES_1
unsigned int index_buffer_max_num_vertices
struct ContextData_GLES_1 ContextData_GLES_1
GPU_BlendMode last_blend_mode
unsigned short blit_buffer_max_num_vertices