]> git.localhorst.tv Git - blank.git/blob - src/init.hpp
very basic chunk model
[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         void GrabInput();
58         void ReleaseInput();
59
60         void GrabMouse();
61         void ReleaseMouse();
62
63         GLContext CreateContext();
64
65         void Flip();
66
67 private:
68         SDL_Window *handle;
69
70 };
71
72
73 class GLContext {
74
75 public:
76         explicit GLContext(SDL_Window *);
77         ~GLContext();
78
79         GLContext(GLContext &&);
80         GLContext &operator =(GLContext &&);
81
82         GLContext(const GLContext &) = delete;
83         GLContext &operator =(const GLContext &) = delete;
84
85         static void EnableVSync();
86         static void EnableDepthTest();
87         static void EnableBackfaceCulling();
88
89         static void Clear();
90
91 private:
92         SDL_GLContext handle;
93
94 };
95
96
97 class InitGLEW {
98
99 public:
100         InitGLEW();
101         ~InitGLEW();
102
103         InitGLEW(const InitGLEW &) = delete;
104         InitGLEW &operator =(const InitGLEW &) = delete;
105
106 };
107
108 }
109
110 #endif