Hi Thomas,
> I'm not sure of what form this method needs to take yet.. will do some
> further thinking on the topic.
I have settled upon a new SubloadCallback method:
class OSG_EXPORT SubloadCallback : public Referenced
{
public:
virtual bool textureObjectValid(const Texture2D&
texture, State& state) const
{
return texture.textureObjectValid(state);
}
...
};
And a new Texture2D helper method,
Texture2D::textureObjectValid(State&) that can be used by the
SubloadCallback as above with the default implementation, or by
osg::Texture2D::apply() itself to tell whether any modifications to
the Texture2D's Image will mean that the TextureObject needs
discarding and a new one to be created.
This change is now checked into svn/trunk. Since the default
behaviour of the callback and Texture2D is the same as before this
won't fix your example, to fix the example one simple adds:
virtual bool textureObjectValid(const osg::Texture2D& ,
osg::State&) const
{
return true;
}
To the NPOTResizeCallback. Changes example attached.
I haven't rolled this change out to other Texture classes yet as I
want the new methods to be tested properly first.
Thomas could you test out svn/trunk and let me know how you get on.
Cheers,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org