Don't do any processing internally if GL context creation failed

This commit is contained in:
baldurk
2016-04-02 15:49:20 +02:00
parent 009bfb2c74
commit 7a513ff965
2 changed files with 16 additions and 4 deletions
+8
View File
@@ -586,6 +586,10 @@ __attribute__ ((visibility ("default")))
GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct)
{
GLXContext ret = OpenGLHook::glhooks.glXCreateContext_real(dpy, vis, shareList, direct);
// don't continue if context creation failed
if(!ret)
return ret;
GLInitParams init;
@@ -688,6 +692,10 @@ GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config, GLXConte
GLXContext ret = OpenGLHook::glhooks.glXCreateContextAttribsARB_real(dpy, config, shareList, direct, attribs);
// don't continue if context creation failed
if(!ret)
return ret;
XVisualInfo *vis = OpenGLHook::glhooks.glXGetVisualFromFBConfig_real(dpy, config);
GLInitParams init;
+8 -4
View File
@@ -386,8 +386,8 @@ class OpenGLHook : LibraryHook
{
HGLRC ret = glhooks.wglCreateContext_hook()(dc);
// don't recurse
if(glhooks.m_CreatingContext)
// don't recurse and don't continue if creation failed
if(glhooks.m_CreatingContext || ret == NULL)
return ret;
glhooks.m_CreatingContext = true;
@@ -422,8 +422,8 @@ class OpenGLHook : LibraryHook
{
HGLRC ret = glhooks.wglCreateLayerContext_hook()(dc, iLayerPlane);
// don't recurse
if(glhooks.m_CreatingContext)
// don't recurse and don't continue if creation failed
if(glhooks.m_CreatingContext || ret == NULL)
return ret;
glhooks.m_CreatingContext = true;
@@ -515,6 +515,10 @@ class OpenGLHook : LibraryHook
HGLRC ret = glhooks.wglCreateContextAttribsARB_realfunc(dc, hShareContext, attribs);
// don't continue if creation failed
if(ret == NULL)
return ret;
GLWindowingData data;
data.DC = dc;
data.wnd = WindowFromDC(dc);