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:
@@ -11,6 +11,7 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
#include <osg/Geode>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Notify>
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -51,6 +52,10 @@ bool Geode::addDrawable( Drawable *drawable )
|
||||
{
|
||||
if (drawable /* && !containsDrawable(drawable)*/)
|
||||
{
|
||||
// fallback for handling geometry with deprecated data
|
||||
osg::Geometry* geometry = drawable->asGeometry();
|
||||
if (geometry && geometry->containsDeprecatedData()) geometry->fixDeprecatedData();
|
||||
|
||||
// note ref_ptr<> automatically handles incrementing drawable's reference count.
|
||||
_drawables.push_back(drawable);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user