The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SDL_gpu_OpenGL_3.c
Go to the documentation of this file.
1 #include "SDL_gpu_OpenGL_3.h"
2 
3 
4 #if defined(SDL_GPU_DISABLE_OPENGL) || defined(SDL_GPU_DISABLE_OPENGL_3)
5 
6 // Dummy implementations
9 
10 #else
11 
12 
13 // Most of the code pulled in from here...
14 #define SDL_GPU_USE_OPENGL
15 #define SDL_GPU_USE_GL_TIER3
16 #define SDL_GPU_GL_TIER 3
17 #define SDL_GPU_GLSL_VERSION 130
18 #define SDL_GPU_GL_MAJOR_VERSION 3
19 #include "../GL_common/SDL_gpu_GL_common.inl"
20 #include "../GL_common/SDL_gpuShapes_GL_common.inl"
21 
22 
24 {
25  GPU_Renderer* renderer = (GPU_Renderer*)malloc(sizeof(GPU_Renderer));
26  if(renderer == NULL)
27  return NULL;
28 
29  memset(renderer, 0, sizeof(GPU_Renderer));
30 
31  renderer->id = request;
32  renderer->id.id = GPU_RENDERER_OPENGL_3;
35 
36  renderer->current_context_target = NULL;
37 
38  SET_COMMON_FUNCTIONS(renderer);
39 
40  return renderer;
41 }
42 
44 {
45  if(renderer == NULL)
46  return;
47 
48  free(renderer);
49 }
50 
51 
52 #endif
GPU_Target * current_context_target
Definition: SDL_gpu.h:494
#define SET_COMMON_FUNCTIONS(renderer)
GPU_Renderer * GPU_CreateRenderer_OpenGL_3(GPU_RendererID request)
GPU_RendererEnum id
Definition: SDL_gpu.h:55
#define SDL_GPU_GLSL_VERSION
void GPU_FreeRenderer_OpenGL_3(GPU_Renderer *renderer)
GPU_RendererID id
Definition: SDL_gpu.h:484
static const GPU_RendererEnum GPU_RENDERER_OPENGL_3
Definition: SDL_gpu.h:40
GPU_ShaderLanguageEnum shader_language
Definition: SDL_gpu.h:489
int shader_version
Definition: SDL_gpu.h:490