]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/glcontext.h
Exception changes
[libs/gui.git] / source / gbase / glcontext.h
index 297bc34b4a4f7c40fe3da8cbefbc258552ae8999..dfac328d9846f550d680cb5695d5ec9694856d28 100644 (file)
@@ -1,22 +1,13 @@
-/* $Id$
-
-This file is part of libmspgbase
-Copyright © 2007 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GBASE_GLCONTEXT_H_
 #define MSP_GBASE_GLCONTEXT_H_
 
-#ifndef WIN32
-#include <GL/glx.h>
-#endif
-#include "types.h"
+#include <stdexcept>
 
 namespace Msp {
 namespace Graphics {
 
 class Display;
+class Window;
 
 struct GLOptions
 {
@@ -28,24 +19,26 @@ struct GLOptions
        GLOptions();
 };
 
+
+class unsupported_gl_mode: public std::runtime_error
+{
+public:
+       unsupported_gl_mode(const GLOptions &);
+       virtual ~unsupported_gl_mode() throw () { }
+};
+
+
 class GLContext
 {
 private:
-#ifdef WIN32
-       typedef HGLRC Context;
-#else
-       typedef GLXContext Context;
-#endif
+       struct Private;
 
        Display &display;
        Window &window;
-       Context context;
-#ifndef WIN32
-       WindowHandle subwnd;
-#endif
+       Private *priv;
 
 public:
-       GLContext(Window &wnd, const GLOptions &opts=GLOptions());
+       GLContext(Window &wnd, const GLOptions &opts = GLOptions());
        ~GLContext();
 
        void swap_buffers();