]> git.localhorst.tv Git - blobs.git/blob - src/app/init.hpp
simple planet render
[blobs.git] / src / app / init.hpp
1 #ifndef BLOBS_APP_INIT_HPP_
2 #define BLOBS_APP_INIT_HPP_
3
4 #include "../graphics/Viewport.hpp"
5
6 #include <al.h>
7 #include <SDL.h>
8 #include <string>
9
10
11 namespace blobs {
12 namespace app {
13
14 class InitSDL {
15
16 public:
17         InitSDL();
18         ~InitSDL();
19
20         InitSDL(const InitSDL &) = delete;
21         InitSDL &operator =(const InitSDL &) = delete;
22
23 };
24
25
26 class InitVideo {
27
28 public:
29         InitVideo();
30         ~InitVideo();
31
32         InitVideo(const InitVideo &) = delete;
33         InitVideo &operator =(const InitVideo &) = delete;
34
35 };
36
37
38 class InitIMG {
39
40 public:
41         InitIMG();
42         ~InitIMG();
43
44         InitIMG(const InitIMG &) = delete;
45         InitIMG &operator =(const InitIMG &) = delete;
46
47 };
48
49
50 class InitNet {
51
52 public:
53         InitNet();
54         ~InitNet();
55
56         InitNet(const InitNet &) = delete;
57         InitNet &operator =(const InitNet &) = delete;
58
59 };
60
61
62 class InitTTF {
63
64 public:
65         InitTTF();
66         ~InitTTF();
67
68         InitTTF(const InitTTF &) = delete;
69         InitTTF &operator =(const InitTTF &) = delete;
70
71 };
72
73
74 class InitAL {
75
76 public:
77         InitAL();
78         ~InitAL();
79
80         InitAL(const InitAL &) = delete;
81         InitAL &operator =(const InitAL &) = delete;
82
83 };
84
85
86 class InitGL {
87
88 public:
89         explicit InitGL(bool double_buffer = true, int sample_size = 1);
90
91         InitGL(const InitGL &) = delete;
92         InitGL &operator =(const InitGL &) = delete;
93
94 };
95
96
97 class Window {
98
99 public:
100         Window(int w, int h);
101         ~Window();
102
103         Window(const Window &) = delete;
104         Window &operator =(const Window &) = delete;
105
106         void GrabInput();
107         void ReleaseInput();
108
109         void GrabMouse();
110         void ReleaseMouse();
111
112         SDL_Window *Handle() { return handle; }
113
114         void Flip();
115
116 private:
117         SDL_Window *handle;
118
119 };
120
121
122 class GLContext {
123
124 public:
125         explicit GLContext(SDL_Window *);
126         ~GLContext();
127
128         GLContext(const GLContext &) = delete;
129         GLContext &operator =(const GLContext &) = delete;
130
131 private:
132         SDL_GLContext ctx;
133
134 };
135
136
137 class InitGLEW {
138
139 public:
140         InitGLEW();
141
142         InitGLEW(const InitGLEW &) = delete;
143         InitGLEW &operator =(const InitGLEW &) = delete;
144
145 };
146
147
148 struct Init {
149
150         Init(bool double_buffer = true, int sample_size = 1);
151
152         InitVideo init_video;
153         InitIMG init_img;
154         InitTTF init_ttf;
155         InitAL init_al;
156         InitGL init_gl;
157         Window window;
158         GLContext ctx;
159         InitGLEW init_glew;
160         graphics::Viewport viewport;
161
162 };
163
164 }
165 }
166
167 #endif