Hi all,
Lets see for example Texture2D. When I use SubloadCallback then
TextureObject would be generated with empty profile:
<code>
void Texture2D::apply(State& state) const
{
[...]
if (textureObject)
{
[...]
}
else if (_subloadCallback.valid())
{
_textureObjectBuffer[contextID] = textureObject =
generateTextureObject(this, contextID,GL_TEXTURE_2D);
textureObject->bind();
applyTexParameters(GL_TEXTURE_2D,state);
_subloadCallback->load(*this,state);
textureObject->setAllocated(_numMipmapLevels,_internalFormat,_textureWidth,_textureHeight,1,_borderWidth);
[...]
</code>
<code>
Texture::TextureObject*
Texture::TextureObjectManager::generateTextureObject(const Texture*
texture, GLenum target)
{
return generateTextureObject(texture, target, 0, 0, 0, 0, 0, 0);
}
[...]
Texture::TextureObject* Texture::generateTextureObject(const Texture*
texture, unsigned int contextID, GLenum target)
{
return
getTextureObjectManager(contextID)->generateTextureObject(texture, target);
}
</code>
Why not to move generating TextureObject to SubloadCallback::load? It
would be helpful to reuse already allocated TextureObjects.
Mikhail.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org