The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SDL_gpu_GLES_2.c
Go to the documentation of this file.
1 #include "SDL_gpu_GLES_2.h"
2 
3 
4 #if defined(SDL_GPU_DISABLE_GLES) || defined(SDL_GPU_DISABLE_GLES_2)
5 
6 // Dummy implementations
8 void GPU_FreeRenderer_GLES_2(GPU_Renderer* renderer) {}
9 
10 #else
11 
12 
13 // Most of the code pulled in from here...
14 #define SDL_GPU_USE_GLES
15 #define SDL_GPU_USE_GL_TIER3
16 #define SDL_GPU_GL_TIER 3
17 #define SDL_GPU_GLSL_VERSION 100
18 #define SDL_GPU_GLES_MAJOR_VERSION 2
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_2;
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 
53 #endif
#define SDL_GPU_GLSL_VERSION
GPU_Renderer * GPU_CreateRenderer_GLES_2(GPU_RendererID request)
GPU_Target * current_context_target
Definition: SDL_gpu.h:494
#define SET_COMMON_FUNCTIONS(renderer)
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
static const GPU_RendererEnum GPU_RENDERER_GLES_2
Definition: SDL_gpu.h:43
void GPU_FreeRenderer_GLES_2(GPU_Renderer *renderer)
int shader_version
Definition: SDL_gpu.h:490