X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fglcontext.h;h=ef374c1038efc6da274d5b62b370656a4b3fe2f7;hb=3c5bbaeadb33d288c0f9e487b52904b7ed7e4319;hp=f6357c3cce475513df04dc276a101d79bba42a15;hpb=be455be47a214f8fba1224ef1fb4158a073bc4e3;p=libs%2Fgui.git diff --git a/source/graphics/glcontext.h b/source/graphics/glcontext.h index f6357c3..ef374c1 100644 --- a/source/graphics/glcontext.h +++ b/source/graphics/glcontext.h @@ -11,22 +11,17 @@ 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(); + static constexpr unsigned DEFAULT_VERSION = 0; + static constexpr unsigned LATEST_VERSION = 0xFFFFFFFF; + + bool alpha = false; + bool stencil = false; + bool doublebuffer = true; + unsigned multisample = 0; + bool forward_compatible = false; + bool core_profile = false; + unsigned gl_version_major = DEFAULT_VERSION; + unsigned gl_version_minor = DEFAULT_VERSION; }; @@ -34,7 +29,6 @@ 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 &); @@ -48,7 +42,7 @@ private: Display &display; Window &window; - Private *priv; + Private *priv = nullptr; public: GLContext(Window &wnd, const GLOptions &opts = GLOptions());