All Classes Functions Variables Typedefs Enumerations Groups
SDL_gpu_GLES_1.h
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 /* It looks like on Raspberry Pi 2/Raspbian, the
31  symbols in library are missing the OES suffix,
32  even though the headers seem to be named right.
33 */
34 #ifdef SDL_GPU_USE_BROADCOM_RASPBERRYPI_WORKAROUND
35  extern void glBlendEquation(GLenum mode);
36  extern void glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
37  extern void glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
38 #else
39  #define glBlendEquation glBlendEquationOES
40  #define glBlendEquationSeparate glBlendEquationSeparateOES
41  #define glBlendFuncSeparate glBlendFuncSeparateOES
42 #endif
43 
44  #define GL_FUNC_ADD GL_FUNC_ADD_OES
45  #define GL_FUNC_SUBTRACT GL_FUNC_SUBTRACT_OES
46  #define GL_FUNC_REVERSE_SUBTRACT GL_FUNC_REVERSE_SUBTRACT_OES
47 
48  #define GL_MIRRORED_REPEAT GL_MIRRORED_REPEAT_OES
49 
50 #endif
51 
52 
53 #define GPU_CONTEXT_DATA ContextData_GLES_1
54 #define GPU_IMAGE_DATA ImageData_GLES_1
55 #define GPU_TARGET_DATA TargetData_GLES_1
56 
57 
58 
59 typedef struct ContextData_GLES_1
60 {
61  SDL_Color last_color;
62  GPU_bool last_use_texturing;
63  unsigned int last_shape;
64  GPU_bool last_use_blending;
65  GPU_BlendMode last_blend_mode;
66  GPU_Rect last_viewport;
67  GPU_Camera last_camera;
68  GPU_bool last_camera_inverted;
69 
70  GPU_Image* last_image;
71  GPU_Target* last_target;
72  float* blit_buffer; // Holds sets of 4 vertices and 4 tex coords interleaved (e.g. [x0, y0, z0, s0, t0, ...]).
73  unsigned short blit_buffer_num_vertices;
74  unsigned short blit_buffer_max_num_vertices;
75  unsigned short* index_buffer; // Indexes into the blit buffer so we can use 4 vertices for every 2 triangles (1 quad)
76  unsigned int index_buffer_num_vertices;
77  unsigned int index_buffer_max_num_vertices;
79 
80 typedef struct ImageData_GLES_1
81 {
82  int refcount;
83  GPU_bool owns_handle;
84  Uint32 handle;
85  Uint32 format;
87 
88 typedef struct TargetData_GLES_1
89 {
90  int refcount;
91  Uint32 handle;
92  Uint32 format;
94 
95 
96 
97 #endif
Definition: SDL_gpu_GLES_1.h:80
Definition: SDL_gpu.h:300
Definition: SDL_gpu_GLES_1.h:88
Definition: SDL_gpu_GLES_1.h:59
Definition: SDL_gpu.h:159
Definition: SDL_gpu.h:398
Definition: SDL_gpu.h:263
Definition: SDL_gpu.h:89