]> git.tdb.fi Git - libs/gui.git/blob - source/graphics/simplewindow.h
Add decorations for things which should be exported from the library
[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 "mspgui_api.h"
7 #include "window.h"
8
9 namespace Msp {
10 namespace Graphics {
11
12 /**
13 Helper class for SimpleWindow.
14 */
15 class MSPGUI_API SimpleWindowBase
16 {
17 protected:
18         Display dpy;
19
20         SimpleWindowBase() { }
21 };
22
23
24 /**
25 A simplified Window that encapsulates a Display.
26 */
27 class MSPGUI_API SimpleWindow: public SimpleWindowBase, public Window
28 {
29 public:
30         SimpleWindow(unsigned, unsigned, bool =false);
31
32         void tick();
33 };
34
35
36 /**
37 A SimpleWindow bundled with a GLContext.
38 */
39 class MSPGUI_API SimpleGLWindow: public SimpleWindow
40 {
41 private:
42         GLContext gl_ctx;
43
44 public:
45         SimpleGLWindow(unsigned, unsigned, bool =false);
46         GLContext &get_gl_context() { return gl_ctx; }
47         void swap_buffers();
48 };
49
50 } // namespace Graphics
51 } // namespace Msp
52
53 #endif