Browse Source

Properly set shader dirty flags for love_ScreenSize when love.window.setMode is called.

Alex Szpakowski 10 years ago
parent
commit
5c46149afb
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/modules/graphics/opengl/Shader.cpp

+ 5 - 0
src/modules/graphics/opengl/Shader.cpp

@@ -218,6 +218,10 @@ void Shader::mapActiveUniforms()
 
 bool Shader::loadVolatile()
 {
+    // Recreating the shader program will invalidate uniforms that rely on these.
+    lastCanvas = (Canvas *) -1;
+    lastViewport = OpenGL::Viewport();
+
 	// zero out active texture list
 	activeTexUnits.clear();
 	activeTexUnits.insert(activeTexUnits.begin(), maxTexUnits, 0);
@@ -304,6 +308,7 @@ bool Shader::loadVolatile()
 		// make sure glUseProgram gets called.
 		current = nullptr;
 		attach();
+        checkSetScreenParams();
 	}
 
 	return true;