Show
Ignore:
Timestamp:
10/06/09 15:42:12 (5 years ago)
Author:
robert
Message:

Fixed the TextureObject?'s + GLBufferObject reassignment to a new set.

Disabled the unref after apply for a Texture classes when the texture pool is enabled

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osg/BufferObject.cpp

    r10601 r10606  
    175175 
    176176        _profile._size = newTotalSize; 
     177 
    177178        if (_set) 
    178179        { 
    179             // remove self from original set 
    180             _set->remove(this); 
    181  
    182             // get the new set for the new profile 
    183             _set = _set->getParent()->getGLBufferObjectSet(_profile); 
    184  
    185             // register self with new set. 
    186             _set->addToBack(this); 
     180            _set->moveToSet(this, _set->getParent()->getGLBufferObjectSet(_profile)); 
    187181        } 
    188182 
     
    883877 
    884878 
     879void GLBufferObjectSet::moveToSet(GLBufferObject* to, GLBufferObjectSet* set) 
     880{ 
     881    if (set==this) return; 
     882    if (!set) return; 
     883 
     884    // remove 'to' from original set 
     885    --_numOfGLBufferObjects; 
     886    remove(to); 
     887 
     888    // register 'to' with new set. 
     889    to->_set = set; 
     890    ++set->_numOfGLBufferObjects; 
     891    set->addToBack(to); 
     892} 
     893 
     894 
     895 
    885896GLBufferObjectManager::GLBufferObjectManager(unsigned int contextID): 
    886897    _contextID(contextID),