From Fabien Lavignotte, "i have a problem with my application, i am currently playing with Texture2D::SubloadCallback to optimize my image data transfer, and also avoid double buffering when using a drawing thread.

There is a small bug with your change and SubloadCallback, the texture object is destroy at each call of Texture2D::apply because the modified count is never updated when using SubloadCallback.
I have made a small fix to avoid that, see attachement."

From Robert Osfield, added an if (_image.valid()) before the getModified() that Fabien added to avoid problems when no _image is assigned but an subload callback is.
This commit is contained in:
Robert Osfield
2009-12-08 16:02:43 +00:00
parent 57d0729484
commit 6c0d321e3d

View File

@@ -210,6 +210,8 @@ void Texture2D::apply(State& state) const
// perhaps it is the first glBind which is not required...
//glBindTexture( GL_TEXTURE_2D, handle );
// update the modified tag to show that it is upto date.
if (_image.vaid()) getModifiedCount(contextID) = _image->getModifiedCount();
}
else if (_image.valid() && _image->data())
{