]> git.localhorst.tv Git - blank.git/blob - src/init.hpp
0256d40fcf5ec8df6846551e73d98924eb855b43
[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 InitGL {
25
26 public:
27         InitGL();
28         ~InitGL();
29
30         InitGL(const InitGL &) = delete;
31         InitGL &operator =(const InitGL &) = delete;
32
33 };
34
35
36 class Window {
37
38 public:
39         Window();
40         ~Window();
41
42         Window(const Window &) = delete;
43         Window &operator =(const Window &) = delete;
44
45         GLContext CreateContext();
46
47         void Flip();
48
49 private:
50         SDL_Window *handle;
51
52 };
53
54
55 class GLContext {
56
57 public:
58         explicit GLContext(SDL_Window *);
59         ~GLContext();
60
61         GLContext(GLContext &&);
62         GLContext &operator =(GLContext &&);
63
64         GLContext(const GLContext &) = delete;
65         GLContext &operator =(const GLContext &) = delete;
66
67         static void EnableVSync();
68
69 private:
70         SDL_GLContext handle;
71
72 };
73
74
75 class InitGLEW {
76
77 public:
78         InitGLEW();
79         ~InitGLEW();
80
81         InitGLEW(const InitGLEW &) = delete;
82         InitGLEW &operator =(const InitGLEW &) = delete;
83
84 };
85
86 }
87
88 #endif