mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Manually keep track of bound textures, so we don't have to poll each frame
Patch submitted by slime73.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user