Added handling of image dirty after a textyre has been bound, the texture
is now updated when the image is dirty.
This commit is contained in:
@@ -91,6 +91,10 @@ void Texture1D::apply(State& state) const
|
||||
{
|
||||
_subloadCallback->subload(*this,state);
|
||||
}
|
||||
else if(getModifiedTag(contextID) != _image->getModifiedTag())
|
||||
{
|
||||
applyTexImage1D(GL_TEXTURE_1D,_image.get(),state, _textureWidth, _numMimpmapLevels);
|
||||
}
|
||||
|
||||
}
|
||||
else if (_subloadCallback.valid())
|
||||
|
||||
@@ -86,14 +86,19 @@ void Texture2D::apply(State& state) const
|
||||
|
||||
if (handle != 0)
|
||||
{
|
||||
|
||||
glBindTexture( GL_TEXTURE_2D, handle );
|
||||
if (getTextureParameterDirty(state.getContextID())) applyTexParameters(GL_TEXTURE_2D,state);
|
||||
if (getTextureParameterDirty(state.getContextID()))
|
||||
applyTexParameters(GL_TEXTURE_2D,state);
|
||||
|
||||
if (_subloadCallback.valid())
|
||||
{
|
||||
_subloadCallback->subload(*this,state);
|
||||
}
|
||||
else if(getModifiedTag(contextID) != _image->getModifiedTag())
|
||||
{
|
||||
applyTexImage2D(GL_TEXTURE_2D,_image.get(),state,
|
||||
_textureWidth, _textureHeight, _numMimpmapLevels);
|
||||
}
|
||||
|
||||
}
|
||||
else if (_subloadCallback.valid())
|
||||
@@ -121,7 +126,8 @@ void Texture2D::apply(State& state) const
|
||||
|
||||
applyTexParameters(GL_TEXTURE_2D,state);
|
||||
|
||||
applyTexImage2D(GL_TEXTURE_2D,_image.get(),state, _textureWidth, _textureHeight, _numMimpmapLevels);
|
||||
applyTexImage2D(GL_TEXTURE_2D,_image.get(),state,
|
||||
_textureWidth, _textureHeight, _numMimpmapLevels);
|
||||
|
||||
// in theory the following line is redundent, but in practice
|
||||
// have found that the first frame drawn doesn't apply the textures
|
||||
|
||||
@@ -108,6 +108,10 @@ void Texture3D::apply(State& state) const
|
||||
{
|
||||
_subloadCallback->subload(*this,state);
|
||||
}
|
||||
else if(getModifiedTag(contextID) != _image->getModifiedTag())
|
||||
{
|
||||
applyTexImage3D(GL_TEXTURE_3D,_image.get(),state, _textureWidth, _textureHeight, _textureDepth,_numMimpmapLevels);
|
||||
}
|
||||
|
||||
}
|
||||
else if (_subloadCallback.valid())
|
||||
|
||||
Reference in New Issue
Block a user