Commits

Alex Szpakowski committed ead96c7

Don't destroy OpenGL resources before checking whether the fullscreen size is supported in love.window.setMode.

  • Participants
  • Parent commits 06d7c7b

Comments (0)

Files changed (1)

src/modules/window/sdl/Window.cpp

 
 bool Window::setWindow(int width, int height, WindowSettings *settings)
 {
-	graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
-	if (gfx != nullptr)
-		gfx->unSetMode();
-
 	WindowSettings f;
 
 	if (settings)
 		sdlflags |= SDL_WINDOW_ALLOW_HIGHDPI;
 #endif
 
+	graphics::Graphics *gfx = (graphics::Graphics *) Module::findInstance("love.graphics.");
+	if (gfx != nullptr)
+		gfx->unSetMode();
+
 	// Destroy and recreate the window if the dimensions or flags have changed.
 	if (window)
 	{
 
 	if (!window)
 	{
+		created = false;
+
 		// In Windows and Linux, some GL attributes are set on window creation.
 		setWindowGLAttributes(f.fsaa, f.sRGB);