]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/glcontext.h
Use constexpr instead of enum to define "typeless" constants
[libs/gui.git] / source / graphics / glcontext.h
index 986dd91e9642cb68832a3d5021d9b66cc9ff7d5a..c637b39e95308bdf6913e7c3dbbfc52de5f9839d 100644 (file)
@@ -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;
 };
 
 
@@ -47,7 +42,7 @@ private:
 
        Display &display;
        Window &window;
-       Private *priv;
+       Private *priv = 0;
 
 public:
        GLContext(Window &wnd, const GLOptions &opts = GLOptions());