X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fglcontext.h;h=f6357c3cce475513df04dc276a101d79bba42a15;hb=be455be47a214f8fba1224ef1fb4158a073bc4e3;hp=db9df4e0aee08e3f150c17c826f2a578e1a142d7;hpb=1023b38fa278cea71fba3d2881e1bfde930cd025;p=libs%2Fgui.git diff --git a/source/graphics/glcontext.h b/source/graphics/glcontext.h index db9df4e..f6357c3 100644 --- a/source/graphics/glcontext.h +++ b/source/graphics/glcontext.h @@ -11,10 +11,20 @@ class Window; struct GLOptions { + enum + { + DEFAULT_VERSION = 0, + LATEST_VERSION = 0xFFFFFFFF + }; + bool alpha; bool stencil; bool doublebuffer; unsigned multisample; + bool forward_compatible; + bool core_profile; + unsigned gl_version_major; + unsigned gl_version_minor; GLOptions(); }; @@ -25,6 +35,9 @@ class unsupported_gl_mode: public std::runtime_error public: unsupported_gl_mode(const GLOptions &); virtual ~unsupported_gl_mode() throw () { } + +private: + static std::string format_version(const GLOptions &); }; @@ -39,8 +52,14 @@ private: public: GLContext(Window &wnd, const GLOptions &opts = GLOptions()); + GLContext(Window &wnd, unsigned, unsigned); +private: + void platform_init(const GLOptions &); +public: ~GLContext(); + void set_swap_interval(unsigned); + void swap_buffers(); private: void window_resized(unsigned, unsigned);