Commits

Alex Szpakowski committed f51869d

Reverted commit 8c64a0c (love.graphics.setCanvas(nil) erroring)

Comments (0)

Files changed (5)

src/modules/graphics/opengl/Graphics.cpp

 
 	// Enable textures
 	glEnable(GL_TEXTURE_2D);
-	gl.setActiveTextureUnit(0);
+	gl.setTextureUnit(0);
 
 	// Set the viewport to top-left corner
 	gl.setViewport(OpenGL::Viewport(0, 0, width, height));

src/modules/graphics/opengl/OpenGL.cpp

 	return state.scissor;
 }
 
-void OpenGL::setActiveTextureUnit(int textureunit)
+void OpenGL::setTextureUnit(int textureunit)
 {
 	if (textureunit < 0 || (size_t) textureunit >= state.textureUnits.size())
 		throw love::Exception("Invalid texture unit index (%d).", textureunit);
 	if (texture != state.textureUnits[textureunit])
 	{
 		int oldtextureunit = state.curTextureUnit;
-		setActiveTextureUnit(textureunit);
+		setTextureUnit(textureunit);
 
 		state.textureUnits[textureunit] = texture;
 		glBindTexture(GL_TEXTURE_2D, texture);
 
 		if (restoreprev)
-			setActiveTextureUnit(oldtextureunit);
+			setTextureUnit(oldtextureunit);
 	}
 }
 

src/modules/graphics/opengl/OpenGL.h

 	 *
 	 * @param textureunit Index in the range of [0, maxtextureunits-1]
 	 **/
-	void setActiveTextureUnit(int textureunit);
+	void setTextureUnit(int textureunit);
 
 	/**
 	 * Helper for binding an OpenGL texture.

src/modules/graphics/opengl/Shader.cpp

 		}
 
 		// We always want to use texture unit 0 for everyhing else.
-		gl.setActiveTextureUnit(0);
+		gl.setTextureUnit(0);
 	}
 }
 
 	glUniform1i(u.location, textureunit);
 
 	// reset texture unit
-	gl.setActiveTextureUnit(0);
+	gl.setTextureUnit(0);
 
 	// increment global shader texture id counter for this texture unit, if we haven't already
 	if (activeTextureUnits[textureunit-1] == 0)

src/modules/graphics/opengl/wrap_Graphics.cpp

 	instance->discardStencil();
 
 	// called with none -> reset to default buffer
-	// nil is an error, to help people with typoes
-	if (lua_isnone(L,1))
+	if (lua_isnoneornil(L,1))
 	{
 		Canvas::bindDefaultCanvas();
 		return 0;