Properly abort the program if the SDL window can't be created at all (#1296)

This commit is contained in:
Cacodemon345 2021-02-25 02:27:42 +06:00 committed by GitHub
parent 769d60a64f
commit a531c9c35f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -448,6 +448,10 @@ SDLVideo::SDLVideo ()
if (Priv::softpolyEnabled)
{
Priv::CreateWindow(SDL_WINDOW_HIDDEN);
if (Priv::window == nullptr)
{
I_FatalError("Could not create SoftPoly window:\n%s\n",SDL_GetError());
}
}
#endif
}
@ -667,6 +671,10 @@ SystemGLFrameBuffer::SystemGLFrameBuffer(void *hMonitor, bool fullscreen)
break;
}
}
if (Priv::window == nullptr)
{
I_FatalError("Could not create OpenGL window:\n%s\n",SDL_GetError());
}
}
SystemGLFrameBuffer::~SystemGLFrameBuffer ()