guiscreen.cpp: Ensure successful SDL_GL_CreateContext
SDL_GL_CreateContext can fail due to several reasons, such as GLXBadFBConfig on unsupported OpenGL versions.
This commit is contained in:
parent
a0c31c8a1c
commit
63db0b910a
1 changed files with 5 additions and 1 deletions
|
@ -377,7 +377,11 @@ SDL_Surface* gfScrCreateWindow(int nWinWidth, int nWinHeight, int nTotalDepth,in
|
|||
}
|
||||
#endif
|
||||
/* Create OpenGL context */
|
||||
GLContext = SDL_GL_CreateContext(GfuiWindow);
|
||||
if (!(GLContext = SDL_GL_CreateContext(GfuiWindow)))
|
||||
{
|
||||
GfLogError("SDL_GL_CreateContext failed: %s\n", SDL_GetError());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// If specified, try best possible settings.
|
||||
PScreenSurface = SDL_CreateRGBSurface(0, nWinWidth, nWinHeight, nTotalDepth,
|
||||
|
|
Loading…
Reference in a new issue