Show
Ignore:
Timestamp:
10/01/09 22:19:42 (5 years ago)
Author:
robert
Message:

Introduced new BufferObject? design + implementation in preperation of implementing a pool system for buffer objects

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgparametric/osgparametric.cpp

    r6941 r10600  
    107107}; 
    108108 
    109 osg::Node* createModel(const std::string& shader, const std::string& textureFileName, const std::string& terrainFileName, bool dynamic, bool vbo) 
     109osg::Node* createModel(const std::string& shader, const std::string& textureFileName, const std::string& terrainFileName, bool dynamic, bool useVBO) 
    110110{ 
    111111    osg::Geode* geode = new osg::Geode; 
     
    239239    geom->setVertexArray(vertices); 
    240240 
    241     osg::VertexBufferObject* vbObject = new osg::VertexBufferObject; 
    242     vertices->setVertexBufferObject(vbObject); 
    243      
    244     osg::ElementBufferObject* ebo = new osg::ElementBufferObject; 
     241    osg::VertexBufferObject* vbo = useVBO ? new osg::VertexBufferObject : 0; 
     242    if (vbo) vertices->setVertexBufferObject(vbo); 
     243     
     244    osg::ElementBufferObject* ebo = useVBO ? new osg::ElementBufferObject : 0; 
    245245 
    246246    for(iy=0; iy<num_y-1; ++iy) 
     
    256256        geom->addPrimitiveSet(elements);  
    257257         
    258         if (ebo) elements->setElementBufferObject(ebo);    
     258        if (ebo) elements->setElementBufferObject(ebo); 
    259259    } 
    260260