prototype IR and parser
[henge/webcc.git] / src / core / video.c
1 /*!@file
2 \brief core rendering support
3 \details initializes the SDL-based rendering target and context.
4 \author Mihrtec
5 \date 2016
6 ----------------------------------------------------------------------------*/
7 #include <glad/glad.h>
8 #include <SDL2/SDL.h>
9 #include <SDL2/SDL_image.h>
10 #include <SDL2/SDL_ttf.h>
11
12 #define ERROR_BUFFER_SIZE
13
14 int video_init(void);
15 const char * video_get_error(void);
16 void video_quit(void);
17
18 static char *video_error = 0;
19
20 int
21 video_init()
22 { if (!gladLoadGLLoader((GLADloadproc) SDL_GL_GetProcAddress))
23 { renderer_error = "Failed to initialize OpenGL context";
24 return -1;
25 }
26 printf("OGL %d.%d\n", GLVersion.major, GLVersion.minor);
27 return 0;
28 }
29
30 const char *
31 video_get_error()
32 { return renderer_error;
33 }
34
35 void
36 video_quit()
37 {
38 }