-/* $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
{
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();