]> git.tdb.fi Git - libs/gui.git/blob - source/gbase/simplewindow.h
a506636a4ae8047b6823210c0bb4c0518ae7eb58
[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);
37 };
38
39
40 /**
41 A SimpleWindow bundled with a GLContext.
42 */
43 class SimpleGLWindow: public SimpleWindow
44 {
45 private:
46         GLContext gl_ctx;
47
48 public:
49         SimpleGLWindow(unsigned, unsigned);
50         GLContext &get_gl_context() { return gl_ctx; }
51         void swap_buffers();
52 };
53
54 } // namespace Graphics
55 } // namespace Msp
56
57 #endif