mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Fix the active GL texture unit not always being set properly.
Fixes issues where texture methods wouldn't have any effect, depending on the current internal opengl state.
This commit is contained in:
@@ -993,6 +993,11 @@ void OpenGL::bindTextureToUnit(TextureType target, GLuint texture, int textureun
|
||||
else
|
||||
state.curTextureUnit = textureunit;
|
||||
}
|
||||
else if (!restoreprev && textureunit != state.curTextureUnit)
|
||||
{
|
||||
glActiveTexture(GL_TEXTURE0 + textureunit);
|
||||
state.curTextureUnit = textureunit;
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGL::bindTextureToUnit(Texture *texture, int textureunit, bool restoreprev)
|
||||
|
||||
Reference in New Issue
Block a user