Window resizing stability fixes

This commit is contained in:
Jack Andersen
2015-11-16 20:41:32 -10:00
parent 49da287791
commit 4d133edd2c
7 changed files with 83 additions and 21 deletions

View File

@@ -185,6 +185,7 @@ struct GraphicsContextGLX : IGraphicsContext
IGraphicsCommandQueue* m_commandQueue = nullptr;
IGraphicsDataFactory* m_dataFactory = nullptr;
GLXContext m_mainCtx = 0;
GLXContext m_loadCtx = 0;
std::thread m_vsyncThread;
@@ -396,6 +397,21 @@ public:
return m_dataFactory;
}
IGraphicsDataFactory* getMainContextDataFactory()
{
XLockDisplay(m_xDisp);
if (!m_mainCtx)
{
m_mainCtx = glXCreateContextAttribsARB(m_xDisp, m_fbconfig, m_glxCtx, True, ContextAttribs);
if (!m_mainCtx)
Log.report(LogVisor::FatalError, "unable to make main GLX context");
}
if (!glXMakeContextCurrent(m_xDisp, m_glxWindow, m_glxWindow, m_mainCtx))
Log.report(LogVisor::FatalError, "unable to make main GLX context current");
XUnlockDisplay(m_xDisp);
return getDataFactory();
}
IGraphicsDataFactory* getLoadContextDataFactory()
{
XLockDisplay(m_xDisp);
@@ -1180,6 +1196,11 @@ public:
return m_gfxCtx.getDataFactory();
}
IGraphicsDataFactory* getMainContextDataFactory()
{
return m_gfxCtx.getMainContextDataFactory();
}
IGraphicsDataFactory* getLoadContextDataFactory()
{
return m_gfxCtx.getLoadContextDataFactory();