Commit abb71302 authored by nadro's avatar nadro

- Fixed issue with OpenGL bridge calls texture cache.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4875 dfc29bdd-3216-0410-991c-e03cc46cb475
parent b337ae06
......@@ -5415,6 +5415,24 @@ void COpenGLCallBridge::setClientActiveTexture(GLenum texture)
}
}
void COpenGLCallBridge::resetTexture(const ITexture* texture)
{
for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i)
{
if (Texture[i] == texture)
{
setActiveTexture(GL_TEXTURE0_ARB + i);
glBindTexture(GL_TEXTURE_2D, 0);
if (TextureFixedPipeline[i])
glDisable(GL_TEXTURE_2D);
Texture[i] = 0;
}
}
}
void COpenGLCallBridge::setTexture(GLuint stage, bool fixedPipeline)
{
if (stage < MATERIAL_MAX_TEXTURES)
......
......@@ -695,6 +695,8 @@ namespace video
// Texture calls.
void resetTexture(const ITexture* texture);
void setActiveTexture(GLenum texture);
void setClientActiveTexture(GLenum texture);
......
......@@ -97,6 +97,8 @@ COpenGLTexture::~COpenGLTexture()
glDeleteTextures(1, &TextureName);
if (Image)
Image->drop();
Driver->getBridgeCalls()->resetTexture(this);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment