]> git.tdb.fi Git - libs/gui.git/blob - source/glwindow.h
Convert GLWindow to use GLX 1.3
[libs/gui.git] / source / glwindow.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GBASE_GLWINDOW_H_
9 #define MSP_GBASE_GLWINDOW_H_
10
11 #include <GL/glx.h>
12 #include "window.h"
13
14 namespace Msp {
15
16 struct GLDisplayOptions
17 {
18         bool alpha;
19         bool stencil;
20         bool doublebuffer;
21         unsigned multisample;
22
23         GLDisplayOptions();
24 };
25
26 class GLWindow: public Window
27 {
28 protected:
29         typedef GLXContext Context;
30
31         GLDisplayOptions gl_options;
32         GLXWindow glx_wnd;
33         Context context;
34
35 public:
36         GLWindow(unsigned, unsigned);
37         GLWindow(const DisplayOptions &, const GLDisplayOptions &);
38         ~GLWindow();
39
40         void swap_buffers();
41 protected:
42         void init();
43         virtual void on_event(const XEvent &event);
44 };
45
46 } // namespace Msp
47
48 #endif