mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 10:00:40 +00:00
Don't update context parameters when MakeCurrent is called with NULL
This commit is contained in:
@@ -126,9 +126,12 @@ CGLError GL_EXPORT_NAME(CGLSetCurrentContext)(CGLContextObj ctx)
|
||||
|
||||
cglhook.driver.ActivateContext(data);
|
||||
|
||||
GLInitParams ¶ms = cglhook.driver.GetInitParams(data);
|
||||
params.width = 400;
|
||||
params.height = 200;
|
||||
if(data.ctx)
|
||||
{
|
||||
GLInitParams ¶ms = cglhook.driver.GetInitParams(data);
|
||||
params.width = 400;
|
||||
params.height = 200;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -295,23 +295,26 @@ HOOK_EXPORT EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay display, EGLSurface
|
||||
|
||||
eglhook.driver.ActivateContext(data);
|
||||
|
||||
GLInitParams ¶ms = eglhook.driver.GetInitParams(data);
|
||||
if(ctx && draw)
|
||||
{
|
||||
GLInitParams ¶ms = eglhook.driver.GetInitParams(data);
|
||||
|
||||
int height, width;
|
||||
EGL.QuerySurface(display, draw, EGL_HEIGHT, &height);
|
||||
EGL.QuerySurface(display, draw, EGL_WIDTH, &width);
|
||||
int height, width;
|
||||
EGL.QuerySurface(display, draw, EGL_HEIGHT, &height);
|
||||
EGL.QuerySurface(display, draw, EGL_WIDTH, &width);
|
||||
|
||||
int colorspace = 0;
|
||||
EGL.QuerySurface(display, draw, EGL_GL_COLORSPACE, &colorspace);
|
||||
// GL_SRGB8_ALPHA8 is specified as color-renderable, unlike GL_SRGB8.
|
||||
bool isSRGB = params.colorBits == 32 && colorspace == EGL_GL_COLORSPACE_SRGB;
|
||||
int colorspace = 0;
|
||||
EGL.QuerySurface(display, draw, EGL_GL_COLORSPACE, &colorspace);
|
||||
// GL_SRGB8_ALPHA8 is specified as color-renderable, unlike GL_SRGB8.
|
||||
bool isSRGB = params.colorBits == 32 && colorspace == EGL_GL_COLORSPACE_SRGB;
|
||||
|
||||
bool isYFlipped = eglhook.IsYFlipped(display, draw);
|
||||
bool isYFlipped = eglhook.IsYFlipped(display, draw);
|
||||
|
||||
params.width = width;
|
||||
params.height = height;
|
||||
params.isSRGB = isSRGB;
|
||||
params.isYFlipped = isYFlipped;
|
||||
params.width = width;
|
||||
params.height = height;
|
||||
params.isSRGB = isSRGB;
|
||||
params.isYFlipped = isYFlipped;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -64,6 +64,9 @@ public:
|
||||
|
||||
void UpdateWindowSize(GLWindowingData data, Display *dpy, GLXDrawable drawable)
|
||||
{
|
||||
if(!data.ctx || !drawable)
|
||||
return;
|
||||
|
||||
// if we use the GLXDrawable in XGetGeometry and it's a GLXWindow, then we get
|
||||
// a BadDrawable error and things go south. Instead we track GLXWindows created
|
||||
// in glXCreateWindow/glXDestroyWindow and look up the source window it was
|
||||
|
||||
@@ -369,7 +369,7 @@ static BOOL WINAPI wglMakeCurrent_hooked(HDC dc, HGLRC rc)
|
||||
data.wnd = WindowFromDC(dc);
|
||||
data.ctx = rc;
|
||||
|
||||
if(wglhook.haveContextCreation)
|
||||
if(wglhook.haveContextCreation && data.ctx && data.wnd)
|
||||
{
|
||||
RECT r;
|
||||
GetClientRect(data.wnd, &r);
|
||||
|
||||
Reference in New Issue
Block a user