Manually keep track of bound textures, so we don't have to poll each frame

Patch submitted by slime73.
This commit is contained in:
Bart van Strien
2012-01-10 15:36:18 +01:00
parent 51d4553b7d
commit 2ac4a9e6d0
10 changed files with 33 additions and 26 deletions
+2 -2
View File
@@ -253,7 +253,7 @@ namespace opengl
GLint location = getUniformLocation(name);
glActiveTexture(GL_TEXTURE0 + texture_unit);
glBindTexture(GL_TEXTURE_2D, image.getTextureName());
bindTexture(image.getTextureName(), true); // guarantee it gets bound
glUniform1i(location, texture_unit);
// reset texture unit
@@ -271,7 +271,7 @@ namespace opengl
GLint location = getUniformLocation(name);
glActiveTexture(GL_TEXTURE0 + texture_unit);
glBindTexture(GL_TEXTURE_2D, canvas.getTextureName());
bindTexture(canvas.getTextureName(), true); // guarantee it gets bound
glUniform1i(location, texture_unit);
// reset texture unit