Introduced SubloadCallback::generatdTextureObject() method.

This commit is contained in:
Robert Osfield 2010-10-14 13:35:36 +00:00
parent 297be2290a
commit 00fe3c0417
2 changed files with 6 additions and 2 deletions

View File

@ -87,6 +87,11 @@ class OSG_EXPORT Texture2D : public Texture
class OSG_EXPORT SubloadCallback : public Referenced
{
public:
virtual TextureObject* generateTextureObject(const Texture2D& texture, State& state) const
{
return osg::Texture::generateTextureObject(&texture, state.getContextID(), GL_TEXTURE_2D);
}
virtual void load(const Texture2D& texture,State& state) const = 0;
virtual void subload(const Texture2D& texture,State& state) const = 0;
};

View File

@ -191,8 +191,7 @@ void Texture2D::apply(State& state) const
}
else if (_subloadCallback.valid())
{
_textureObjectBuffer[contextID] = textureObject = generateTextureObject(this, contextID,GL_TEXTURE_2D);
_textureObjectBuffer[contextID] = textureObject = _subloadCallback->generateTextureObject(*this, state);
textureObject->bind();