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:
Alex Szpakowski
2020-03-15 01:29:33 -03:00
parent 20b5ba6edb
commit 9c2454816f
+5
View File
@@ -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)