this repo has no description
0
fork

Configure Feed

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

at master 80 lines 1.9 kB view raw
1#ifndef _SDL_GPU_OPENGL_1_BASE_H__ 2#define _SDL_GPU_OPENGL_1_BASE_H__ 3 4#include "SDL_gpu.h" 5 6#if !defined(SDL_GPU_DISABLE_OPENGL) && !defined(SDL_GPU_DISABLE_OPENGL_1_BASE) 7 8 // Hacks to fix compile errors due to polluted namespace 9 #ifdef _WIN32 10 #define _WINUSER_H 11 #define _WINGDI_H 12 #endif 13 14 #include "glew.h" 15 16 #if defined(GL_EXT_bgr) && !defined(GL_BGR) 17 #define GL_BGR GL_BGR_EXT 18 #endif 19 #if defined(GL_EXT_bgra) && !defined(GL_BGRA) 20 #define GL_BGRA GL_BGRA_EXT 21 #endif 22 #if defined(GL_EXT_abgr) && !defined(GL_ABGR) 23 #define GL_ABGR GL_ABGR_EXT 24 #endif 25 26 #undef GL_MIRRORED_REPEAT 27 #define GL_MIRRORED_REPEAT GL_MIRRORED_REPEAT_ARB 28#endif 29 30 31 32#define GPU_CONTEXT_DATA ContextData_OpenGL_1_BASE 33#define GPU_IMAGE_DATA ImageData_OpenGL_1_BASE 34#define GPU_TARGET_DATA TargetData_OpenGL_1_BASE 35 36 37 38 39typedef struct ContextData_OpenGL_1_BASE 40{ 41 SDL_Color last_color; 42 GPU_bool last_use_texturing; 43 unsigned int last_shape; 44 GPU_bool last_use_blending; 45 GPU_BlendMode last_blend_mode; 46 GPU_Rect last_viewport; 47 GPU_Camera last_camera; 48 GPU_bool last_camera_inverted; 49 50 GPU_bool last_depth_test; 51 GPU_bool last_depth_write; 52 GPU_ComparisonEnum last_depth_function; 53 54 GPU_Image* last_image; 55 float* blit_buffer; // Holds sets of 4 vertices and 4 tex coords interleaved (e.g. [x0, y0, z0, s0, t0, ...]). 56 unsigned short blit_buffer_num_vertices; 57 unsigned short blit_buffer_max_num_vertices; 58 unsigned short* index_buffer; // Indexes into the blit buffer so we can use 4 vertices for every 2 triangles (1 quad) 59 unsigned int index_buffer_num_vertices; 60 unsigned int index_buffer_max_num_vertices; 61} ContextData_OpenGL_1_BASE; 62 63typedef struct ImageData_OpenGL_1_BASE 64{ 65 int refcount; 66 GPU_bool owns_handle; 67 Uint32 handle; 68 Uint32 format; 69} ImageData_OpenGL_1_BASE; 70 71typedef struct TargetData_OpenGL_1_BASE 72{ 73 int refcount; 74 Uint32 handle; 75 Uint32 format; 76} TargetData_OpenGL_1_BASE; 77 78 79 80#endif