mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Fixed love.graphics.isCreated to properly return false if love.window.setMode failed
This commit is contained in:
@@ -246,15 +246,19 @@ bool Graphics::setMode(int width, int height, bool &sRGB)
|
|||||||
|
|
||||||
void Graphics::unSetMode()
|
void Graphics::unSetMode()
|
||||||
{
|
{
|
||||||
|
if (!isCreated())
|
||||||
|
return;
|
||||||
|
|
||||||
// Window re-creation may destroy the GL context, so we must save the state.
|
// Window re-creation may destroy the GL context, so we must save the state.
|
||||||
if (isCreated())
|
savedState = saveState();
|
||||||
savedState = saveState();
|
|
||||||
|
|
||||||
// Unload all volatile objects. These must be reloaded after the display
|
// Unload all volatile objects. These must be reloaded after the display
|
||||||
// mode change.
|
// mode change.
|
||||||
Volatile::unloadAll();
|
Volatile::unloadAll();
|
||||||
|
|
||||||
gl.deInitContext();
|
gl.deInitContext();
|
||||||
|
|
||||||
|
created = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void APIENTRY debugCB(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei /*len*/, const GLchar *msg, GLvoid* /*usr*/)
|
static void APIENTRY debugCB(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei /*len*/, const GLchar *msg, GLvoid* /*usr*/)
|
||||||
|
|||||||
Reference in New Issue
Block a user