this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 100 lines 2.9 kB view raw
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 ADD_MISSING_OES_FUNCTIONS 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 59typedef 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_bool last_depth_test; 71 GPU_bool last_depth_write; 72 GPU_ComparisonEnum last_depth_function; 73 74 GPU_Image* last_image; 75 float* blit_buffer; // Holds sets of 4 vertices and 4 tex coords interleaved (e.g. [x0, y0, z0, s0, t0, ...]). 76 unsigned short blit_buffer_num_vertices; 77 unsigned short blit_buffer_max_num_vertices; 78 unsigned short* index_buffer; // Indexes into the blit buffer so we can use 4 vertices for every 2 triangles (1 quad) 79 unsigned int index_buffer_num_vertices; 80 unsigned int index_buffer_max_num_vertices; 81} ContextData_GLES_1; 82 83typedef struct ImageData_GLES_1 84{ 85 int refcount; 86 GPU_bool owns_handle; 87 Uint32 handle; 88 Uint32 format; 89} ImageData_GLES_1; 90 91typedef struct TargetData_GLES_1 92{ 93 int refcount; 94 Uint32 handle; 95 Uint32 format; 96} TargetData_GLES_1; 97 98 99 100#endif