Use the same FBConfig for both the pbuffer and context, else it might fail

This commit is contained in:
baldurk
2014-06-03 21:12:49 +01:00
parent 85052ccf57
commit 773c53d82e
+8 -19
View File
@@ -85,25 +85,6 @@ uint64_t GLReplay::MakeOutputWindow(void *wn, bool depth)
if(dpy == NULL)
return 0;
// don't need to care about the fb config as we won't be using the default framebuffer (backbuffer)
static int visAttribs[] = { 0 };
int numCfgs = 0;
GLXFBConfig *fbcfg = glXChooseFBConfigProc(dpy, DefaultScreen(dpy), visAttribs, &numCfgs);
if(fbcfg == NULL)
{
XCloseDisplay(dpy);
RDCERR("Couldn't choose default framebuffer config");
return 0;
}
// don't care about pbuffer properties for same reason as backbuffer
int pbAttribs[] = { GLX_PBUFFER_WIDTH, 32, GLX_PBUFFER_HEIGHT, 32, 0 };
wnd = glXCreatePbufferProc(dpy, fbcfg[0], pbAttribs);
XFree(fbcfg);
}
static int visAttribs[] = {
@@ -147,6 +128,14 @@ uint64_t GLReplay::MakeOutputWindow(void *wn, bool depth)
return 0;
}
if(wnd == 0)
{
// don't care about pbuffer properties as we won't render directly to this
int pbAttribs[] = { GLX_PBUFFER_WIDTH, 32, GLX_PBUFFER_HEIGHT, 32, 0 };
wnd = glXCreatePbufferProc(dpy, fbcfg[0], pbAttribs);
}
XFree(fbcfg);
OutputWindow win;