Commits

Alex Szpakowski committed 06d7c7b

Fixed love.graphics.isCreated to properly return false if love.window.setMode failed

Comments (0)

Files changed (1)

src/modules/graphics/opengl/Graphics.cpp

 
 void Graphics::unSetMode()
 {
+	if (!isCreated())
+		return;
+
 	// 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
 	// mode change.
 	Volatile::unloadAll();
 
 	gl.deInitContext();
+
+	created = false;
 }
 
 static void APIENTRY debugCB(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei /*len*/, const GLchar *msg, GLvoid* /*usr*/)