X-Git-Url: http://git.tdb.fi/?p=libs%2Fgui.git;a=blobdiff_plain;f=source%2Fgraphics%2Fglx%2Fglcontext.cpp;fp=source%2Fgraphics%2Fglx%2Fglcontext.cpp;h=ad63350283c223cc3a92aec699f316e5b8ad471c;hp=699f856f35d06ce239f7576e7b499500f3b6fc6a;hb=507fa60f32bd3f64840a2cdd1be5d68478432b55;hpb=cea95778acfd6e172639cafd7ad249cc13ceb2a6 diff --git a/source/graphics/glx/glcontext.cpp b/source/graphics/glx/glcontext.cpp index 699f856..ad63350 100644 --- a/source/graphics/glx/glcontext.cpp +++ b/source/graphics/glx/glcontext.cpp @@ -17,7 +17,7 @@ typedef GLXContext ContextHandle; struct GLContext::Private { - ContextHandle context = 0; + ContextHandle context = nullptr; // We need to create a window with the chosen visual WindowHandle subwnd = None; GLXWindow glxwnd = None; @@ -97,7 +97,7 @@ void GLContext::platform_init(const GLOptions &opts) priv->subwnd = XCreateWindow(dpy, window.get_private().window, 0, 0, window.get_width(), window.get_height(), 0, vi->depth, InputOutput, vi->visual, CWColormap, &attr); XMapWindow(dpy, priv->subwnd); - priv->glxwnd = glXCreateWindow(dpy, fb_configs[0], priv->subwnd, 0); + priv->glxwnd = glXCreateWindow(dpy, fb_configs[0], priv->subwnd, nullptr); if(opts.forward_compatible || opts.gl_version_major!=GLOptions::DEFAULT_VERSION) { @@ -108,7 +108,7 @@ void GLContext::platform_init(const GLOptions &opts) unsigned gl_version_minor = opts.gl_version_minor; if(opts.gl_version_major==GLOptions::LATEST_VERSION) { - ContextHandle probe_context = glXCreateNewContext(dpy, fb_configs[0], GLX_RGBA_TYPE, 0, true); + ContextHandle probe_context = glXCreateNewContext(dpy, fb_configs[0], GLX_RGBA_TYPE, nullptr, true); glXMakeContextCurrent(dpy, priv->glxwnd, priv->glxwnd, probe_context); const char *gl_ver_ptr = reinterpret_cast(glGetString(GL_VERSION)); @@ -121,7 +121,7 @@ void GLContext::platform_init(const GLOptions &opts) gl_version_major = lexical_cast(parts[0]); gl_version_minor = lexical_cast(parts[1]); - glXMakeContextCurrent(dpy, 0, 0, 0); + glXMakeContextCurrent(dpy, None, None, nullptr); glXDestroyContext(dpy, probe_context); } @@ -154,10 +154,10 @@ void GLContext::platform_init(const GLOptions &opts) const GLubyte *name = reinterpret_cast("glXCreateContextAttribsARB"); PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribs = reinterpret_cast(glXGetProcAddressARB(name)); - priv->context = glXCreateContextAttribs(dpy, fb_configs[0], 0, true, &ctx_attribs[0]); + priv->context = glXCreateContextAttribs(dpy, fb_configs[0], nullptr, true, &ctx_attribs[0]); } else - priv->context = glXCreateNewContext(dpy, fb_configs[0], GLX_RGBA_TYPE, 0, true); + priv->context = glXCreateNewContext(dpy, fb_configs[0], GLX_RGBA_TYPE, nullptr, true); XFree(vi); XFree(fb_configs); @@ -205,7 +205,7 @@ void GLContext::platform_init(const GLOptions &opts) priv = new Private; priv->glxwnd = 0; - priv->context = glXCreateContext(dpy, vi, 0, true); + priv->context = glXCreateContext(dpy, vi, nullptr, true); XSetWindowAttributes attr; attr.colormap = XCreateColormap(dpy, DefaultRootWindow(dpy), vi->visual, AllocNone); @@ -225,11 +225,11 @@ GLContext::~GLContext() if(priv->glxwnd) { - glXMakeContextCurrent(dpy, 0, 0, 0); + glXMakeContextCurrent(dpy, None, None, nullptr); glXDestroyWindow(dpy, priv->glxwnd); } else - glXMakeCurrent(dpy, 0, 0); + glXMakeCurrent(dpy, None, nullptr); glXDestroyContext(dpy, priv->context); XDestroyWindow(dpy, priv->subwnd);