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) ...@@ -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) void COpenGLCallBridge::setTexture(GLuint stage, bool fixedPipeline)
{ {
if (stage < MATERIAL_MAX_TEXTURES) if (stage < MATERIAL_MAX_TEXTURES)
......
...@@ -695,6 +695,8 @@ namespace video ...@@ -695,6 +695,8 @@ namespace video
// Texture calls. // Texture calls.
void resetTexture(const ITexture* texture);
void setActiveTexture(GLenum texture); void setActiveTexture(GLenum texture);
void setClientActiveTexture(GLenum texture); void setClientActiveTexture(GLenum texture);
......
...@@ -97,6 +97,8 @@ COpenGLTexture::~COpenGLTexture() ...@@ -97,6 +97,8 @@ COpenGLTexture::~COpenGLTexture()
glDeleteTextures(1, &TextureName); glDeleteTextures(1, &TextureName);
if (Image) if (Image)
Image->drop(); 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