]> git.localhorst.tv Git - blank.git/blob - src/init.hpp
add SDL2_image library
[blank.git] / src / init.hpp
1 #ifndef BLANK_INIT_HPP_
2 #define BLANK_INIT_HPP_
3
4 #include <SDL.h>
5
6
7 namespace blank {
8
9 class GLContext;
10
11
12 class InitSDL {
13
14 public:
15         InitSDL();
16         ~InitSDL();
17
18         InitSDL(const InitSDL &) = delete;
19         InitSDL &operator =(const InitSDL &) = delete;
20
21 };
22
23
24 class InitIMG {
25
26 public:
27         InitIMG();
28         ~InitIMG();
29
30         InitIMG(const InitIMG &) = delete;
31         InitIMG &operator =(const InitIMG &) = delete;
32
33 };
34
35
36 class InitGL {
37
38 public:
39         InitGL();
40         ~InitGL();
41
42         InitGL(const InitGL &) = delete;
43         InitGL &operator =(const InitGL &) = delete;
44
45 };
46
47
48 class Window {
49
50 public:
51         Window();
52         ~Window();
53
54         Window(const Window &) = delete;
55         Window &operator =(const Window &) = delete;
56
57         GLContext CreateContext();
58
59         void Flip();
60
61 private:
62         SDL_Window *handle;
63
64 };
65
66
67 class GLContext {
68
69 public:
70         explicit GLContext(SDL_Window *);
71         ~GLContext();
72
73         GLContext(GLContext &&);
74         GLContext &operator =(GLContext &&);
75
76         GLContext(const GLContext &) = delete;
77         GLContext &operator =(const GLContext &) = delete;
78
79         static void EnableVSync();
80
81 private:
82         SDL_GLContext handle;
83
84 };
85
86
87 class InitGLEW {
88
89 public:
90         InitGLEW();
91         ~InitGLEW();
92
93         InitGLEW(const InitGLEW &) = delete;
94         InitGLEW &operator =(const InitGLEW &) = delete;
95
96 };
97
98 }
99
100 #endif