]> git.tdb.fi Git - libs/gui.git/blob - source/glcontext.h
Plug some memory leaks
[libs/gui.git] / source / glcontext.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_GLCONTEXT_H_
9 #define MSP_GBASE_GLCONTEXT_H_
10
11 #include <GL/glx.h>
12 #include "types.h"
13
14 namespace Msp {
15 namespace Graphics {
16
17 class Display;
18
19 struct GLOptions
20 {
21         bool alpha;
22         bool stencil;
23         bool doublebuffer;
24         unsigned multisample;
25
26         GLOptions();
27 };
28
29 class GLContext
30 {
31 private:
32         typedef GLXContext Context;
33
34         Display &display;
35         Context context;
36         GLXWindow glx_wnd;
37         WindowHandle window;
38
39 public:
40         GLContext(Display &dpy, const GLOptions &opts);
41         ~GLContext();
42
43         void attach(Window &wnd);
44         void swap_buffers();
45 private:
46         void window_resized(unsigned, unsigned);
47 };
48
49 } // namespace Graphics
50 } // namespace Msp
51
52 #endif