Added serializers for BufferObject and BufferData

This commit is contained in:
Robert Osfield
2017-03-27 20:02:33 +01:00
parent 11b3424984
commit 70e7cb886b
5 changed files with 66 additions and 2 deletions

View File

@@ -34,8 +34,14 @@ struct ResizeArray : public osgDB::MethodObject
REGISTER_OBJECT_WRAPPER( Array,
0,
osg::Array,
"osg::Object osg::Array" )
"osg::Object osg::BufferData osg::Array" )
{
{
UPDATE_TO_VERSION_SCOPED( 147 )
ADDED_ASSOCIATE("osg::BufferData")
}
#if 0
BEGIN_ENUM_SERIALIZER_NO_SET( Type, ArrayType );
ADD_ENUM_VALUE( ArrayType );
@@ -114,8 +120,12 @@ REGISTER_OBJECT_WRAPPER( Array,
#define ARRAY_WRAPPERS( ARRAY, ELEMENTTYPE, NUMELEMENTSONROW ) \
namespace Wrappers##ARRAY { \
REGISTER_OBJECT_WRAPPER( ARRAY, new osg::ARRAY, osg::ARRAY, "osg::Object osg::Array osg::"#ARRAY) \
REGISTER_OBJECT_WRAPPER( ARRAY, new osg::ARRAY, osg::ARRAY, "osg::Object osg::BufferData osg::Array osg::"#ARRAY) \
{ \
{\
UPDATE_TO_VERSION_SCOPED( 147 )\
ADDED_ASSOCIATE("osg::BufferData")\
}\
ADD_ISAVECTOR_SERIALIZER( vector, osgDB::BaseSerializer::ELEMENTTYPE, NUMELEMENTSONROW ); \
} \
}

View File

@@ -0,0 +1,17 @@
#include <osg/BufferObject>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( BufferData,
0,
osg::BufferData,
"osg::Object osg::BufferData" )
{
{
UPDATE_TO_VERSION_SCOPED( 147 )
ADD_OBJECT_SERIALIZER(BufferObject, osg::BufferObject, NULL);
}
}

View File

@@ -0,0 +1,14 @@
#include <osg/BufferObject>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( BufferObject,
/*new osg::BufferObject*/NULL,
osg::BufferObject,
"osg::Object osg::BufferObject" )
{
ADD_GLENUM_SERIALIZER( Target,GLenum, GL_ARRAY_BUFFER_ARB); // _type
ADD_GLENUM_SERIALIZER( Usage,GLenum, GL_STATIC_DRAW_ARB); // _type setTarget(GL_ARRAY_BUFFER_ARB);
ADD_BOOL_SERIALIZER( CopyDataAndReleaseGLBufferObject, false);
}

View File

@@ -0,0 +1,12 @@
#include <osg/BufferObject>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( ElementBufferObject,
new osg::ElementBufferObject,
osg::ElementBufferObject,
"osg::Object osg::BufferObject osg::ElementBufferObject" )
{
}

View File

@@ -0,0 +1,11 @@
#include <osg/BufferObject>
#include <osgDB/ObjectWrapper>
#include <osgDB/InputStream>
#include <osgDB/OutputStream>
REGISTER_OBJECT_WRAPPER( VertexBufferObject,
new osg::VertexBufferObject,
osg::VertexBufferObject,
"osg::Object osg::BufferObject osg::VertexBufferObject" )
{
}