]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/simplewindow.h
f7bb0ce5ea30ef1d18ade5b1149e615789d922dd
[libs/gui.git] / source / graphics / simplewindow.h
1 #ifndef MSP_GRAPHICS_SIMPLEWINDOW_H_
2 #define MSP_GRAPHICS_SIMPLEWINDOW_H_
3
4 #include "display.h"
5 #include "glcontext.h"
6 #include "window.h"
7
8 namespace Msp {
9 namespace Graphics {
10
11 /**
12 Helper class for SimpleWindow.
13 */
14 class SimpleWindowBase
15 {
16 protected:
17         Display dpy;
18
19         SimpleWindowBase() { }
20 };
21
22
23 /**
24 A simplified Window that encapsulates a Display.
25 */
26 class SimpleWindow: public SimpleWindowBase, public Window
27 {
28 public:
29         SimpleWindow(unsigned, unsigned, bool =false);
30
31         void tick();
32 };
33
34
35 /**
36 A SimpleWindow bundled with a GLContext.
37 */
38 class SimpleGLWindow: public SimpleWindow
39 {
40 private:
41         GLContext gl_ctx;
42
43 public:
44         SimpleGLWindow(unsigned, unsigned, bool =false);
45         GLContext &get_gl_context() { return gl_ctx; }
46         void swap_buffers();
47 };
48
49 } // namespace Graphics
50 } // namespace Msp
51
52 #endif