mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Only query fbconfig for valid non-NULL context. Closes #1082
This commit is contained in:
@@ -367,18 +367,23 @@ HOOK_EXPORT Bool glXMakeContextCurrent(Display *dpy, GLXDrawable draw, GLXDrawab
|
||||
data.wnd = draw;
|
||||
data.ctx = ctx;
|
||||
|
||||
int fbconfigid = -1;
|
||||
GLX.glXQueryContext(dpy, ctx, GLX_FBCONFIG_ID, &fbconfigid);
|
||||
GLXFBConfig *config = NULL;
|
||||
|
||||
int attribs[] = {GLX_FBCONFIG_ID, fbconfigid, 0};
|
||||
if(ctx)
|
||||
{
|
||||
int fbconfigid = -1;
|
||||
GLX.glXQueryContext(dpy, ctx, GLX_FBCONFIG_ID, &fbconfigid);
|
||||
|
||||
int numElems = 0;
|
||||
GLXFBConfig *config = GLX.glXChooseFBConfig(dpy, DefaultScreen(dpy), attribs, &numElems);
|
||||
int attribs[] = {GLX_FBCONFIG_ID, fbconfigid, 0};
|
||||
|
||||
if(config)
|
||||
data.cfg = GLX.glXGetVisualFromFBConfig(dpy, *config);
|
||||
else
|
||||
data.cfg = NULL;
|
||||
int numElems = 0;
|
||||
config = GLX.glXChooseFBConfig(dpy, DefaultScreen(dpy), attribs, &numElems);
|
||||
|
||||
if(config)
|
||||
data.cfg = GLX.glXGetVisualFromFBConfig(dpy, *config);
|
||||
else
|
||||
data.cfg = NULL;
|
||||
}
|
||||
|
||||
glxhook.driver.ActivateContext(data);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user