struct GLContext::Private
{
- ContextHandle context;
+ ContextHandle context = nullptr;
// We need to create a window with the chosen visual
- WindowHandle subwnd;
- GLXWindow glxwnd;
+ WindowHandle subwnd = None;
+ GLXWindow glxwnd = None;
};
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)
{
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<const char *>(glGetString(GL_VERSION));
gl_version_major = lexical_cast<unsigned>(parts[0]);
gl_version_minor = lexical_cast<unsigned>(parts[1]);
- glXMakeContextCurrent(dpy, 0, 0, 0);
+ glXMakeContextCurrent(dpy, None, None, nullptr);
glXDestroyContext(dpy, probe_context);
}
const GLubyte *name = reinterpret_cast<const GLubyte *>("glXCreateContextAttribsARB");
PFNGLXCREATECONTEXTATTRIBSARBPROC glXCreateContextAttribs = reinterpret_cast<PFNGLXCREATECONTEXTATTRIBSARBPROC>(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);
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);
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);