Commit b973642c authored by Frédéric Larue's avatar Frédéric Larue

Bug fixed in the Bind()/Unbind() functions of GPU::Texture.

Previous active texture unit was not restored on unbinding. May cause sometimes a black screen on Qt applications.
parent 0f566a12
......@@ -16,20 +16,15 @@
void GPU::Texture::Bind( GLuint texUnit )
{
gpuAssert( glGetIntegerv( GL_ACTIVE_TEXTURE, &m_BackupUnit ) );
m_TexUnit = GL_TEXTURE0_ARB + texUnit;
gpuAssert( glActiveTextureARB( m_TexUnit ) );
//gpuAssert( glGetIntegerv( GL_TEXTURE_BINDING_2D, &m_BackupTex ) );
gpuAssert( glBindTexture( m_Target, m_Id ) );
}
void GPU::Texture::Unbind() const
{
//gpuAssert( glBindTexture( m_Target, m_BackupTex ) );
gpuAssert( glActiveTextureARB( m_BackupUnit ) );
gpuAssert( glActiveTextureARB( GL_TEXTURE0_ARB ) );
}
......
......@@ -33,9 +33,6 @@ namespace GPU
GLuint m_Id;
GLint m_TexUnit;
GLint m_BackupUnit;
//GLint m_BackupTex;
public:
inline Texture() : m_Target(GL_NONE), m_Id(0), m_TexUnit(0) {}
inline Texture( GLenum target ) : m_Target(target), m_Id(0), m_TexUnit(0) {}
......
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