Added VertexBufferObject and ElementBufferObject class interfaces, and wired
up osg::Array and osg::DrawElements* to these respectively. Updated wrappers
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#include <osg/Vec3b>
|
||||
#include <osg/Vec4b>
|
||||
|
||||
#include <osg/BufferObject>
|
||||
|
||||
#include <osg/Object>
|
||||
#include <osg/GL>
|
||||
@@ -71,14 +72,16 @@ class OSG_EXPORT Array : public Object
|
||||
_arrayType(arrayType),
|
||||
_dataSize(dataSize),
|
||||
_dataType(dataType),
|
||||
_modifiedCount(0) {}
|
||||
_modifiedCount(0),
|
||||
_vboIndex(0) {}
|
||||
|
||||
Array(const Array& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
Object(array,copyop),
|
||||
_arrayType(array._arrayType),
|
||||
_dataSize(array._dataSize),
|
||||
_dataType(array._dataType),
|
||||
_modifiedCount(0) {}
|
||||
_modifiedCount(0),
|
||||
_vboIndex(0) {}
|
||||
|
||||
virtual bool isSameKindAs(const Object* obj) const { return dynamic_cast<const Array*>(obj)!=NULL; }
|
||||
virtual const char* libraryName() const { return "osg"; }
|
||||
@@ -113,14 +116,31 @@ class OSG_EXPORT Array : public Object
|
||||
/** Get modified count value.*/
|
||||
inline unsigned int getModifiedCount() const { return _modifiedCount; }
|
||||
|
||||
/** Set the VertexBufferObject.*/
|
||||
inline void setVertexBufferObject(osg::VertexBufferObject* vbo) { _vbo = vbo; }
|
||||
|
||||
/** Get the VertexBufferObject. If no VBO is assigned returns NULL*/
|
||||
inline osg::VertexBufferObject* getVertexBufferObject() { return _vbo.get(); }
|
||||
|
||||
/** Get the const VertexBufferObject. If no VBO is assigned returns NULL*/
|
||||
inline const osg::VertexBufferObject* getVertexBufferObject() const { return _vbo.get(); }
|
||||
|
||||
/** Set the index into the VertexBufferObject, if used.*/
|
||||
inline void setVertexBufferObjectIndex(unsigned int index) { _vboIndex = index; }
|
||||
|
||||
/** Get the index into the VertexBufferObject, if used.*/
|
||||
inline unsigned int getVertexBufferObjectIndex() const { return _vboIndex; }
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~Array() {}
|
||||
|
||||
Type _arrayType;
|
||||
GLint _dataSize;
|
||||
GLenum _dataType;
|
||||
unsigned int _modifiedCount;
|
||||
Type _arrayType;
|
||||
GLint _dataSize;
|
||||
GLenum _dataType;
|
||||
unsigned int _modifiedCount;
|
||||
osg::ref_ptr<osg::VertexBufferObject> _vbo;
|
||||
unsigned int _vboIndex;
|
||||
};
|
||||
|
||||
template<typename T, Array::Type ARRAYTYPE, int DataSize, int DataType>
|
||||
|
||||
@@ -216,9 +216,6 @@ class OSG_EXPORT BufferObject : public Object
|
||||
|
||||
typedef osg::buffered_value<GLuint> GLObjectList;
|
||||
|
||||
typedef std::pair< BufferEntry, ref_ptr<Array> > BufferEntryArrayPair;
|
||||
typedef std::pair< BufferEntry, ref_ptr<PrimitiveSet> > BufferEntryPrimitiveSetPair;
|
||||
|
||||
mutable GLObjectList _bufferObjectList;
|
||||
|
||||
GLenum _target;
|
||||
@@ -226,6 +223,70 @@ class OSG_EXPORT BufferObject : public Object
|
||||
mutable unsigned int _totalSize;
|
||||
};
|
||||
|
||||
class Array;
|
||||
class OSG_EXPORT VertexBufferObject : public BufferObject
|
||||
{
|
||||
public:
|
||||
|
||||
VertexBufferObject();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
VertexBufferObject(const VertexBufferObject& vbo,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Object(osg,VertexBufferObject);
|
||||
|
||||
typedef std::pair< BufferEntry, Array* > BufferEntryArrayPair;
|
||||
typedef std::vector< BufferEntryArrayPair > BufferEntryArrayPairs;
|
||||
|
||||
unsigned int addArray(osg::Array* array);
|
||||
|
||||
void setArray(unsigned int i, Array* array);
|
||||
Array* getArray(unsigned int i) { return _bufferEntryArrayPairs[i].second; }
|
||||
const Array* getArray(unsigned int i) const { return _bufferEntryArrayPairs[i].second; }
|
||||
|
||||
virtual bool needsCompile(unsigned int contextID) const;
|
||||
|
||||
virtual void compileBuffer(State& state) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~VertexBufferObject();
|
||||
|
||||
BufferEntryArrayPairs _bufferEntryArrayPairs;
|
||||
};
|
||||
|
||||
class DrawElements;
|
||||
class OSG_EXPORT ElementsBufferObject : public BufferObject
|
||||
{
|
||||
public:
|
||||
|
||||
ElementsBufferObject();
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
ElementsBufferObject(const ElementsBufferObject& pbo,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
|
||||
|
||||
META_Object(osg,ElementsBufferObject);
|
||||
|
||||
typedef std::pair< BufferEntry, DrawElements* > BufferEntryDrawElementstPair;
|
||||
typedef std::vector< BufferEntryDrawElementstPair > BufferEntryDrawElementsPairs;
|
||||
|
||||
unsigned int addDrawElements(osg::DrawElements* PrimitiveSet);
|
||||
|
||||
void setDrawElements(unsigned int i, DrawElements* PrimitiveSet);
|
||||
DrawElements* getDrawElements(unsigned int i) { return _bufferEntryDrawElementsPairs[i].second; }
|
||||
const DrawElements* getDrawElements(unsigned int i) const { return _bufferEntryDrawElementsPairs[i].second; }
|
||||
|
||||
virtual bool needsCompile(unsigned int contextID) const;
|
||||
|
||||
virtual void compileBuffer(State& state) const;
|
||||
|
||||
protected:
|
||||
|
||||
virtual ~ElementsBufferObject();
|
||||
|
||||
BufferEntryDrawElementsPairs _bufferEntryDrawElementsPairs;
|
||||
};
|
||||
|
||||
class Image;
|
||||
class OSG_EXPORT PixelBufferObject : public BufferObject
|
||||
{
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <osg/Vec3>
|
||||
#include <osg/Vec4>
|
||||
|
||||
#include <osg/BufferObject>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace osg {
|
||||
@@ -400,25 +402,60 @@ class OSG_EXPORT DrawArrayLengths : public PrimitiveSet, public VectorGLsizei
|
||||
GLint _first;
|
||||
};
|
||||
|
||||
class OSG_EXPORT DrawElementsUByte : public PrimitiveSet, public VectorGLubyte
|
||||
class DrawElements : public PrimitiveSet
|
||||
{
|
||||
public:
|
||||
|
||||
DrawElements(Type primType=PrimitiveType, GLenum mode=0):
|
||||
PrimitiveSet(primType,mode),
|
||||
_eboIndex(0) {}
|
||||
|
||||
DrawElements(const DrawElements& copy,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
PrimitiveSet(copy,copyop),
|
||||
_eboIndex(0) {}
|
||||
|
||||
|
||||
/** Set the ElementsBufferObject.*/
|
||||
inline void setElementsBufferObject(osg::ElementsBufferObject* ebo) { _ebo = ebo; }
|
||||
|
||||
/** Get the ElementsBufferObject. If no EBO is assigned returns NULL*/
|
||||
inline osg::ElementsBufferObject* getElementsBufferObject() { return _ebo.get(); }
|
||||
|
||||
/** Get the const ElementsBufferObject. If no EBO is assigned returns NULL*/
|
||||
inline const osg::ElementsBufferObject* getElementsBufferObject() const { return _ebo.get(); }
|
||||
|
||||
/** Set the index into the ElementsBufferObject, if used.*/
|
||||
inline void setElementsBufferObjectIndex(unsigned int index) { _eboIndex = index; }
|
||||
|
||||
/** Get the index into the ElementsBufferObject, if used.*/
|
||||
inline unsigned int getElementsBufferObjectIndex() const { return _eboIndex; }
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
osg::ref_ptr<ElementsBufferObject> _ebo;
|
||||
unsigned int _eboIndex;
|
||||
};
|
||||
|
||||
class OSG_EXPORT DrawElementsUByte : public DrawElements, public VectorGLubyte
|
||||
{
|
||||
public:
|
||||
|
||||
typedef VectorGLubyte vector_type;
|
||||
|
||||
DrawElementsUByte(GLenum mode=0):
|
||||
PrimitiveSet(DrawElementsUBytePrimitiveType,mode) {}
|
||||
DrawElements(DrawElementsUBytePrimitiveType,mode) {}
|
||||
|
||||
DrawElementsUByte(const DrawElementsUByte& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
PrimitiveSet(array,copyop),
|
||||
DrawElements(array,copyop),
|
||||
vector_type(array) {}
|
||||
|
||||
DrawElementsUByte(GLenum mode,unsigned int no,GLubyte* ptr) :
|
||||
PrimitiveSet(DrawElementsUBytePrimitiveType,mode),
|
||||
DrawElements(DrawElementsUBytePrimitiveType,mode),
|
||||
vector_type(ptr,ptr+no) {}
|
||||
|
||||
DrawElementsUByte(GLenum mode,unsigned int no) :
|
||||
PrimitiveSet(DrawElementsUBytePrimitiveType,mode),
|
||||
DrawElements(DrawElementsUBytePrimitiveType,mode),
|
||||
vector_type(no) {}
|
||||
|
||||
virtual Object* cloneType() const { return new DrawElementsUByte(); }
|
||||
@@ -478,30 +515,30 @@ class OSG_EXPORT DrawElementsUByte : public PrimitiveSet, public VectorGLubyte
|
||||
};
|
||||
|
||||
|
||||
class OSG_EXPORT DrawElementsUShort : public PrimitiveSet, public VectorGLushort
|
||||
class OSG_EXPORT DrawElementsUShort : public DrawElements, public VectorGLushort
|
||||
{
|
||||
public:
|
||||
|
||||
typedef VectorGLushort vector_type;
|
||||
|
||||
DrawElementsUShort(GLenum mode=0):
|
||||
PrimitiveSet(DrawElementsUShortPrimitiveType,mode) {}
|
||||
DrawElements(DrawElementsUShortPrimitiveType,mode) {}
|
||||
|
||||
DrawElementsUShort(const DrawElementsUShort& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
PrimitiveSet(array,copyop),
|
||||
DrawElements(array,copyop),
|
||||
vector_type(array) {}
|
||||
|
||||
DrawElementsUShort(GLenum mode,unsigned int no,GLushort* ptr) :
|
||||
PrimitiveSet(DrawElementsUShortPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUShortPrimitiveType,mode),
|
||||
vector_type(ptr,ptr+no) {}
|
||||
|
||||
DrawElementsUShort(GLenum mode,unsigned int no) :
|
||||
PrimitiveSet(DrawElementsUShortPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUShortPrimitiveType,mode),
|
||||
vector_type(no) {}
|
||||
|
||||
template <class InputIterator>
|
||||
DrawElementsUShort(GLenum mode, InputIterator first,InputIterator last) :
|
||||
PrimitiveSet(DrawElementsUShortPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUShortPrimitiveType,mode),
|
||||
vector_type(first,last) {}
|
||||
|
||||
virtual Object* cloneType() const { return new DrawElementsUShort(); }
|
||||
@@ -559,30 +596,30 @@ class OSG_EXPORT DrawElementsUShort : public PrimitiveSet, public VectorGLushort
|
||||
mutable GLObjectList _vboList;
|
||||
};
|
||||
|
||||
class OSG_EXPORT DrawElementsUInt : public PrimitiveSet, public VectorGLuint
|
||||
class OSG_EXPORT DrawElementsUInt : public DrawElements, public VectorGLuint
|
||||
{
|
||||
public:
|
||||
|
||||
typedef VectorGLuint vector_type;
|
||||
|
||||
DrawElementsUInt(GLenum mode=0):
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode) {}
|
||||
DrawElements(DrawElementsUIntPrimitiveType,mode) {}
|
||||
|
||||
DrawElementsUInt(const DrawElementsUInt& array,const CopyOp& copyop=CopyOp::SHALLOW_COPY):
|
||||
PrimitiveSet(array,copyop),
|
||||
DrawElements(array,copyop),
|
||||
vector_type(array) {}
|
||||
|
||||
DrawElementsUInt(GLenum mode,unsigned int no,GLuint* ptr) :
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUIntPrimitiveType,mode),
|
||||
vector_type(ptr,ptr+no) {}
|
||||
|
||||
DrawElementsUInt(GLenum mode,unsigned int no) :
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUIntPrimitiveType,mode),
|
||||
vector_type(no) {}
|
||||
|
||||
template <class InputIterator>
|
||||
DrawElementsUInt(GLenum mode, InputIterator first,InputIterator last) :
|
||||
PrimitiveSet(DrawElementsUIntPrimitiveType,mode),
|
||||
DrawElements(DrawElementsUIntPrimitiveType,mode),
|
||||
vector_type(first,last) {}
|
||||
|
||||
virtual Object* cloneType() const { return new DrawElementsUInt(); }
|
||||
|
||||
@@ -276,8 +276,92 @@ void BufferObject::Extensions::glGetBufferPointerv (GLenum target, GLenum pname,
|
||||
else notify(WARN)<<"Error: glGetBufferPointerv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// VertexBufferObject
|
||||
//
|
||||
VertexBufferObject::VertexBufferObject()
|
||||
{
|
||||
}
|
||||
|
||||
VertexBufferObject::VertexBufferObject(const VertexBufferObject& vbo,const CopyOp& copyop):
|
||||
BufferObject(vbo,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
VertexBufferObject::~VertexBufferObject()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int VertexBufferObject::addArray(osg::Array* array)
|
||||
{
|
||||
unsigned int i = _bufferEntryArrayPairs.size();
|
||||
_bufferEntryArrayPairs.resize(i+1);
|
||||
_bufferEntryArrayPairs[i].second = array;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void VertexBufferObject::setArray(unsigned int i, Array* array)
|
||||
{
|
||||
if (i+1>=_bufferEntryArrayPairs.size()) _bufferEntryArrayPairs.resize(i+1);
|
||||
|
||||
_bufferEntryArrayPairs[i].second = array;
|
||||
}
|
||||
|
||||
bool VertexBufferObject::needsCompile(unsigned int contextID) const
|
||||
{
|
||||
}
|
||||
|
||||
void VertexBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// ElementsBufferObject
|
||||
//
|
||||
ElementsBufferObject::ElementsBufferObject()
|
||||
{
|
||||
}
|
||||
|
||||
ElementsBufferObject::ElementsBufferObject(const ElementsBufferObject& vbo,const CopyOp& copyop):
|
||||
BufferObject(vbo,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
ElementsBufferObject::~ElementsBufferObject()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int ElementsBufferObject::addDrawElements(osg::DrawElements* DrawElements)
|
||||
{
|
||||
unsigned int i = _bufferEntryDrawElementsPairs.size();
|
||||
_bufferEntryDrawElementsPairs.resize(i+1);
|
||||
_bufferEntryDrawElementsPairs[i].second = DrawElements;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void ElementsBufferObject::setDrawElements(unsigned int i, DrawElements* DrawElements)
|
||||
{
|
||||
if (i+1>=_bufferEntryDrawElementsPairs.size()) _bufferEntryDrawElementsPairs.resize(i+1);
|
||||
|
||||
_bufferEntryDrawElementsPairs[i].second = DrawElements;
|
||||
}
|
||||
|
||||
bool ElementsBufferObject::needsCompile(unsigned int contextID) const
|
||||
{
|
||||
}
|
||||
|
||||
void ElementsBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// PixelBufferObject
|
||||
//
|
||||
PixelBufferObject::PixelBufferObject(osg::Image* image):
|
||||
BufferObject()
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Array>
|
||||
#include <osg/BufferObject>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Object>
|
||||
#include <osg/Vec2>
|
||||
@@ -153,6 +154,31 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
__unsigned_int__getModifiedCount,
|
||||
"Get modified count value. ",
|
||||
"");
|
||||
I_Method1(void, setVertexBufferObject, IN, osg::VertexBufferObject *, vbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setVertexBufferObject__osg_VertexBufferObject_P1,
|
||||
"Set the VertexBufferObject. ",
|
||||
"");
|
||||
I_Method0(osg::VertexBufferObject *, getVertexBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__osg_VertexBufferObject_P1__getVertexBufferObject,
|
||||
"Get the VertexBufferObject. ",
|
||||
"If no VBO is assigned returns NULL ");
|
||||
I_Method0(const osg::VertexBufferObject *, getVertexBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_osg_VertexBufferObject_P1__getVertexBufferObject,
|
||||
"Get the const VertexBufferObject. ",
|
||||
"If no VBO is assigned returns NULL ");
|
||||
I_Method1(void, setVertexBufferObjectIndex, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setVertexBufferObjectIndex__unsigned_int,
|
||||
"Set the index into the VertexBufferObject, if used. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getVertexBufferObjectIndex,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getVertexBufferObjectIndex,
|
||||
"Get the index into the VertexBufferObject, if used. ",
|
||||
"");
|
||||
I_SimpleProperty(const GLvoid *, DataPointer,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
0);
|
||||
@@ -171,6 +197,12 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
I_SimpleProperty(osg::Array::Type, Type,
|
||||
__Type__getType,
|
||||
0);
|
||||
I_SimpleProperty(osg::VertexBufferObject *, VertexBufferObject,
|
||||
__osg_VertexBufferObject_P1__getVertexBufferObject,
|
||||
__void__setVertexBufferObject__osg_VertexBufferObject_P1);
|
||||
I_SimpleProperty(unsigned int, VertexBufferObjectIndex,
|
||||
__unsigned_int__getVertexBufferObjectIndex,
|
||||
__void__setVertexBufferObjectIndex__unsigned_int);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::ArrayVisitor)
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/Array>
|
||||
#include <osg/BufferObject>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Image>
|
||||
#include <osg/Object>
|
||||
#include <osg/PrimitiveSet>
|
||||
#include <osg/State>
|
||||
|
||||
// Must undefine IN and OUT macros defined in Windows headers
|
||||
@@ -217,6 +219,80 @@ BEGIN_OBJECT_REFLECTOR(osg::BufferObject::Extensions)
|
||||
|
||||
|
||||
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::pair< osg::BufferObject::BufferEntry COMMA osg::DrawElements * >, osg::ElementsBufferObject::BufferEntryDrawElementstPair)
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::ElementsBufferObject::BufferEntryDrawElementstPair >, osg::ElementsBufferObject::BufferEntryDrawElementsPairs)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::ElementsBufferObject)
|
||||
I_BaseType(osg::BufferObject);
|
||||
I_Constructor0(____ElementsBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::ElementsBufferObject &, pbo, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____ElementsBufferObject__C5_ElementsBufferObject_R1__C5_CopyOp_R1,
|
||||
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
|
||||
"");
|
||||
I_Method0(osg::Object *, cloneType,
|
||||
Properties::VIRTUAL,
|
||||
__osg_Object_P1__cloneType,
|
||||
"Clone the type of an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
|
||||
Properties::VIRTUAL,
|
||||
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
|
||||
"Clone an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
|
||||
Properties::VIRTUAL,
|
||||
__bool__isSameKindAs__C5_osg_Object_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const char *, libraryName,
|
||||
Properties::VIRTUAL,
|
||||
__C5_char_P1__libraryName,
|
||||
"return the name of the object's library. ",
|
||||
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
|
||||
I_Method0(const char *, className,
|
||||
Properties::VIRTUAL,
|
||||
__C5_char_P1__className,
|
||||
"return the name of the object's class type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(unsigned int, addDrawElements, IN, osg::DrawElements *, PrimitiveSet,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__addDrawElements__osg_DrawElements_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, setDrawElements, IN, unsigned int, i, IN, osg::DrawElements *, PrimitiveSet,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setDrawElements__unsigned_int__DrawElements_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::DrawElements *, getDrawElements, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__DrawElements_P1__getDrawElements__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const osg::DrawElements *, getDrawElements, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_DrawElements_P1__getDrawElements__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(bool, needsCompile, IN, unsigned int, contextID,
|
||||
Properties::VIRTUAL,
|
||||
__bool__needsCompile__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_IndexedProperty(osg::DrawElements *, DrawElements,
|
||||
__DrawElements_P1__getDrawElements__unsigned_int,
|
||||
__void__setDrawElements__unsigned_int__DrawElements_P1,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::pair< osg::BufferObject::BufferEntry COMMA osg::Image * >, osg::PixelBufferObject::BufferEntryImagePair)
|
||||
@@ -292,5 +368,87 @@ BEGIN_OBJECT_REFLECTOR(osg::PixelBufferObject)
|
||||
__void__setImage__osg_Image_P1);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::pair< osg::BufferObject::BufferEntry COMMA osg::Array * >, osg::VertexBufferObject::BufferEntryArrayPair)
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::VertexBufferObject::BufferEntryArrayPair >, osg::VertexBufferObject::BufferEntryArrayPairs)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::VertexBufferObject)
|
||||
I_BaseType(osg::BufferObject);
|
||||
I_Constructor0(____VertexBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::VertexBufferObject &, vbo, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____VertexBufferObject__C5_VertexBufferObject_R1__C5_CopyOp_R1,
|
||||
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
|
||||
"");
|
||||
I_Method0(osg::Object *, cloneType,
|
||||
Properties::VIRTUAL,
|
||||
__osg_Object_P1__cloneType,
|
||||
"Clone the type of an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(osg::Object *, clone, IN, const osg::CopyOp &, copyop,
|
||||
Properties::VIRTUAL,
|
||||
__osg_Object_P1__clone__C5_osg_CopyOp_R1,
|
||||
"Clone an object, with Object* return type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
|
||||
Properties::VIRTUAL,
|
||||
__bool__isSameKindAs__C5_osg_Object_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const char *, libraryName,
|
||||
Properties::VIRTUAL,
|
||||
__C5_char_P1__libraryName,
|
||||
"return the name of the object's library. ",
|
||||
"Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name. ");
|
||||
I_Method0(const char *, className,
|
||||
Properties::VIRTUAL,
|
||||
__C5_char_P1__className,
|
||||
"return the name of the object's class type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(unsigned int, addArray, IN, osg::Array *, array,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__addArray__osg_Array_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, setArray, IN, unsigned int, i, IN, osg::Array *, array,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setArray__unsigned_int__Array_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::Array *, getArray, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__Array_P1__getArray__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const osg::Array *, getArray, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_Array_P1__getArray__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(bool, needsCompile, IN, unsigned int, contextID,
|
||||
Properties::VIRTUAL,
|
||||
__bool__needsCompile__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_IndexedProperty(osg::Array *, Array,
|
||||
__Array_P1__getArray__unsigned_int,
|
||||
__void__setArray__unsigned_int__Array_P1,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
STD_PAIR_REFLECTOR(std::pair< osg::BufferObject::BufferEntry COMMA osg::Array * >)
|
||||
|
||||
STD_PAIR_REFLECTOR(std::pair< osg::BufferObject::BufferEntry COMMA osg::DrawElements * >)
|
||||
|
||||
STD_PAIR_REFLECTOR(std::pair< osg::BufferObject::BufferEntry COMMA osg::Image * >)
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::ElementsBufferObject::BufferEntryDrawElementstPair >)
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::VertexBufferObject::BufferEntryArrayPair >)
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <osgIntrospection/StaticMethodInfo>
|
||||
#include <osgIntrospection/Attributes>
|
||||
|
||||
#include <osg/BufferObject>
|
||||
#include <osg/CopyOp>
|
||||
#include <osg/Object>
|
||||
#include <osg/PrimitiveSet>
|
||||
@@ -230,10 +231,53 @@ BEGIN_OBJECT_REFLECTOR(osg::DrawArrays)
|
||||
__void__setFirst__GLint);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::DrawElements)
|
||||
I_BaseType(osg::PrimitiveSet);
|
||||
I_ConstructorWithDefaults2(IN, osg::PrimitiveSet::Type, primType, osg::PrimitiveSet::PrimitiveType, IN, GLenum, mode, 0,
|
||||
____DrawElements__Type__GLenum,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::DrawElements &, copy, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____DrawElements__C5_DrawElements_R1__C5_CopyOp_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setElementsBufferObject, IN, osg::ElementsBufferObject *, ebo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setElementsBufferObject__osg_ElementsBufferObject_P1,
|
||||
"Set the ElementsBufferObject. ",
|
||||
"");
|
||||
I_Method0(osg::ElementsBufferObject *, getElementsBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__osg_ElementsBufferObject_P1__getElementsBufferObject,
|
||||
"Get the ElementsBufferObject. ",
|
||||
"If no EBO is assigned returns NULL ");
|
||||
I_Method0(const osg::ElementsBufferObject *, getElementsBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_osg_ElementsBufferObject_P1__getElementsBufferObject,
|
||||
"Get the const ElementsBufferObject. ",
|
||||
"If no EBO is assigned returns NULL ");
|
||||
I_Method1(void, setElementsBufferObjectIndex, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setElementsBufferObjectIndex__unsigned_int,
|
||||
"Set the index into the ElementsBufferObject, if used. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getElementsBufferObjectIndex,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getElementsBufferObjectIndex,
|
||||
"Get the index into the ElementsBufferObject, if used. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::ElementsBufferObject *, ElementsBufferObject,
|
||||
__osg_ElementsBufferObject_P1__getElementsBufferObject,
|
||||
__void__setElementsBufferObject__osg_ElementsBufferObject_P1);
|
||||
I_SimpleProperty(unsigned int, ElementsBufferObjectIndex,
|
||||
__unsigned_int__getElementsBufferObjectIndex,
|
||||
__void__setElementsBufferObjectIndex__unsigned_int);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(osg::VectorGLubyte, osg::DrawElementsUByte::vector_type)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUByte)
|
||||
I_BaseType(osg::PrimitiveSet);
|
||||
I_BaseType(osg::DrawElements);
|
||||
I_BaseType(osg::VectorGLubyte);
|
||||
I_ConstructorWithDefaults1(IN, GLenum, mode, 0,
|
||||
Properties::NON_EXPLICIT,
|
||||
@@ -348,7 +392,7 @@ END_REFLECTOR
|
||||
TYPE_NAME_ALIAS(osg::VectorGLuint, osg::DrawElementsUInt::vector_type)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUInt)
|
||||
I_BaseType(osg::PrimitiveSet);
|
||||
I_BaseType(osg::DrawElements);
|
||||
I_BaseType(osg::VectorGLuint);
|
||||
I_ConstructorWithDefaults1(IN, GLenum, mode, 0,
|
||||
Properties::NON_EXPLICIT,
|
||||
@@ -463,7 +507,7 @@ END_REFLECTOR
|
||||
TYPE_NAME_ALIAS(osg::VectorGLushort, osg::DrawElementsUShort::vector_type)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::DrawElementsUShort)
|
||||
I_BaseType(osg::PrimitiveSet);
|
||||
I_BaseType(osg::DrawElements);
|
||||
I_BaseType(osg::VectorGLushort);
|
||||
I_ConstructorWithDefaults1(IN, GLenum, mode, 0,
|
||||
Properties::NON_EXPLICIT,
|
||||
|
||||
Reference in New Issue
Block a user