]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/wgl/glcontext.cpp
Update .gitignore to include build products on Windows
[libs/gui.git] / source / graphics / wgl / glcontext.cpp
index 5f9ae42bc777486660a9c375a94428df769ce804..5a13dc4f79e6068089521ed887cb441723203931 100644 (file)
@@ -26,7 +26,7 @@ typedef HGLRC ContextHandle;
 
 struct GLContext::Private
 {
-       ContextHandle context;
+       ContextHandle context = nullptr;
 };
 
 
@@ -55,7 +55,7 @@ void GLContext::platform_init(const GLOptions &opts)
        SetPixelFormat(dc, pf_index, &pfd);
 
        priv = new Private;
-       if(opts.forward_compatible || opts.gl_version_major!=DEFAULT_VERSION)
+       if(opts.forward_compatible || opts.gl_version_major!=GLOptions::DEFAULT_VERSION)
        {
                ContextHandle fake_context = wglCreateContext(dc);
                wglMakeCurrent(dc, fake_context);
@@ -107,7 +107,7 @@ void GLContext::platform_init(const GLOptions &opts)
                if(!priv->context)
                        throw unsupported_gl_mode(opts);
 
-               wglMakeCurrent(0, 0);
+               wglMakeCurrent(nullptr, nullptr);
                wglDeleteContext(fake_context);
        }
        else
@@ -119,7 +119,7 @@ void GLContext::platform_init(const GLOptions &opts)
 
 GLContext::~GLContext()
 {
-       wglMakeCurrent(0, 0);
+       wglMakeCurrent(nullptr, nullptr);
        wglDeleteContext(priv->context);
 
        delete priv;