]> git.tdb.fi Git - libs/gui.git/blob - source/gbase/simplewindow.h
1caa5e7bf202deaeaa5c27d8cd9d42e24141a3af
[libs/gui.git] / source / gbase / simplewindow.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2008  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GBASE_SIMPLEWINDOW_H_
9 #define MSP_GBASE_SIMPLEWINDOW_H_
10
11 #include "display.h"
12 #include "glcontext.h"
13 #include "window.h"
14
15 namespace Msp {
16 namespace Graphics {
17
18 /**
19 Helper class for SimpleWindow.
20 */
21 class SimpleWindowBase
22 {
23 protected:
24         Display dpy;
25
26         SimpleWindowBase() { }
27 };
28
29
30 /**
31 A simplified Window that encapsulates a Display.
32 */
33 class SimpleWindow: public SimpleWindowBase, public Window
34 {
35 public:
36         SimpleWindow(unsigned, unsigned, bool =false);
37
38         void tick();
39 };
40
41
42 /**
43 A SimpleWindow bundled with a GLContext.
44 */
45 class SimpleGLWindow: public SimpleWindow
46 {
47 private:
48         GLContext gl_ctx;
49
50 public:
51         SimpleGLWindow(unsigned, unsigned, bool =false);
52         GLContext &get_gl_context() { return gl_ctx; }
53         void swap_buffers();
54 };
55
56 } // namespace Graphics
57 } // namespace Msp
58
59 #endif