Browse Source

Fix a crash related to love.graphics.push and love.window.setMode.

Alex Szpakowski 8 years ago
parent
commit
f45c6a0d74
1 changed files with 3 additions and 4 deletions
  1. 3 4
      src/modules/graphics/opengl/Graphics.cpp

+ 3 - 4
src/modules/graphics/opengl/Graphics.cpp

@@ -63,6 +63,9 @@ Graphics::Graphics()
 	states.reserve(10);
 	states.push_back(DisplayState());
 
+	pixelSizeStack.reserve(5);
+	pixelSizeStack.push_back(1);
+
 	if (currentWindow.get())
 	{
 		int w, h;
@@ -313,10 +316,6 @@ bool Graphics::setMode(int width, int height)
 	// Restore the graphics state.
 	restoreState(states.back());
 
-	pixelSizeStack.clear();
-	pixelSizeStack.reserve(5);
-	pixelSizeStack.push_back(1);
-
 	int gammacorrect = isGammaCorrect() ? 1 : 0;
 
 	// We always need a default shader.