mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
improved GL texture binding api to take texture units into consideration
This commit is contained in:
@@ -332,12 +332,12 @@ void ShaderEffect::sendTexture(const std::string &name, GLuint texture)
|
||||
|
||||
GLint texture_unit = getTextureUnit(name);
|
||||
|
||||
glActiveTexture(GL_TEXTURE0 + texture_unit);
|
||||
bindTexture(texture, true); // guarantee it gets bound
|
||||
setActiveTextureUnit(GL_TEXTURE0 + texture_unit);
|
||||
bindTexture(texture);
|
||||
glUniform1i(location, texture_unit);
|
||||
|
||||
// reset texture unit
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
setActiveTextureUnit(GL_TEXTURE0);
|
||||
|
||||
// throw error if needed
|
||||
checkSetUniformError();
|
||||
|
||||
Reference in New Issue
Block a user