Ejemplo n.º 1
0
void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
{
//    OSG_NOTICE<<"handlePendingOrphandedGLBufferObjects()"<<_pendingOrphanedGLBufferObjects.size()<<std::endl;

    if (_pendingOrphanedGLBufferObjects.empty()) return;

    unsigned int numOrphaned = _pendingOrphanedGLBufferObjects.size();

    for(GLBufferObjectList::iterator itr = _pendingOrphanedGLBufferObjects.begin();
        itr != _pendingOrphanedGLBufferObjects.end();
        ++itr)
    {
        GLBufferObject* to = itr->get();

        _orphanedGLBufferObjects.push_back(to);

        remove(to);
    }


    // update the GLBufferObjectManager's running total of active + orphaned GLBufferObjects
    _parent->getNumberOrphanedGLBufferObjects() += numOrphaned;
    _parent->getNumberActiveGLBufferObjects() -= numOrphaned;

    _pendingOrphanedGLBufferObjects.clear();

    CHECK_CONSISTENCY
}
Ejemplo n.º 2
0
void GLBufferObjectSet::handlePendingOrphandedGLBufferObjects()
{
//    OSG_NOTIFY(osg::NOTICE)<<"handlePendingOrphandedGLBufferObjects()"<<_pendingOrphanedGLBufferObjects.size()<<std::endl;

    if (_pendingOrphanedGLBufferObjects.empty()) return;

    unsigned int numOrphaned = _pendingOrphanedGLBufferObjects.size();

    for(GLBufferObjectList::iterator itr = _pendingOrphanedGLBufferObjects.begin();
        itr != _pendingOrphanedGLBufferObjects.end();
        ++itr)
    {
        GLBufferObject* to = itr->get();

        _orphanedGLBufferObjects.push_back(to);

        remove(to);

#if 0
        OSG_NOTIFY(osg::NOTICE)<<"  HPOTO  after  _head = "<<_head<<std::endl;
        OSG_NOTIFY(osg::NOTICE)<<"  HPOTO  after _tail = "<<_tail<<std::endl;
        OSG_NOTIFY(osg::NOTICE)<<"  HPOTO  after to->_previous = "<<to->_previous<<std::endl;
        OSG_NOTIFY(osg::NOTICE)<<"  HPOTO  after to->_next = "<<to->_next<<std::endl;
#endif

    }


    // update the GLBufferObjectManager's running total of active + orphaned GLBufferObjects
    _parent->getNumberOrphanedGLBufferObjects() += numOrphaned;
    _parent->getNumberActiveGLBufferObjects() -= numOrphaned;

    _pendingOrphanedGLBufferObjects.clear();

    checkConsistency();
}