|
@@ -988,7 +988,7 @@ void OpenGL::setTextureUnit(int textureunit)
|
|
|
state.curTextureUnit = textureunit;
|
|
|
}
|
|
|
|
|
|
-void OpenGL::bindTextureToUnit(TextureType target, GLuint texture, int textureunit, bool restoreprev)
|
|
|
+void OpenGL::bindTextureToUnit(TextureType target, GLuint texture, int textureunit, bool restoreprev, bool bindforedit)
|
|
|
{
|
|
|
if (texture != state.boundTextures[target][textureunit])
|
|
|
{
|
|
@@ -1004,14 +1004,14 @@ void OpenGL::bindTextureToUnit(TextureType target, GLuint texture, int textureun
|
|
|
else
|
|
|
state.curTextureUnit = textureunit;
|
|
|
}
|
|
|
- else if (!restoreprev && textureunit != state.curTextureUnit)
|
|
|
+ else if (bindforedit && !restoreprev && textureunit != state.curTextureUnit)
|
|
|
{
|
|
|
glActiveTexture(GL_TEXTURE0 + textureunit);
|
|
|
state.curTextureUnit = textureunit;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void OpenGL::bindTextureToUnit(Texture *texture, int textureunit, bool restoreprev)
|
|
|
+void OpenGL::bindTextureToUnit(Texture *texture, int textureunit, bool restoreprev, bool bindforedit)
|
|
|
{
|
|
|
TextureType textype = TEXTURE_2D;
|
|
|
GLuint handle = 0;
|
|
@@ -1033,7 +1033,7 @@ void OpenGL::bindTextureToUnit(Texture *texture, int textureunit, bool restorepr
|
|
|
handle = getDefaultTexture(textype);
|
|
|
}
|
|
|
|
|
|
- bindTextureToUnit(textype, handle, textureunit, restoreprev);
|
|
|
+ bindTextureToUnit(textype, handle, textureunit, restoreprev, bindforedit);
|
|
|
}
|
|
|
|
|
|
void OpenGL::deleteTexture(GLuint texture)
|