Clean up up osg::Geometry, removing long deprecated support for array indices and BIND_PER_PRIMITIVE binding that forced OpenGL slow paths. osg::Geometry is now smaller and only supports OpenGL fasts paths.
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient versions. Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
This commit is contained in:
@@ -106,6 +106,8 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual unsigned int getElementSize() const { return sizeof(osg::Vec3); }
|
||||
|
||||
/** Returns a pointer to the first element of the array. */
|
||||
virtual const GLvoid* getDataPointer() const {
|
||||
return _ptr;
|
||||
@@ -123,6 +125,9 @@ public:
|
||||
return _numElements * sizeof(osg::Vec3);
|
||||
}
|
||||
|
||||
virtual void reserveArray(unsigned int num) { OSG_NOTICE<<"reserveArray() not supported"<<std::endl; }
|
||||
virtual void resizeArray(unsigned int num) { OSG_NOTICE<<"resizeArray() not supported"<<std::endl; }
|
||||
|
||||
private:
|
||||
unsigned int _numElements;
|
||||
osg::Vec3* _ptr;
|
||||
@@ -277,11 +282,9 @@ osg::Geode* createGeometry()
|
||||
|
||||
// Changing these flags will tickle different cases in
|
||||
// Geometry::drawImplementation. They should all work fine
|
||||
// with the shared array. Setting VertexIndices will hit
|
||||
// some other cases.
|
||||
// with the shared array.
|
||||
geom->setUseVertexBufferObjects(false);
|
||||
geom->setUseDisplayList(false);
|
||||
geom->setFastPathHint(false);
|
||||
|
||||
geode->addDrawable( geom.get() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user