Added back in the old osg::Geometry::addPrimitive(..) methods for backwards
compatibility and have placed them within a #ifdef USE_DEPREACATED_API block.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
// define used to include in API which is being fazed out
|
||||
// if you can compile your apps with this turned off you are
|
||||
// well placed for compatablity with future versions.
|
||||
// #define USE_DEPRECATED_API
|
||||
#define USE_DEPRECATED_API
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning( disable : 4244 )
|
||||
|
||||
@@ -130,6 +130,22 @@ class SG_EXPORT Geometry : public Drawable
|
||||
|
||||
void addPrimitiveSet(PrimitiveSet* primitive) { if (primitive) _primitives.push_back(primitive); dirtyDisplayList(); dirtyBound(); }
|
||||
|
||||
#ifdef USE_DEPRECATED_API
|
||||
|
||||
typedef PrimitiveSetList PrimitiveList;
|
||||
|
||||
void setPrimitiveList(const PrimitiveSetList& primitives) { _primitives = primitives; dirtyDisplayList(); dirtyBound(); }
|
||||
PrimitiveList& getPrimitiveList() { return _primitives; }
|
||||
const PrimitiveList& getPrimitiveList() const { return _primitives; }
|
||||
|
||||
unsigned int getNumPrimitives() const { return _primitives.size(); }
|
||||
Primitive* getPrimitive(unsigned int pos) { return _primitives[pos].get(); }
|
||||
const Primitive* getPrimitive(unsigned int pos) const { return _primitives[pos].get(); }
|
||||
|
||||
void addPrimitive(PrimitiveSet* primitive) { if (primitive) _primitives.push_back(primitive); dirtyDisplayList(); dirtyBound(); }
|
||||
|
||||
#endif
|
||||
|
||||
/** return true if OpenGL fast paths will be used with drawing this Geometry.
|
||||
* Fast paths use vertex arrays, and glDrawArrays/glDrawElements. Slow paths
|
||||
* use glBegin()/glVertex.../glEnd(). Use of per primtive bindings or per vertex indexed
|
||||
|
||||
@@ -135,9 +135,10 @@ class PrimitiveSet : public Object
|
||||
GLenum _mode;
|
||||
};
|
||||
|
||||
// temporary addition for backwards compatiblity.
|
||||
typedef PrimitiveSet Primitive;
|
||||
|
||||
#ifdef USE_DEPRECATED_API
|
||||
// temporary addition for backwards compatiblity.
|
||||
typedef PrimitiveSet Primitive;
|
||||
#endif
|
||||
|
||||
class SG_EXPORT DrawArrays : public PrimitiveSet
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user