mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Don't do anything in SwapBuffers if no GL context is active
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
|
||||
struct GLWindowingData
|
||||
{
|
||||
GLWindowingData() { DC = NULL; ctx = NULL; wnd = NULL; }
|
||||
|
||||
void SetCtx(void *c) { ctx = (HGLRC)c; }
|
||||
HDC DC;
|
||||
HGLRC ctx;
|
||||
@@ -54,6 +56,8 @@ struct GLWindowingData
|
||||
|
||||
struct GLWindowingData
|
||||
{
|
||||
GLWindowingData() { dpy = NULL; ctx = NULL; wnd = NULL; }
|
||||
|
||||
void SetCtx(void *c) { ctx = (GLXContext)c; }
|
||||
Display *dpy;
|
||||
GLXContext ctx;
|
||||
|
||||
@@ -1967,6 +1967,10 @@ void WrappedOpenGL::SwapBuffers(void *windowHandle)
|
||||
{
|
||||
if(m_State == WRITING_IDLE)
|
||||
RenderDoc::Inst().Tick();
|
||||
|
||||
// don't do anything if no context is active.
|
||||
if(GetCtx() == NULL)
|
||||
return;
|
||||
|
||||
m_FrameCounter++; // first present becomes frame #1, this function is at the end of the frame
|
||||
|
||||
|
||||
Reference in New Issue
Block a user