Added osg::getBinding(osg::Array* array) convinience function that returns the Array::getBinding() is the array is not NULL, otherwise returns BIND_OFF.

This commit is contained in:
Robert Osfield 2013-06-26 17:54:35 +00:00
parent 7ee05a345a
commit 9f0bbbf831

View File

@ -184,6 +184,10 @@ class OSG_EXPORT Array : public BufferData
bool _preserveDataType; bool _preserveDataType;
}; };
/** convinience function for getting the binding of array via a ptr that may be null.*/
inline int getBinding(const osg::Array* array) { return array ? array->getBinding() : osg::Array::BIND_OFF; }
template<typename T, Array::Type ARRAYTYPE, int DataSize, int DataType> template<typename T, Array::Type ARRAYTYPE, int DataSize, int DataType>
class TemplateArray : public Array, public MixinVector<T> class TemplateArray : public Array, public MixinVector<T>
{ {