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.c
Go to the documentation of this file.
1 #include "SDL_gpu_GLES_1.h"
2 
3 #if defined(SDL_GPU_DISABLE_GLES) || defined(SDL_GPU_DISABLE_GLES_1)
4 
5 // Dummy implementations
7 void GPU_FreeRenderer_GLES_1(GPU_Renderer* renderer) {}
8 
9 #else
10 
11 
12 // Most of the code pulled in from here...
13 #define SDL_GPU_USE_GLES
14 #define SDL_GPU_USE_GL_TIER2
15 #define SDL_GPU_GL_TIER 2
16 #define SDL_GPU_GLES_MAJOR_VERSION 1
17 #define SDL_GPU_DISABLE_SHADERS
18 #define SDL_GPU_APPLY_TRANSFORMS_TO_GL_STACK
19 #define SDL_GPU_NO_VAO
20 #include "../GL_common/SDL_gpu_GL_common.inl"
21 #include "../GL_common/SDL_gpuShapes_GL_common.inl"
22 
23 
25 {
26  GPU_Renderer* renderer = (GPU_Renderer*)malloc(sizeof(GPU_Renderer));
27  if(renderer == NULL)
28  return NULL;
29 
30  memset(renderer, 0, sizeof(GPU_Renderer));
31 
32  renderer->id = request;
33  renderer->id.id = GPU_RENDERER_GLES_1;
35  renderer->shader_version = 0;
36 
37  renderer->current_context_target = NULL;
38 
39  SET_COMMON_FUNCTIONS(renderer);
40 
41  return renderer;
42 }
43 
45 {
46  if(renderer == NULL)
47  return;
48 
49  free(renderer);
50 }
51 
52 #endif
GPU_Renderer * GPU_CreateRenderer_GLES_1(GPU_RendererID request)
void GPU_FreeRenderer_GLES_1(GPU_Renderer *renderer)
GPU_Target * current_context_target
Definition: SDL_gpu.h:494
#define SET_COMMON_FUNCTIONS(renderer)
static const GPU_RendererEnum GPU_RENDERER_GLES_1
Definition: SDL_gpu.h:42
GPU_RendererEnum id
Definition: SDL_gpu.h:55
GPU_RendererID id
Definition: SDL_gpu.h:484
GPU_ShaderLanguageEnum shader_language
Definition: SDL_gpu.h:489
int shader_version
Definition: SDL_gpu.h:490