Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects
This commit is contained in:
@@ -37,7 +37,185 @@ typedef osg::buffered_object<BufferObjectMap> DeletedBufferObjectCache;
|
||||
static OpenThreads::Mutex s_mutex_deletedBufferObjectCache;
|
||||
static DeletedBufferObjectCache s_deletedBufferObjectCache;
|
||||
|
||||
void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// GLBufferObject
|
||||
//
|
||||
GLBufferObject::GLBufferObject(unsigned int contextID, BufferObject* bufferObject):
|
||||
_contextID(contextID),
|
||||
_glObjectID(0),
|
||||
_target(0),
|
||||
_usage(0),
|
||||
_dirty(true),
|
||||
_totalSize(0),
|
||||
_bufferObject(0),
|
||||
_extensions(0)
|
||||
{
|
||||
assign(bufferObject);
|
||||
_extensions = GLBufferObject::getExtensions(contextID, true);
|
||||
_extensions->glGenBuffers(1, &_glObjectID);
|
||||
}
|
||||
|
||||
GLBufferObject::~GLBufferObject()
|
||||
{
|
||||
if (_glObjectID!=0) GLBufferObject::deleteBufferObject(_contextID, _glObjectID);
|
||||
|
||||
}
|
||||
|
||||
void GLBufferObject::assign(BufferObject* bufferObject)
|
||||
{
|
||||
_bufferObject = bufferObject;
|
||||
|
||||
if (_bufferObject)
|
||||
{
|
||||
_target = bufferObject->getTarget();
|
||||
_usage = bufferObject->getUsage();
|
||||
|
||||
_totalSize = 0;
|
||||
|
||||
_dirty = true;
|
||||
|
||||
_bufferEntries.clear();
|
||||
}
|
||||
else
|
||||
{
|
||||
_target = 0;
|
||||
_usage = 0;
|
||||
|
||||
_totalSize = 0;
|
||||
|
||||
// clear all previous entries;
|
||||
_bufferEntries.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void GLBufferObject::clear()
|
||||
{
|
||||
_bufferEntries.clear();
|
||||
_dirty = true;
|
||||
}
|
||||
|
||||
void GLBufferObject::compileBuffer()
|
||||
{
|
||||
_dirty = false;
|
||||
|
||||
_bufferEntries.reserve(_bufferObject->getNumBufferData());
|
||||
|
||||
_totalSize = 0;
|
||||
|
||||
bool compileAll = false;
|
||||
bool offsetChanged = false;
|
||||
|
||||
GLsizeiptrARB newTotalSize = 0;
|
||||
unsigned int i=0;
|
||||
for(; i<_bufferObject->getNumBufferData(); ++i)
|
||||
{
|
||||
BufferData* bd = _bufferObject->getBufferData(i);
|
||||
if (i<_bufferEntries.size())
|
||||
{
|
||||
BufferEntry& entry = _bufferEntries[i];
|
||||
if (offsetChanged ||
|
||||
entry.dataSource != bd ||
|
||||
entry.dataSize != bd->getTotalDataSize())
|
||||
{
|
||||
GLsizeiptrARB previousEndOfBufferDataMarker = GLsizeiptrARB(entry.offset) + entry.dataSize;
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) updating BufferEntry"<<std::endl;
|
||||
|
||||
|
||||
entry.offset = newTotalSize;
|
||||
entry.modifiedCount = 0xffffff;
|
||||
entry.dataSize = bd->getTotalDataSize();
|
||||
entry.dataSource = bd;
|
||||
|
||||
newTotalSize += entry.dataSize;
|
||||
if (previousEndOfBufferDataMarker==newTotalSize)
|
||||
{
|
||||
offsetChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BufferEntry entry;
|
||||
entry.offset = newTotalSize;
|
||||
entry.modifiedCount = 0xffffff;
|
||||
entry.dataSize = bd->getTotalDataSize();
|
||||
entry.dataSource = bd;
|
||||
#if 0
|
||||
osg::notify(osg::NOTICE)<<"entry"<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<" offset "<<entry.offset<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<" dataSize "<<entry.dataSize<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<" dataSource "<<entry.dataSource<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<" modifiedCount "<<entry.modifiedCount<<std::endl;
|
||||
#endif
|
||||
newTotalSize += entry.dataSize;
|
||||
|
||||
_bufferEntries.push_back(entry);
|
||||
}
|
||||
}
|
||||
|
||||
if (i<_bufferEntries.size())
|
||||
{
|
||||
// triming end of bufferEntries as the source data is has less entries than the originally held.
|
||||
_bufferEntries.erase(_bufferEntries.begin()+i, _bufferEntries.end());
|
||||
}
|
||||
|
||||
_extensions->glBindBuffer(_target, _glObjectID);
|
||||
|
||||
if (newTotalSize != _totalSize)
|
||||
{
|
||||
_totalSize = newTotalSize;
|
||||
_extensions->glBufferData(_target, _totalSize, NULL, _usage);
|
||||
}
|
||||
|
||||
char* vboMemory = 0;
|
||||
|
||||
#if 0
|
||||
vboMemory = extensions->glMapBuffer(_target, GL_WRITE_ONLY_ARB);
|
||||
#endif
|
||||
|
||||
for(BufferEntries::iterator itr = _bufferEntries.begin();
|
||||
itr != _bufferEntries.end();
|
||||
++itr)
|
||||
{
|
||||
BufferEntry& entry = *itr;
|
||||
if (compileAll || entry.modifiedCount != entry.dataSource->getModifiedCount())
|
||||
{
|
||||
// osg::notify(osg::NOTICE)<<"GLBufferObject::compileBuffer(..) downloading BufferEntry "<<&entry<<std::endl;
|
||||
entry.modifiedCount = entry.dataSource->getModifiedCount();
|
||||
|
||||
if (vboMemory)
|
||||
memcpy(vboMemory + (GLsizeiptrARB)entry.offset, entry.dataSource->getDataPointer(), entry.dataSize);
|
||||
else
|
||||
_extensions->glBufferSubData(_target, (GLintptrARB)entry.offset, (GLsizeiptrARB)entry.dataSize, entry.dataSource->getDataPointer());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// Unmap the texture image buffer
|
||||
if (vboMemory) _extensions->glUnmapBuffer(_target);
|
||||
}
|
||||
|
||||
GLBufferObject* GLBufferObject::createGLBufferObject(unsigned int contextID, const BufferObject* bufferObject)
|
||||
{
|
||||
return new GLBufferObject(contextID, const_cast<BufferObject*>(bufferObject));
|
||||
}
|
||||
|
||||
void GLBufferObject::deleteGLObject()
|
||||
{
|
||||
if (_glObjectID!=0)
|
||||
{
|
||||
_extensions->glDeleteBuffers(1, &_glObjectID);
|
||||
_glObjectID = 0;
|
||||
|
||||
_totalSize = 0;
|
||||
_bufferEntries.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GLBufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
|
||||
{
|
||||
if (globj!=0)
|
||||
{
|
||||
@@ -48,7 +226,7 @@ void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj)
|
||||
}
|
||||
}
|
||||
|
||||
void BufferObject::flushDeletedBufferObjects(unsigned int contextID,double /*currentTime*/, double& availableTime)
|
||||
void GLBufferObject::flushDeletedBufferObjects(unsigned int contextID,double /*currentTime*/, double& availableTime)
|
||||
{
|
||||
// if no time available don't try to flush objects.
|
||||
if (availableTime<=0.0) return;
|
||||
@@ -84,85 +262,38 @@ void BufferObject::flushDeletedBufferObjects(unsigned int contextID,double /*cur
|
||||
availableTime -= elapsedTime;
|
||||
}
|
||||
|
||||
void BufferObject::discardDeletedBufferObjects(unsigned int contextID)
|
||||
void GLBufferObject::discardDeletedBufferObjects(unsigned int contextID)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_mutex_deletedBufferObjectCache);
|
||||
BufferObjectMap& dll = s_deletedBufferObjectCache[contextID];
|
||||
dll.clear();
|
||||
}
|
||||
|
||||
|
||||
BufferObject::BufferObject():
|
||||
_target(0),
|
||||
_usage(0),
|
||||
_totalSize(0)
|
||||
{
|
||||
}
|
||||
|
||||
BufferObject::BufferObject(const BufferObject& bo,const CopyOp& copyop):
|
||||
Object(bo,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
BufferObject::~BufferObject()
|
||||
{
|
||||
releaseGLObjects(0);
|
||||
}
|
||||
|
||||
void BufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
_bufferObjectList.resize(maxSize);
|
||||
}
|
||||
|
||||
void BufferObject::releaseGLObjects(State* state) const
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
unsigned int contextID = state->getContextID();
|
||||
if (_bufferObjectList[contextID])
|
||||
{
|
||||
deleteBufferObject(contextID,_bufferObjectList[contextID]);
|
||||
_bufferObjectList[contextID] = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(unsigned int contextID=0;contextID<_bufferObjectList.size();++contextID)
|
||||
{
|
||||
if (_bufferObjectList[contextID])
|
||||
{
|
||||
deleteBufferObject(contextID,_bufferObjectList[contextID]);
|
||||
_bufferObjectList[contextID] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Extension support
|
||||
//
|
||||
|
||||
typedef buffered_value< ref_ptr<BufferObject::Extensions> > BufferedExtensions;
|
||||
typedef buffered_value< ref_ptr<GLBufferObject::Extensions> > BufferedExtensions;
|
||||
static BufferedExtensions s_extensions;
|
||||
|
||||
BufferObject::Extensions* BufferObject::getExtensions(unsigned int contextID,bool createIfNotInitalized)
|
||||
GLBufferObject::Extensions* GLBufferObject::getExtensions(unsigned int contextID,bool createIfNotInitalized)
|
||||
{
|
||||
if (!s_extensions[contextID] && createIfNotInitalized) s_extensions[contextID] = new BufferObject::Extensions(contextID);
|
||||
if (!s_extensions[contextID] && createIfNotInitalized) s_extensions[contextID] = new GLBufferObject::Extensions(contextID);
|
||||
return s_extensions[contextID].get();
|
||||
}
|
||||
|
||||
void BufferObject::setExtensions(unsigned int contextID,Extensions* extensions)
|
||||
void GLBufferObject::setExtensions(unsigned int contextID,Extensions* extensions)
|
||||
{
|
||||
s_extensions[contextID] = extensions;
|
||||
}
|
||||
|
||||
BufferObject::Extensions::Extensions(unsigned int contextID)
|
||||
GLBufferObject::Extensions::Extensions(unsigned int contextID)
|
||||
{
|
||||
setupGLExtensions(contextID);
|
||||
}
|
||||
|
||||
BufferObject::Extensions::Extensions(const Extensions& rhs):
|
||||
GLBufferObject::Extensions::Extensions(const Extensions& rhs):
|
||||
Referenced()
|
||||
{
|
||||
_glGenBuffers = rhs._glGenBuffers;
|
||||
@@ -179,7 +310,7 @@ BufferObject::Extensions::Extensions(const Extensions& rhs):
|
||||
}
|
||||
|
||||
|
||||
void BufferObject::Extensions::lowestCommonDenominator(const Extensions& rhs)
|
||||
void GLBufferObject::Extensions::lowestCommonDenominator(const Extensions& rhs)
|
||||
{
|
||||
if (!rhs._glGenBuffers) _glGenBuffers = rhs._glGenBuffers;
|
||||
if (!rhs._glBindBuffer) _glBindBuffer = rhs._glBindBuffer;
|
||||
@@ -194,7 +325,7 @@ void BufferObject::Extensions::lowestCommonDenominator(const Extensions& rhs)
|
||||
if (!rhs._glGetBufferParameteriv) _glGetBufferPointerv = rhs._glGetBufferPointerv;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::setupGLExtensions(unsigned int contextID)
|
||||
void GLBufferObject::Extensions::setupGLExtensions(unsigned int contextID)
|
||||
{
|
||||
setGLExtensionFuncPtr(_glGenBuffers, "glGenBuffers","glGenBuffersARB");
|
||||
setGLExtensionFuncPtr(_glBindBuffer, "glBindBuffer","glBindBufferARB");
|
||||
@@ -210,37 +341,37 @@ void BufferObject::Extensions::setupGLExtensions(unsigned int contextID)
|
||||
_isPBOSupported = osg::isGLExtensionSupported(contextID,"GL_ARB_pixel_buffer_object");
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glGenBuffers(GLsizei n, GLuint *buffers) const
|
||||
void GLBufferObject::Extensions::glGenBuffers(GLsizei n, GLuint *buffers) const
|
||||
{
|
||||
if (_glGenBuffers) _glGenBuffers(n, buffers);
|
||||
else notify(WARN)<<"Error: glGenBuffers not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glBindBuffer(GLenum target, GLuint buffer) const
|
||||
void GLBufferObject::Extensions::glBindBuffer(GLenum target, GLuint buffer) const
|
||||
{
|
||||
if (_glBindBuffer) _glBindBuffer(target, buffer);
|
||||
else notify(WARN)<<"Error: glBindBuffer not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glBufferData(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) const
|
||||
void GLBufferObject::Extensions::glBufferData(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) const
|
||||
{
|
||||
if (_glBufferData) _glBufferData(target, size, data, usage);
|
||||
else notify(WARN)<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) const
|
||||
void GLBufferObject::Extensions::glBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) const
|
||||
{
|
||||
if (_glBufferSubData) _glBufferSubData(target, offset, size, data);
|
||||
else notify(WARN)<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glDeleteBuffers(GLsizei n, const GLuint *buffers) const
|
||||
void GLBufferObject::Extensions::glDeleteBuffers(GLsizei n, const GLuint *buffers) const
|
||||
{
|
||||
if (_glDeleteBuffers) _glDeleteBuffers(n, buffers);
|
||||
else notify(WARN)<<"Error: glBufferData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
GLboolean BufferObject::Extensions::glIsBuffer (GLuint buffer) const
|
||||
GLboolean GLBufferObject::Extensions::glIsBuffer (GLuint buffer) const
|
||||
{
|
||||
if (_glIsBuffer) return _glIsBuffer(buffer);
|
||||
else
|
||||
@@ -250,13 +381,13 @@ GLboolean BufferObject::Extensions::glIsBuffer (GLuint buffer) const
|
||||
}
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glGetBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data) const
|
||||
void GLBufferObject::Extensions::glGetBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data) const
|
||||
{
|
||||
if (_glGetBufferSubData) _glGetBufferSubData(target,offset,size,data);
|
||||
else notify(WARN)<<"Error: glGetBufferSubData not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
GLvoid* BufferObject::Extensions::glMapBuffer (GLenum target, GLenum access) const
|
||||
GLvoid* GLBufferObject::Extensions::glMapBuffer (GLenum target, GLenum access) const
|
||||
{
|
||||
if (_glMapBuffer) return _glMapBuffer(target,access);
|
||||
else
|
||||
@@ -266,7 +397,7 @@ GLvoid* BufferObject::Extensions::glMapBuffer (GLenum target, GLenum access) con
|
||||
}
|
||||
}
|
||||
|
||||
GLboolean BufferObject::Extensions::glUnmapBuffer (GLenum target) const
|
||||
GLboolean GLBufferObject::Extensions::glUnmapBuffer (GLenum target) const
|
||||
{
|
||||
if (_glUnmapBuffer) return _glUnmapBuffer(target);
|
||||
else
|
||||
@@ -276,18 +407,149 @@ GLboolean BufferObject::Extensions::glUnmapBuffer (GLenum target) const
|
||||
}
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) const
|
||||
void GLBufferObject::Extensions::glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params) const
|
||||
{
|
||||
if (_glGetBufferParameteriv) _glGetBufferParameteriv(target,pname,params);
|
||||
else notify(WARN)<<"Error: glGetBufferParameteriv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
void BufferObject::Extensions::glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params) const
|
||||
void GLBufferObject::Extensions::glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params) const
|
||||
{
|
||||
if (_glGetBufferPointerv) _glGetBufferPointerv(target,pname,params);
|
||||
else notify(WARN)<<"Error: glGetBufferPointerv not supported by OpenGL driver"<<std::endl;
|
||||
}
|
||||
|
||||
#if 1
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BufferObject
|
||||
//
|
||||
BufferObject::BufferObject():
|
||||
_target(0),
|
||||
_usage(0)
|
||||
{
|
||||
}
|
||||
|
||||
BufferObject::BufferObject(const BufferObject& bo,const CopyOp& copyop):
|
||||
Object(bo,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
BufferObject::~BufferObject()
|
||||
{
|
||||
releaseGLObjects(0);
|
||||
}
|
||||
|
||||
void BufferObject::setBufferData(unsigned int index, BufferData* bd)
|
||||
{
|
||||
if (index>=_bufferDataList.size()) _bufferDataList.resize(index+1);
|
||||
_bufferDataList[index] = bd;
|
||||
}
|
||||
|
||||
void BufferObject::dirty()
|
||||
{
|
||||
for(unsigned int i=0; i<_glBufferObjects.size(); ++i)
|
||||
{
|
||||
if (_glBufferObjects[i].valid()) _glBufferObjects[i]->dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void BufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
_glBufferObjects.resize(maxSize);
|
||||
}
|
||||
|
||||
void BufferObject::releaseGLObjects(State* state) const
|
||||
{
|
||||
if (state)
|
||||
{
|
||||
_glBufferObjects[state->getContextID()] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_glBufferObjects.clear();
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int BufferObject::addBufferData(BufferData* bd)
|
||||
{
|
||||
if (!bd) return 0;
|
||||
|
||||
// check to see if bd exists in BufferObject already, is so return without doing anything
|
||||
for(BufferDataList::iterator itr = _bufferDataList.begin();
|
||||
itr != _bufferDataList.end();
|
||||
++itr)
|
||||
{
|
||||
if (*itr == bd) return bd->getBufferIndex();
|
||||
}
|
||||
|
||||
// bd->setBufferIndex(_bufferDataList.size());
|
||||
|
||||
_bufferDataList.push_back(bd);
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"BufferObject "<<this<<":"<<className()<<"::addBufferData("<<bd<<"), bufferIndex= "<<_bufferDataList.size()-1<<std::endl;
|
||||
|
||||
return _bufferDataList.size()-1;
|
||||
}
|
||||
|
||||
void BufferObject::removeBufferData(unsigned int index)
|
||||
{
|
||||
if (index>=_bufferDataList.size())
|
||||
{
|
||||
osg::notify(osg::WARN)<<"Error "<<className()<<"::removeBufferData("<<index<<") out of range."<<std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// osg::notify(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<index<<"), size= "<<_bufferDataList.size()<<std::endl;
|
||||
|
||||
// alter the indices of the BufferData after the entry to be removed so their indices are correctly placed.
|
||||
for(unsigned int i=index+1; i<_bufferDataList.size(); ++i)
|
||||
{
|
||||
_bufferDataList[i]->setBufferIndex(i-1);
|
||||
}
|
||||
|
||||
// remove the entry
|
||||
_bufferDataList.erase(_bufferDataList.begin() + index);
|
||||
|
||||
for(unsigned int i=0; i<_glBufferObjects.size(); ++i)
|
||||
{
|
||||
if (_glBufferObjects[i].valid()) _glBufferObjects[i]->clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void BufferObject::removeBufferData(BufferData* bd)
|
||||
{
|
||||
// osg::notify(osg::NOTICE)<<"BufferObject::"<<this<<":"<<className()<<"::removeBufferData("<<bd<<"), index="<<bd->getBufferIndex()<<" size= "<<_bufferDataList.size()<<std::endl;
|
||||
|
||||
if (!bd || bd->getBufferObject()!=this) return;
|
||||
|
||||
removeBufferData(bd->getBufferIndex());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BufferData
|
||||
//
|
||||
BufferData::~BufferData()
|
||||
{
|
||||
setBufferObject(0);
|
||||
}
|
||||
|
||||
void BufferData::setBufferObject(BufferObject* bufferObject)
|
||||
{
|
||||
if (_bufferObject==bufferObject) return;
|
||||
|
||||
if (_bufferObject.valid())
|
||||
{
|
||||
_bufferObject->removeBufferData(_bufferIndex);
|
||||
}
|
||||
|
||||
_bufferObject = bufferObject;
|
||||
_bufferIndex = _bufferObject.valid() ? _bufferObject->addBufferData(this) : 0;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// VertexBufferObject
|
||||
@@ -311,40 +573,29 @@ VertexBufferObject::~VertexBufferObject()
|
||||
|
||||
unsigned int VertexBufferObject::addArray(osg::Array* array)
|
||||
{
|
||||
unsigned int i = _bufferEntryArrayPairs.size();
|
||||
|
||||
_bufferEntryArrayPairs.resize(i+1);
|
||||
_bufferEntryArrayPairs[i].second = array;
|
||||
_bufferEntryArrayPairs[i].first.modifiedCount.setAllElementsTo(0xffffffff);
|
||||
_bufferEntryArrayPairs[i].first.offset = 0;
|
||||
|
||||
dirty();
|
||||
|
||||
return i;
|
||||
return addBufferData(array);
|
||||
}
|
||||
|
||||
void VertexBufferObject::removeArray(osg::Array* array)
|
||||
{
|
||||
BufferEntryArrayPairs::iterator itr;
|
||||
for(itr = _bufferEntryArrayPairs.begin();
|
||||
itr != _bufferEntryArrayPairs.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->second == array) break;
|
||||
}
|
||||
if (itr != _bufferEntryArrayPairs.end()) _bufferEntryArrayPairs.erase(itr);
|
||||
removeBufferData(array);
|
||||
}
|
||||
|
||||
void VertexBufferObject::setArray(unsigned int i, Array* array)
|
||||
{
|
||||
if (i+1>=_bufferEntryArrayPairs.size()) _bufferEntryArrayPairs.resize(i+1);
|
||||
|
||||
_bufferEntryArrayPairs[i].second = array;
|
||||
_bufferEntryArrayPairs[i].first.modifiedCount.setAllElementsTo(0xffffffff);
|
||||
_bufferEntryArrayPairs[i].first.offset = 0;
|
||||
|
||||
dirty();
|
||||
setBufferData(i,array);
|
||||
}
|
||||
|
||||
Array* VertexBufferObject::getArray(unsigned int i)
|
||||
{
|
||||
return dynamic_cast<osg::Array*>(getBufferData(i));
|
||||
}
|
||||
|
||||
const Array* VertexBufferObject::getArray(unsigned int i) const
|
||||
{
|
||||
return dynamic_cast<const osg::Array*>(getBufferData(i));
|
||||
}
|
||||
#if 0
|
||||
void VertexBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
@@ -514,18 +765,7 @@ void VertexBufferObject::compileBuffer(State& state) const
|
||||
// osg::notify(osg::NOTICE)<<"pbo _totalSize="<<_totalSize<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"pbo "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
}
|
||||
|
||||
void VertexBufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
BufferObject::resizeGLObjectBuffers(maxSize);
|
||||
|
||||
for(BufferEntryArrayPairs::iterator itr = _bufferEntryArrayPairs.begin();
|
||||
itr != _bufferEntryArrayPairs.end();
|
||||
++itr)
|
||||
{
|
||||
itr->first.modifiedCount.resize(maxSize);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -548,36 +788,31 @@ ElementBufferObject::~ElementBufferObject()
|
||||
|
||||
unsigned int ElementBufferObject::addDrawElements(osg::DrawElements* drawElements)
|
||||
{
|
||||
unsigned int i = _bufferEntryDrawElementsPairs.size();
|
||||
_bufferEntryDrawElementsPairs.resize(i+1);
|
||||
_bufferEntryDrawElementsPairs[i].second = drawElements;
|
||||
_bufferEntryDrawElementsPairs[i].first.modifiedCount.setAllElementsTo(0xffffffff);
|
||||
_bufferEntryDrawElementsPairs[i].first.dataSize = 0;
|
||||
|
||||
return i;
|
||||
return addBufferData(drawElements);
|
||||
}
|
||||
|
||||
void ElementBufferObject::removeDrawElements(osg::DrawElements* drawElements)
|
||||
{
|
||||
BufferEntryDrawElementsPairs::iterator itr;
|
||||
for(itr = _bufferEntryDrawElementsPairs.begin();
|
||||
itr != _bufferEntryDrawElementsPairs.end();
|
||||
++itr)
|
||||
{
|
||||
if (itr->second == drawElements) break;
|
||||
}
|
||||
if (itr != _bufferEntryDrawElementsPairs.end()) _bufferEntryDrawElementsPairs.erase(itr);
|
||||
removeBufferData(drawElements);
|
||||
}
|
||||
|
||||
void ElementBufferObject::setDrawElements(unsigned int i, DrawElements* drawElements)
|
||||
{
|
||||
if (i+1>=_bufferEntryDrawElementsPairs.size()) _bufferEntryDrawElementsPairs.resize(i+1);
|
||||
|
||||
_bufferEntryDrawElementsPairs[i].second = drawElements;
|
||||
_bufferEntryDrawElementsPairs[i].first.modifiedCount.setAllElementsTo(0xffffffff);
|
||||
_bufferEntryDrawElementsPairs[i].first.dataSize = 0;
|
||||
setBufferData(i,drawElements);
|
||||
}
|
||||
|
||||
DrawElements* ElementBufferObject::getDrawElements(unsigned int i)
|
||||
{
|
||||
return dynamic_cast<DrawElements*>(getBufferData(i));
|
||||
}
|
||||
|
||||
const DrawElements* ElementBufferObject::getDrawElements(unsigned int i) const
|
||||
{
|
||||
return dynamic_cast<const DrawElements*>(getBufferData(i));
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void ElementBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
@@ -681,18 +916,7 @@ void ElementBufferObject::compileBuffer(State& state) const
|
||||
// osg::notify(osg::NOTICE)<<"pbo _totalSize="<<_totalSize<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"pbo "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
}
|
||||
|
||||
void ElementBufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
BufferObject::resizeGLObjectBuffers(maxSize);
|
||||
|
||||
for(BufferEntryDrawElementsPairs::iterator itr = _bufferEntryDrawElementsPairs.begin();
|
||||
itr != _bufferEntryDrawElementsPairs.end();
|
||||
++itr)
|
||||
{
|
||||
itr->first.modifiedCount.resize(maxSize);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -703,13 +927,14 @@ PixelBufferObject::PixelBufferObject(osg::Image* image):
|
||||
{
|
||||
_target = GL_PIXEL_UNPACK_BUFFER_ARB;
|
||||
_usage = GL_STREAM_DRAW_ARB;
|
||||
_bufferEntryImagePair.second = image;
|
||||
|
||||
osg::notify(osg::NOTICE)<<"Constructing PixelBufferObject for image="<<image<<std::endl;
|
||||
|
||||
setBufferData(0, image);
|
||||
}
|
||||
|
||||
/** Copy constructor using CopyOp to manage deep vs shallow copy.*/
|
||||
PixelBufferObject::PixelBufferObject(const PixelBufferObject& buffer,const CopyOp& copyop):
|
||||
BufferObject(buffer,copyop),
|
||||
_bufferEntryImagePair(buffer._bufferEntryImagePair)
|
||||
BufferObject(buffer,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -719,12 +944,20 @@ PixelBufferObject::~PixelBufferObject()
|
||||
|
||||
void PixelBufferObject::setImage(osg::Image* image)
|
||||
{
|
||||
if (_bufferEntryImagePair.second == image) return;
|
||||
|
||||
_bufferEntryImagePair.second = image;
|
||||
|
||||
dirty();
|
||||
setBufferData(0, image);
|
||||
}
|
||||
|
||||
Image* PixelBufferObject::getImage()
|
||||
{
|
||||
return dynamic_cast<Image*>(getBufferData(0));
|
||||
}
|
||||
|
||||
const Image* PixelBufferObject::getImage() const
|
||||
{
|
||||
return dynamic_cast<const Image*>(getBufferData(0));
|
||||
}
|
||||
|
||||
#if 0
|
||||
void PixelBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
@@ -781,14 +1014,7 @@ void PixelBufferObject::compileBuffer(State& state) const
|
||||
// osg::notify(osg::NOTICE)<<"pbo _totalSize="<<_totalSize<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"pbo "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
}
|
||||
|
||||
void PixelBufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
{
|
||||
BufferObject::resizeGLObjectBuffers(maxSize);
|
||||
|
||||
_bufferEntryImagePair.first.modifiedCount.resize(maxSize);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -799,13 +1025,11 @@ PixelDataBufferObject::PixelDataBufferObject()
|
||||
{
|
||||
_target = GL_ARRAY_BUFFER_ARB;
|
||||
_usage = GL_DYNAMIC_DRAW_ARB;
|
||||
_bufferData.dataSize = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
PixelDataBufferObject::PixelDataBufferObject(const PixelDataBufferObject& buffer,const CopyOp& copyop):
|
||||
BufferObject(buffer,copyop),
|
||||
_bufferData(buffer._bufferData)
|
||||
BufferObject(buffer,copyop)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -818,32 +1042,28 @@ PixelDataBufferObject::~PixelDataBufferObject()
|
||||
void PixelDataBufferObject::compileBuffer(State& state) const
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
if (!isDirty(contextID) || _bufferData.dataSize == 0) return;
|
||||
if ( _dataSize == 0) return;
|
||||
|
||||
Extensions* extensions = getExtensions(contextID,true);
|
||||
GLBufferObject* bo = getOrCreateGLBufferObject(contextID);
|
||||
if (!bo || !bo->isDirty()) return;
|
||||
|
||||
GLuint& pbo = buffer(contextID);
|
||||
if (pbo == 0)
|
||||
{
|
||||
extensions->glGenBuffers(1, &pbo);
|
||||
}
|
||||
|
||||
extensions->glBindBuffer(_target, pbo);
|
||||
extensions->glBufferData(_target, _bufferData.dataSize, NULL, _usage);
|
||||
extensions->glBindBuffer(_target, 0);
|
||||
|
||||
_compiledList[contextID] = 1;
|
||||
bo->_extensions->glBindBuffer(_target, bo->getGLObjectID());
|
||||
bo->_extensions->glBufferData(_target, _dataSize, NULL, _usage);
|
||||
bo->_extensions->glBindBuffer(_target, 0);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
void PixelDataBufferObject::bindBufferInReadMode(State& state)
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
if (isDirty(contextID)) compileBuffer(state);
|
||||
|
||||
Extensions* extensions = getExtensions(contextID,true);
|
||||
GLBufferObject* bo = getOrCreateGLBufferObject(contextID);
|
||||
if (!bo) return;
|
||||
|
||||
if (bo->isDirty()) compileBuffer(state);
|
||||
|
||||
bo->_extensions->glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, bo->getGLObjectID());
|
||||
|
||||
extensions->glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, buffer(contextID));
|
||||
_mode[contextID] = READ;
|
||||
}
|
||||
|
||||
@@ -851,18 +1071,21 @@ void PixelDataBufferObject::bindBufferInReadMode(State& state)
|
||||
void PixelDataBufferObject::bindBufferInWriteMode(State& state)
|
||||
{
|
||||
unsigned int contextID = state.getContextID();
|
||||
if (isDirty(contextID)) compileBuffer(state);
|
||||
|
||||
Extensions* extensions = getExtensions(contextID,true);
|
||||
GLBufferObject* bo = getOrCreateGLBufferObject(contextID);
|
||||
if (!bo) return;
|
||||
|
||||
if (bo->isDirty()) compileBuffer(state);
|
||||
|
||||
bo->_extensions->glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, bo->getGLObjectID());
|
||||
|
||||
extensions->glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, buffer(contextID));
|
||||
_mode[contextID] = WRITE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------
|
||||
void PixelDataBufferObject::unbindBuffer(unsigned int contextID) const
|
||||
{
|
||||
Extensions* extensions = getExtensions(contextID,true);
|
||||
GLBufferObject::Extensions* extensions = GLBufferObject::getExtensions(contextID,true);
|
||||
|
||||
switch(_mode[contextID])
|
||||
{
|
||||
@@ -888,3 +1111,5 @@ void PixelDataBufferObject::resizeGLObjectBuffers(unsigned int maxSize)
|
||||
_mode.resize(maxSize);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
void osg::flushDeletedGLObjects(unsigned int contextID, double currentTime, double& availableTime)
|
||||
{
|
||||
osg::BufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
|
||||
osg::GLBufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
|
||||
osg::Drawable::flushDeletedDisplayLists(contextID,availableTime);
|
||||
osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
|
||||
osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
|
||||
@@ -39,7 +39,7 @@ void osg::flushAllDeletedGLObjects(unsigned int contextID)
|
||||
{
|
||||
double currentTime = DBL_MAX;
|
||||
double availableTime = DBL_MAX;
|
||||
osg::BufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
|
||||
osg::GLBufferObject::flushDeletedBufferObjects(contextID,currentTime,availableTime);
|
||||
osg::Drawable::flushAllDeletedDisplayLists(contextID);
|
||||
osg::FragmentProgram::flushDeletedFragmentProgramObjects(contextID,currentTime,availableTime);
|
||||
osg::FrameBufferObject::flushDeletedFrameBufferObjects(contextID,currentTime,availableTime);
|
||||
@@ -53,7 +53,7 @@ void osg::flushAllDeletedGLObjects(unsigned int contextID)
|
||||
|
||||
void osg::discardAllDeletedGLObjects(unsigned int contextID)
|
||||
{
|
||||
osg::BufferObject::discardDeletedBufferObjects(contextID);
|
||||
osg::GLBufferObject::discardDeletedBufferObjects(contextID);
|
||||
osg::Drawable::discardAllDeletedDisplayLists(contextID);
|
||||
osg::FragmentProgram::discardDeletedFragmentProgramObjects(contextID);
|
||||
osg::FrameBufferObject::discardDeletedFrameBufferObjects(contextID);
|
||||
|
||||
@@ -1374,6 +1374,7 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
//
|
||||
if (usingVertexBufferObjects)
|
||||
{
|
||||
// osg::notify(osg::NOTICE)<<"Geometry::drawImplementation() Using VertexBufferObjects"<<std::endl;
|
||||
|
||||
//
|
||||
// Vertex Buffer Object path for defining vertex arrays.
|
||||
@@ -1416,7 +1417,6 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
}
|
||||
}
|
||||
state.disableVertexAttribPointersAboveAndIncluding( index );
|
||||
|
||||
}
|
||||
else if (vertexVertexAttributesSupported)
|
||||
{
|
||||
@@ -1429,7 +1429,7 @@ void Geometry::drawImplementation(RenderInfo& renderInfo) const
|
||||
}
|
||||
else
|
||||
{
|
||||
//std::cout << "none VertexBuffer path"<<std::endl;
|
||||
// osg::notify(osg::NOTICE)<<"none VertexBuffer path"<<std::endl;
|
||||
|
||||
//
|
||||
// Non Vertex Buffer Object path for defining vertex arrays.
|
||||
|
||||
@@ -33,7 +33,7 @@ using namespace osg;
|
||||
using namespace std;
|
||||
|
||||
Image::Image()
|
||||
:Object(true),
|
||||
:BufferData(),
|
||||
_fileName(""),
|
||||
_writeHint(NO_PREFERENCE),
|
||||
_origin(BOTTOM_LEFT),
|
||||
@@ -44,14 +44,13 @@ Image::Image()
|
||||
_packing(4),
|
||||
_pixelAspectRatio(1.0),
|
||||
_allocationMode(USE_NEW_DELETE),
|
||||
_data(0L),
|
||||
_modifiedCount(0)
|
||||
_data(0L)
|
||||
{
|
||||
setDataVariance(STATIC);
|
||||
}
|
||||
|
||||
Image::Image(const Image& image,const CopyOp& copyop):
|
||||
Object(image,copyop),
|
||||
BufferData(image,copyop),
|
||||
_fileName(image._fileName),
|
||||
_writeHint(image._writeHint),
|
||||
_origin(image._origin),
|
||||
@@ -62,7 +61,6 @@ Image::Image(const Image& image,const CopyOp& copyop):
|
||||
_packing(image._packing),
|
||||
_pixelAspectRatio(image._pixelAspectRatio),
|
||||
_data(0L),
|
||||
_modifiedCount(image._modifiedCount),
|
||||
_mipmapData(image._mipmapData)
|
||||
{
|
||||
if (image._data)
|
||||
|
||||
@@ -126,12 +126,12 @@ void DrawElementsUByte::draw(State& state, bool useVertexBufferObjects) const
|
||||
{
|
||||
if (useVertexBufferObjects)
|
||||
{
|
||||
const ElementBufferObject* ebo = getElementBufferObject();
|
||||
GLBufferObject* ebo = getOrCreateGLBufferObject(state.getContextID());
|
||||
state.bindElementBufferObject(ebo);
|
||||
if (ebo)
|
||||
{
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_BYTE, getElementBufferObjectOffset(), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_BYTE, getElementBufferObjectOffset());
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_BYTE, (const GLvoid *)(ebo->getOffset(getBufferIndex())), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_BYTE, (const GLvoid *)(ebo->getOffset(getBufferIndex())));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -176,12 +176,12 @@ void DrawElementsUShort::draw(State& state, bool useVertexBufferObjects) const
|
||||
{
|
||||
if (useVertexBufferObjects)
|
||||
{
|
||||
const ElementBufferObject* ebo = getElementBufferObject();
|
||||
GLBufferObject* ebo = getOrCreateGLBufferObject(state.getContextID());
|
||||
state.bindElementBufferObject(ebo);
|
||||
if (ebo)
|
||||
{
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_SHORT, getElementBufferObjectOffset(), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_SHORT, getElementBufferObjectOffset());
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_SHORT, (const GLvoid *)(ebo->getOffset(getBufferIndex())), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_SHORT, (const GLvoid *)(ebo->getOffset(getBufferIndex())));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -226,12 +226,12 @@ void DrawElementsUInt::draw(State& state, bool useVertexBufferObjects) const
|
||||
{
|
||||
if (useVertexBufferObjects)
|
||||
{
|
||||
const ElementBufferObject* ebo = getElementBufferObject();
|
||||
GLBufferObject* ebo = getOrCreateGLBufferObject(state.getContextID());
|
||||
state.bindElementBufferObject(ebo);
|
||||
if (ebo)
|
||||
{
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_INT, getElementBufferObjectOffset(), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_INT, getElementBufferObjectOffset());
|
||||
if (_numInstances>=1) state.glDrawElementsInstanced(_mode, size(), GL_UNSIGNED_INT, (const GLvoid *)(ebo->getOffset(getBufferIndex())), _numInstances);
|
||||
else glDrawElements(_mode, size(), GL_UNSIGNED_INT, (const GLvoid *)(ebo->getOffset(getBufferIndex())));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#define GL_STORAGE_SHARED_APPLE 0x85BF
|
||||
#endif
|
||||
|
||||
//#define DO_TIMING
|
||||
// #define DO_TIMING
|
||||
|
||||
namespace osg {
|
||||
|
||||
@@ -1777,15 +1777,12 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
bool useHardwareMipMapGeneration = mipmappingRequired && (!image->isMipmap() && isHardwareMipmapGenerationEnabled(state));
|
||||
bool useGluBuildMipMaps = mipmappingRequired && (!useHardwareMipMapGeneration && !image->isMipmap());
|
||||
|
||||
unsigned char* dataMinusOffset = 0;
|
||||
unsigned char* dataPlusOffset = 0;
|
||||
|
||||
const PixelBufferObject* pbo = image->getPixelBufferObject();
|
||||
if (pbo && pbo->isPBOSupported(contextID) && !needImageRescale && !useGluBuildMipMaps)
|
||||
const unsigned char* dataPtr = image->data();
|
||||
GLBufferObject* pbo = image->getOrCreateGLBufferObject(contextID);
|
||||
if (pbo && !needImageRescale && !useGluBuildMipMaps)
|
||||
{
|
||||
state.bindPixelBufferObject(pbo);
|
||||
dataMinusOffset = data;
|
||||
dataPlusOffset = reinterpret_cast<unsigned char*>(pbo->offset());
|
||||
dataPtr = reinterpret_cast<const unsigned char*>(pbo->getOffset(image->getBufferIndex()));
|
||||
#ifdef DO_TIMING
|
||||
osg::notify(osg::NOTICE)<<"after PBO "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
#endif
|
||||
@@ -1808,7 +1805,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
inwidth, inheight, _borderWidth,
|
||||
(GLenum)image->getPixelFormat(),
|
||||
(GLenum)image->getDataType(),
|
||||
data -dataMinusOffset+dataPlusOffset);
|
||||
dataPtr);
|
||||
|
||||
}
|
||||
else if (extensions->isCompressedTexImage2DSupported())
|
||||
@@ -1821,7 +1818,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
extensions->glCompressedTexImage2D(target, 0, _internalFormat,
|
||||
inwidth, inheight,0,
|
||||
size,
|
||||
data-dataMinusOffset+dataPlusOffset);
|
||||
dataPtr);
|
||||
}
|
||||
|
||||
mipmapAfterTexImage(state, mipmapResult);
|
||||
@@ -1853,7 +1850,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
width, height, _borderWidth,
|
||||
(GLenum)image->getPixelFormat(),
|
||||
(GLenum)image->getDataType(),
|
||||
image->getMipmapData(k)-dataMinusOffset+dataPlusOffset);
|
||||
dataPtr + image->getMipmapOffset(k));
|
||||
|
||||
width >>= 1;
|
||||
height >>= 1;
|
||||
@@ -1874,7 +1871,7 @@ void Texture::applyTexImage2D_load(State& state, GLenum target, const Image* ima
|
||||
|
||||
extensions->glCompressedTexImage2D(target, k, _internalFormat,
|
||||
width, height, _borderWidth,
|
||||
size, image->getMipmapData(k)-dataMinusOffset+dataPlusOffset);
|
||||
size, dataPtr + image->getMipmapOffset(k));
|
||||
|
||||
width >>= 1;
|
||||
height >>= 1;
|
||||
@@ -2027,12 +2024,12 @@ void Texture::applyTexImage2D_subload(State& state, GLenum target, const Image*
|
||||
unsigned char* dataMinusOffset = 0;
|
||||
unsigned char* dataPlusOffset = 0;
|
||||
|
||||
const PixelBufferObject* pbo = image->getPixelBufferObject();
|
||||
if (pbo && pbo->isPBOSupported(contextID) && !needImageRescale && !useGluBuildMipMaps)
|
||||
const unsigned char* dataPtr = image->data();
|
||||
GLBufferObject* pbo = image->getOrCreateGLBufferObject(contextID);
|
||||
if (pbo && !needImageRescale && !useGluBuildMipMaps)
|
||||
{
|
||||
state.bindPixelBufferObject(pbo);
|
||||
dataMinusOffset = data;
|
||||
dataPlusOffset = reinterpret_cast<unsigned char*>(pbo->offset());
|
||||
dataPtr = reinterpret_cast<unsigned char*>(pbo->getOffset(image->getBufferIndex()));
|
||||
#ifdef DO_TIMING
|
||||
osg::notify(osg::NOTICE)<<"after PBO "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
|
||||
*
|
||||
* This library is open source and may be redistributed and/or modified under
|
||||
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
||||
@@ -290,19 +290,12 @@ void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& st
|
||||
#endif
|
||||
}
|
||||
|
||||
unsigned char* dataMinusOffset = 0;
|
||||
unsigned char* dataPlusOffset = 0;
|
||||
|
||||
const PixelBufferObject* pbo = image->getPixelBufferObject();
|
||||
if (pbo && pbo->isPBOSupported(contextID))
|
||||
const unsigned char* dataPtr = image->data();
|
||||
GLBufferObject* pbo = image->getOrCreateGLBufferObject(contextID);
|
||||
if (pbo)
|
||||
{
|
||||
state.bindPixelBufferObject(pbo);
|
||||
dataMinusOffset = image->data();
|
||||
dataPlusOffset = reinterpret_cast<unsigned char*>(pbo->offset());
|
||||
}
|
||||
else
|
||||
{
|
||||
pbo = 0;
|
||||
dataPtr = reinterpret_cast<unsigned char*>(pbo->getOffset(image->getBufferIndex()));
|
||||
}
|
||||
|
||||
if(isCompressedInternalFormat(_internalFormat) && extensions->isCompressedTexImage2DSupported())
|
||||
@@ -310,7 +303,7 @@ void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& st
|
||||
extensions->glCompressedTexImage2D(target, 0, _internalFormat,
|
||||
image->s(), image->t(), 0,
|
||||
image->getImageSizeInBytes(),
|
||||
image->data() - dataMinusOffset + dataPlusOffset);
|
||||
dataPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -318,7 +311,7 @@ void TextureRectangle::applyTexImage_load(GLenum target, Image* image, State& st
|
||||
image->s(), image->t(), 0,
|
||||
(GLenum)image->getPixelFormat(),
|
||||
(GLenum)image->getDataType(),
|
||||
image->data() - dataMinusOffset + dataPlusOffset );
|
||||
dataPtr );
|
||||
}
|
||||
|
||||
|
||||
@@ -365,26 +358,21 @@ void TextureRectangle::applyTexImage_subload(GLenum target, Image* image, State&
|
||||
|
||||
#ifdef DO_TIMING
|
||||
osg::Timer_t start_tick = osg::Timer::instance()->tick();
|
||||
osg::notify(osg::NOTICE)<<"glTexSubImage2D pixelFormat = "<<std::hex<<image->getPixelFormat()<<std::dec<<std::endl;
|
||||
osg::notify(osg::NOTICE)<<"TextureRectangle::apply pixelFormat = "<<std::hex<<image->getPixelFormat()<<std::dec<<std::endl;
|
||||
#endif
|
||||
unsigned char* dataMinusOffset = 0;
|
||||
unsigned char* dataPlusOffset = 0;
|
||||
|
||||
const PixelBufferObject* pbo = image->getPixelBufferObject();
|
||||
if (pbo && pbo->isPBOSupported(contextID))
|
||||
const unsigned char* dataPtr = image->data();
|
||||
GLBufferObject* pbo = image->getOrCreateGLBufferObject(contextID);
|
||||
if (pbo)
|
||||
{
|
||||
state.bindPixelBufferObject(pbo);
|
||||
dataMinusOffset = image->data();
|
||||
dataPlusOffset = reinterpret_cast<unsigned char*>(pbo->offset()); // -dataMinusOffset+dataPlusOffset
|
||||
|
||||
dataPtr = reinterpret_cast<unsigned char*>(pbo->getOffset(image->getBufferIndex()));
|
||||
#ifdef DO_TIMING
|
||||
osg::notify(osg::NOTICE)<<"after PBO "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
pbo = 0;
|
||||
osg::notify(osg::NOTICE)<<" no PixelBufferObject "<<image->getBufferObject()<<", "<<image->getPixelBufferObject()<<" pbo="<<pbo<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
@@ -395,7 +383,7 @@ void TextureRectangle::applyTexImage_subload(GLenum target, Image* image, State&
|
||||
image->s(), image->t(),
|
||||
(GLenum)image->getPixelFormat(),
|
||||
(GLenum)image->getDataType(),
|
||||
image->data() - dataMinusOffset + dataPlusOffset);
|
||||
dataPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -404,7 +392,7 @@ void TextureRectangle::applyTexImage_subload(GLenum target, Image* image, State&
|
||||
image->s(), image->t(),
|
||||
(GLenum)image->getPixelFormat(),
|
||||
(GLenum)image->getDataType(),
|
||||
image->data() - dataMinusOffset + dataPlusOffset );
|
||||
dataPtr);
|
||||
}
|
||||
|
||||
if (pbo)
|
||||
@@ -415,7 +403,6 @@ void TextureRectangle::applyTexImage_subload(GLenum target, Image* image, State&
|
||||
#ifdef DO_TIMING
|
||||
osg::notify(osg::NOTICE)<<"glTexSubImage2D "<<osg::Timer::instance()->delta_m(start_tick,osg::Timer::instance()->tick())<<"ms"<<std::endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void TextureRectangle::computeInternalFormat() const
|
||||
|
||||
@@ -33,7 +33,7 @@ void DrawElementsUByte::write(DataOutputStream* out){
|
||||
|
||||
// Write array length and its elements.
|
||||
out->writeInt(size());
|
||||
out->writeCharArray((const char*)&front(), size() * CHARSIZE);
|
||||
if (size()!=0) out->writeCharArray((const char*)&front(), size() * CHARSIZE);
|
||||
}
|
||||
|
||||
void DrawElementsUByte::read(DataInputStream* in){
|
||||
@@ -53,7 +53,7 @@ void DrawElementsUByte::read(DataInputStream* in){
|
||||
// Read array length and its elements.
|
||||
int size = in->readInt();
|
||||
resize(size);
|
||||
in->readCharArray((char*)&front(), size * CHARSIZE);
|
||||
if (size!=0) in->readCharArray((char*)&front(), size * CHARSIZE);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -34,7 +34,7 @@ void DrawElementsUInt::write(DataOutputStream* out){
|
||||
|
||||
// Write array length and its elements.
|
||||
out->writeInt(size());
|
||||
out->writeCharArray((const char*)&front(), size() * INTSIZE);
|
||||
if (size()!=0) out->writeCharArray((const char*)&front(), size() * INTSIZE);
|
||||
}
|
||||
|
||||
void DrawElementsUInt::read(DataInputStream* in)
|
||||
@@ -55,7 +55,7 @@ void DrawElementsUInt::read(DataInputStream* in)
|
||||
// Read array length and its elements.
|
||||
int size = in->readInt();
|
||||
resize(size);
|
||||
in->readCharArray((char*)&front(), size * INTSIZE);
|
||||
if (size!=0) in->readCharArray((char*)&front(), size * INTSIZE);
|
||||
|
||||
if (in->_byteswap)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ void DrawElementsUShort::write(DataOutputStream* out){
|
||||
|
||||
// Write array length and its elements.
|
||||
out->writeInt(size());
|
||||
out->writeCharArray((const char*)&front(), size() * SHORTSIZE);
|
||||
if (size()!=0) out->writeCharArray((const char*)&front(), size() * SHORTSIZE);
|
||||
}
|
||||
|
||||
void DrawElementsUShort::read(DataInputStream* in){
|
||||
|
||||
@@ -73,8 +73,8 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
|
||||
|
||||
void read();
|
||||
void readPixels();
|
||||
void singlePBO(osg::BufferObject::Extensions* ext);
|
||||
void multiPBO(osg::BufferObject::Extensions* ext);
|
||||
void singlePBO(osg::GLBufferObject::Extensions* ext);
|
||||
void multiPBO(osg::GLBufferObject::Extensions* ext);
|
||||
|
||||
typedef std::vector< osg::ref_ptr<osg::Image> > ImageBuffer;
|
||||
typedef std::vector< GLuint > PBOBuffer;
|
||||
@@ -220,7 +220,7 @@ void WindowCaptureCallback::ContextData::updateTimings(osg::Timer_t tick_start,
|
||||
|
||||
void WindowCaptureCallback::ContextData::read()
|
||||
{
|
||||
osg::BufferObject::Extensions* ext = osg::BufferObject::getExtensions(_gc->getState()->getContextID(),true);
|
||||
osg::GLBufferObject::Extensions* ext = osg::GLBufferObject::getExtensions(_gc->getState()->getContextID(),true);
|
||||
|
||||
if (ext->isPBOSupported() && !_pboBuffer.empty())
|
||||
{
|
||||
@@ -277,7 +277,7 @@ void WindowCaptureCallback::ContextData::readPixels()
|
||||
_currentPboIndex = nextPboIndex;
|
||||
}
|
||||
|
||||
void WindowCaptureCallback::ContextData::singlePBO(osg::BufferObject::Extensions* ext)
|
||||
void WindowCaptureCallback::ContextData::singlePBO(osg::GLBufferObject::Extensions* ext)
|
||||
{
|
||||
unsigned int nextImageIndex = (_currentImageIndex+1)%_imageBuffer.size();
|
||||
|
||||
@@ -352,7 +352,7 @@ void WindowCaptureCallback::ContextData::singlePBO(osg::BufferObject::Extensions
|
||||
_currentImageIndex = nextImageIndex;
|
||||
}
|
||||
|
||||
void WindowCaptureCallback::ContextData::multiPBO(osg::BufferObject::Extensions* ext)
|
||||
void WindowCaptureCallback::ContextData::multiPBO(osg::GLBufferObject::Extensions* ext)
|
||||
{
|
||||
unsigned int nextImageIndex = (_currentImageIndex+1)%_imageBuffer.size();
|
||||
unsigned int nextPboIndex = (_currentPboIndex+1)%_pboBuffer.size();
|
||||
|
||||
@@ -445,7 +445,7 @@ suppress reflector "osg::StencilTwoSided::Extensions"
|
||||
suppress reflector "osg::Texture3D::Extensions"
|
||||
suppress reflector "osg::GL2Extensions"
|
||||
suppress reflector "osg::Drawable::Extensions"
|
||||
suppress reflector "osg::BufferObject::Extensions"
|
||||
suppress reflector "osg::GLBufferObject::Extensions"
|
||||
suppress reflector "osg::FBOExtensions"
|
||||
suppress reflector "osg::Drawable::Extensions"
|
||||
suppress reflector "osg::BlendColor::Extensions"
|
||||
|
||||
@@ -64,7 +64,7 @@ END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
I_DeclaringFile("osg/Array");
|
||||
I_BaseType(osg::Object);
|
||||
I_BaseType(osg::BufferData);
|
||||
I_ConstructorWithDefaults3(IN, osg::Array::Type, arrayType, osg::Array::ArrayType, IN, GLint, dataSize, 0, IN, GLenum, dataType, 0,
|
||||
____Array__Type__GLint__GLenum,
|
||||
"",
|
||||
@@ -148,21 +148,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
__void__trim,
|
||||
"Frees unused space on this vector - i.e. ",
|
||||
"the difference between size() and max_size() of the underlying vector. ");
|
||||
I_Method0(void, dirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__dirty,
|
||||
"Dirty the primitive, which increments the modified count, to force buffer objects to update. ",
|
||||
"");
|
||||
I_Method1(void, setModifiedCount, IN, unsigned int, value,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setModifiedCount__unsigned_int,
|
||||
"Set the modified count value. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getModifiedCount,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getModifiedCount,
|
||||
"Get modified count value. ",
|
||||
"");
|
||||
I_Method1(void, setVertexBufferObject, IN, osg::VertexBufferObject *, vbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setVertexBufferObject__osg_VertexBufferObject_P1,
|
||||
@@ -178,16 +163,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
__C5_osg_VertexBufferObject_P1__getVertexBufferObject,
|
||||
"Get the const VertexBufferObject. ",
|
||||
"If no VBO is assigned returns NULL ");
|
||||
I_Method1(void, setVertexBufferObjectOffset, IN, const GLvoid *, offset,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setVertexBufferObjectOffset__C5_GLvoid_P1,
|
||||
"Set the offset into the VertexBufferObject, if used. ",
|
||||
"");
|
||||
I_Method0(const GLvoid *, getVertexBufferObjectOffset,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_GLvoid_P1__getVertexBufferObjectOffset,
|
||||
"Get the offset into the VertexBufferObject, if used. ",
|
||||
"");
|
||||
I_SimpleProperty(const GLvoid *, DataPointer,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
0);
|
||||
@@ -197,9 +172,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
I_SimpleProperty(GLenum, DataType,
|
||||
__GLenum__getDataType,
|
||||
0);
|
||||
I_SimpleProperty(unsigned int, ModifiedCount,
|
||||
__unsigned_int__getModifiedCount,
|
||||
__void__setModifiedCount__unsigned_int);
|
||||
I_SimpleProperty(unsigned int, TotalDataSize,
|
||||
__unsigned_int__getTotalDataSize,
|
||||
0);
|
||||
@@ -209,9 +181,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::Array)
|
||||
I_SimpleProperty(osg::VertexBufferObject *, VertexBufferObject,
|
||||
__osg_VertexBufferObject_P1__getVertexBufferObject,
|
||||
__void__setVertexBufferObject__osg_VertexBufferObject_P1);
|
||||
I_SimpleProperty(const GLvoid *, VertexBufferObjectOffset,
|
||||
__C5_GLvoid_P1__getVertexBufferObjectOffset,
|
||||
__void__setVertexBufferObjectOffset__C5_GLvoid_P1);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::ArrayVisitor)
|
||||
|
||||
@@ -26,6 +26,108 @@
|
||||
#undef OUT
|
||||
#endif
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferData)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_BaseType(osg::Object);
|
||||
I_Constructor0(____BufferData,
|
||||
"",
|
||||
"");
|
||||
I_ConstructorWithDefaults2(IN, const osg::BufferData &, bd, , IN, const osg::CopyOp &, copyop, osg::CopyOp::SHALLOW_COPY,
|
||||
____BufferData__C5_BufferData_R1__C5_CopyOp_R1,
|
||||
"Copy constructor using CopyOp to manage deep vs shallow copy. ",
|
||||
"");
|
||||
I_Method1(bool, isSameKindAs, IN, const osg::Object *, obj,
|
||||
Properties::VIRTUAL,
|
||||
__bool__isSameKindAs__C5_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_Method0(const GLvoid *, getDataPointer,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getTotalDataSize,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__unsigned_int__getTotalDataSize,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setBufferObject, IN, osg::BufferObject *, bufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setBufferObject__BufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osg::BufferObject *, getBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__BufferObject_P1__getBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osg::BufferObject *, getBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_BufferObject_P1__getBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setBufferIndex, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setBufferIndex__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getBufferIndex,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getBufferIndex,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::GLBufferObject *, getGLBufferObject, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLBufferObject_P1__getGLBufferObject__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::GLBufferObject *, getOrCreateGLBufferObject, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLBufferObject_P1__getOrCreateGLBufferObject__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, dirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__dirty,
|
||||
"Dirty the primitive, which increments the modified count, to force buffer objects to update. ",
|
||||
"");
|
||||
I_Method1(void, setModifiedCount, IN, unsigned int, value,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setModifiedCount__unsigned_int,
|
||||
"Set the modified count value. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getModifiedCount,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getModifiedCount,
|
||||
"Get modified count value. ",
|
||||
"");
|
||||
I_SimpleProperty(unsigned int, BufferIndex,
|
||||
__unsigned_int__getBufferIndex,
|
||||
__void__setBufferIndex__unsigned_int);
|
||||
I_SimpleProperty(osg::BufferObject *, BufferObject,
|
||||
__BufferObject_P1__getBufferObject,
|
||||
__void__setBufferObject__BufferObject_P1);
|
||||
I_SimpleProperty(const GLvoid *, DataPointer,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
0);
|
||||
I_SimpleProperty(unsigned int, ModifiedCount,
|
||||
__unsigned_int__getModifiedCount,
|
||||
__void__setModifiedCount__unsigned_int);
|
||||
I_SimpleProperty(unsigned int, TotalDataSize,
|
||||
__unsigned_int__getTotalDataSize,
|
||||
0);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_BaseType(osg::Object);
|
||||
@@ -51,6 +153,16 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject)
|
||||
__C5_char_P1__className,
|
||||
"return the name of the object's class type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method1(void, setTarget, IN, GLenum, target,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setTarget__GLenum,
|
||||
"",
|
||||
"");
|
||||
I_Method0(GLenum, getTarget,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLenum__getTarget,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setUsage, IN, GLenum, usage,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setUsage__GLenum,
|
||||
@@ -61,46 +173,11 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject)
|
||||
__GLenum__getUsage,
|
||||
"Get the type of usage the buffer object has been set up for. ",
|
||||
"");
|
||||
I_Method1(bool, isBufferObjectSupported, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isBufferObjectSupported__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(bool, isPBOSupported, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isPBOSupported__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(GLuint &, buffer, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLuint_R1__buffer__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, bindBuffer, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__bindBuffer__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, unbindBuffer, IN, unsigned int, contextID,
|
||||
Properties::VIRTUAL,
|
||||
__void__unbindBuffer__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, dirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__dirty,
|
||||
"",
|
||||
"");
|
||||
I_Method1(bool, isDirty, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isDirty__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned_int,
|
||||
@@ -111,50 +188,66 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::BufferObject)
|
||||
__void__releaseGLObjects__State_P1,
|
||||
"If State is non-zero, this function releases OpenGL objects for the specified graphics context. ",
|
||||
"Otherwise, releases OpenGL objects for all graphics contexts. ");
|
||||
I_StaticMethod2(void, deleteBufferObject, IN, unsigned int, contextID, IN, GLuint, globj,
|
||||
__void__deleteBufferObject__unsigned_int__GLuint_S,
|
||||
"Use deleteVertexBufferObject instead of glDeleteBuffers to allow OpenGL buffer objects to be cached until they can be deleted by the OpenGL context in which they were created, specified by contextID. ",
|
||||
"");
|
||||
I_StaticMethod3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, x, IN, double &, availableTime,
|
||||
__void__flushDeletedBufferObjects__unsigned_int__double__double_R1_S,
|
||||
"flush all the cached display list which need to be deleted in the OpenGL context related to contextID. ",
|
||||
"");
|
||||
I_StaticMethod1(void, discardDeletedBufferObjects, IN, unsigned int, contextID,
|
||||
__void__discardDeletedBufferObjects__unsigned_int_S,
|
||||
"dicard all the cached display list which need to be deleted in the OpenGL context related to contextID. ",
|
||||
"Note, unlike flush no OpenGL calls are made, instead the handles are all removed. this call is useful for when an OpenGL context has been destroyed. ");
|
||||
I_StaticMethod2(osg::BufferObject::Extensions *, getExtensions, IN, unsigned int, contextID, IN, bool, createIfNotInitalized,
|
||||
__Extensions_P1__getExtensions__unsigned_int__bool_S,
|
||||
"Function to call to get the extension of a specified context. ",
|
||||
"If the Extension object for that context has not yet been created and the 'createIfNotInitalized' flag been set to false then returns NULL. If 'createIfNotInitalized' is true then the Extensions object is automatically created. However, in this case the extension object is only created with the graphics context associated with ContextID.. ");
|
||||
I_StaticMethod2(void, setExtensions, IN, unsigned int, contextID, IN, osg::BufferObject::Extensions *, extensions,
|
||||
__void__setExtensions__unsigned_int__Extensions_P1_S,
|
||||
"setExtensions allows users to override the extensions across graphics contexts. ",
|
||||
"typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions. ");
|
||||
I_Method1(unsigned int, addBufferData, IN, osg::BufferData *, bd,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__addBufferData__BufferData_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, removeBufferData, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__removeBufferData__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, removeBufferData, IN, osg::BufferData *, bd,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__removeBufferData__BufferData_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method2(void, setBufferData, IN, unsigned int, index, IN, osg::BufferData *, bd,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setBufferData__unsigned_int__BufferData_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::BufferData *, getBufferData, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__BufferData_P1__getBufferData__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const osg::BufferData *, getBufferData, IN, unsigned int, index,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_BufferData_P1__getBufferData__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getNumBufferData,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getNumBufferData,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::GLBufferObject *, getGLBufferObject, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLBufferObject_P1__getGLBufferObject__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(osg::GLBufferObject *, getOrCreateGLBufferObject, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLBufferObject_P1__getOrCreateGLBufferObject__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_ArrayProperty(osg::BufferData *, BufferData,
|
||||
__BufferData_P1__getBufferData__unsigned_int,
|
||||
__void__setBufferData__unsigned_int__BufferData_P1,
|
||||
__unsigned_int__getNumBufferData,
|
||||
__unsigned_int__addBufferData__BufferData_P1,
|
||||
0,
|
||||
__void__removeBufferData__unsigned_int);
|
||||
I_SimpleProperty(GLenum, Target,
|
||||
__GLenum__getTarget,
|
||||
__void__setTarget__GLenum);
|
||||
I_SimpleProperty(GLenum, Usage,
|
||||
__GLenum__getUsage,
|
||||
__void__setUsage__GLenum);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::BufferObject::BufferEntry)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_Constructor0(____BufferEntry,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, const osg::BufferObject::BufferEntry &, be,
|
||||
Properties::NON_EXPLICIT,
|
||||
____BufferEntry__C5_BufferEntry_R1,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(osg::buffered_value< unsigned int >, modifiedCount);
|
||||
I_PublicMemberProperty(unsigned int, dataSize);
|
||||
I_PublicMemberProperty(unsigned int, offset);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(std::pair< osg::BufferObject::BufferEntry COMMA osg::DrawElements * >, osg::ElementBufferObject::BufferEntryDrawElementsPair)
|
||||
|
||||
TYPE_NAME_ALIAS(std::vector< osg::ElementBufferObject::BufferEntryDrawElementsPair >, osg::ElementBufferObject::BufferEntryDrawElementsPairs)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::ElementBufferObject)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_BaseType(osg::BufferObject);
|
||||
@@ -215,28 +308,145 @@ BEGIN_OBJECT_REFLECTOR(osg::ElementBufferObject)
|
||||
__C5_DrawElements_P1__getDrawElements__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const GLvoid *, getOffset, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_GLvoid_P1__getOffset__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned_int,
|
||||
"Resize any per context GLObject buffers to specified size. ",
|
||||
"");
|
||||
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)
|
||||
BEGIN_OBJECT_REFLECTOR(osg::GLBufferObject)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_BaseType(osg::Referenced);
|
||||
I_ConstructorWithDefaults2(IN, unsigned int, contextID, , IN, osg::BufferObject *, bufferObject, 0,
|
||||
____GLBufferObject__unsigned_int__BufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setBufferObject, IN, osg::BufferObject *, bufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setBufferObject__BufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(osg::BufferObject *, getBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__BufferObject_P1__getBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getContextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getContextID,
|
||||
"",
|
||||
"");
|
||||
I_Method0(GLuint &, getGLObjectID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLuint_R1__getGLObjectID,
|
||||
"",
|
||||
"");
|
||||
I_Method0(GLuint, getGLObjectID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLuint__getGLObjectID,
|
||||
"",
|
||||
"");
|
||||
I_Method1(GLsizeiptrARB, getOffset, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__GLsizeiptrARB__getOffset__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, bindBuffer,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__bindBuffer,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, unbindBuffer,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__unbindBuffer,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, isDirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isDirty,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, dirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__dirty,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, clear,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__clear,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, compileBuffer,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__compileBuffer,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, deleteGLObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__deleteGLObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, assign, IN, osg::BufferObject *, bufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__assign__BufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(bool, isPBOSupported,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isPBOSupported,
|
||||
"",
|
||||
"");
|
||||
I_StaticMethod2(osg::GLBufferObject *, createGLBufferObject, IN, unsigned int, contextID, IN, const osg::BufferObject *, bufferObject,
|
||||
__GLBufferObject_P1__createGLBufferObject__unsigned_int__C5_BufferObject_P1_S,
|
||||
"",
|
||||
"");
|
||||
I_StaticMethod2(void, deleteBufferObject, IN, unsigned int, contextID, IN, GLuint, globj,
|
||||
__void__deleteBufferObject__unsigned_int__GLuint_S,
|
||||
"Use deleteVertexBufferObject instead of glDeleteBuffers to allow OpenGL buffer objects to be cached until they can be deleted by the OpenGL context in which they were created, specified by contextID. ",
|
||||
"");
|
||||
I_StaticMethod3(void, flushDeletedBufferObjects, IN, unsigned int, contextID, IN, double, x, IN, double &, availableTime,
|
||||
__void__flushDeletedBufferObjects__unsigned_int__double__double_R1_S,
|
||||
"flush all the cached display list which need to be deleted in the OpenGL context related to contextID. ",
|
||||
"");
|
||||
I_StaticMethod1(void, discardDeletedBufferObjects, IN, unsigned int, contextID,
|
||||
__void__discardDeletedBufferObjects__unsigned_int_S,
|
||||
"dicard all the cached display list which need to be deleted in the OpenGL context related to contextID. ",
|
||||
"Note, unlike flush no OpenGL calls are made, instead the handles are all removed. this call is useful for when an OpenGL context has been destroyed. ");
|
||||
I_StaticMethod2(osg::GLBufferObject::Extensions *, getExtensions, IN, unsigned int, contextID, IN, bool, createIfNotInitalized,
|
||||
__Extensions_P1__getExtensions__unsigned_int__bool_S,
|
||||
"Function to call to get the extension of a specified context. ",
|
||||
"If the Extension object for that context has not yet been created and the 'createIfNotInitalized' flag been set to false then returns NULL. If 'createIfNotInitalized' is true then the Extensions object is automatically created. However, in this case the extension object is only created with the graphics context associated with ContextID.. ");
|
||||
I_StaticMethod2(void, setExtensions, IN, unsigned int, contextID, IN, osg::GLBufferObject::Extensions *, extensions,
|
||||
__void__setExtensions__unsigned_int__Extensions_P1_S,
|
||||
"setExtensions allows users to override the extensions across graphics contexts. ",
|
||||
"typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions. ");
|
||||
I_SimpleProperty(osg::BufferObject *, BufferObject,
|
||||
__BufferObject_P1__getBufferObject,
|
||||
__void__setBufferObject__BufferObject_P1);
|
||||
I_SimpleProperty(unsigned int, ContextID,
|
||||
__unsigned_int__getContextID,
|
||||
0);
|
||||
I_SimpleProperty(GLuint, GLObjectID,
|
||||
__GLuint__getGLObjectID,
|
||||
0);
|
||||
I_PublicMemberProperty(osg::GLBufferObject::Extensions *, _extensions);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_VALUE_REFLECTOR(osg::GLBufferObject::BufferEntry)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
I_Constructor0(____BufferEntry,
|
||||
"",
|
||||
"");
|
||||
I_Constructor1(IN, const osg::GLBufferObject::BufferEntry &, rhs,
|
||||
Properties::NON_EXPLICIT,
|
||||
____BufferEntry__C5_BufferEntry_R1,
|
||||
"",
|
||||
"");
|
||||
I_PublicMemberProperty(unsigned int, modifiedCount);
|
||||
I_PublicMemberProperty(GLsizeiptrARB, dataSize);
|
||||
I_PublicMemberProperty(GLsizeiptrARB, offset);
|
||||
I_PublicMemberProperty(osg::BufferData *, dataSource);
|
||||
END_REFLECTOR
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::PixelBufferObject)
|
||||
I_DeclaringFile("osg/BufferObject");
|
||||
@@ -290,21 +500,11 @@ BEGIN_OBJECT_REFLECTOR(osg::PixelBufferObject)
|
||||
__C5_Image_P1__getImage,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, offset,
|
||||
I_Method1(bool, isPBOSupported, IN, unsigned int, contextID,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__offset,
|
||||
__bool__isPBOSupported__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned_int,
|
||||
"Resize any per context GLObject buffers to specified size. ",
|
||||
"");
|
||||
I_SimpleProperty(osg::Image *, Image,
|
||||
__Image_P1__getImage,
|
||||
__void__setImage__osg_Image_P1);
|
||||
@@ -397,10 +597,6 @@ BEGIN_OBJECT_REFLECTOR(osg::PixelDataBufferObject)
|
||||
__void__setDataSize__unsigned_int);
|
||||
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_DeclaringFile("osg/BufferObject");
|
||||
I_BaseType(osg::BufferObject);
|
||||
@@ -461,34 +657,9 @@ BEGIN_OBJECT_REFLECTOR(osg::VertexBufferObject)
|
||||
__C5_Array_P1__getArray__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(const GLvoid *, getOffset, IN, unsigned int, i,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_GLvoid_P1__getOffset__unsigned_int,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, compileBuffer, IN, osg::State &, state,
|
||||
Properties::VIRTUAL,
|
||||
__void__compileBuffer__State_R1,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned_int,
|
||||
"Resize any per context GLObject buffers to specified size. ",
|
||||
"");
|
||||
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::ElementBufferObject::BufferEntryDrawElementsPair >)
|
||||
|
||||
STD_VECTOR_REFLECTOR(std::vector< osg::VertexBufferObject::BufferEntryArrayPair >)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ TYPE_NAME_ALIAS(std::vector< unsigned int >, osg::Image::MipmapDataType)
|
||||
|
||||
BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
I_DeclaringFile("osg/Image");
|
||||
I_BaseType(osg::Object);
|
||||
I_BaseType(osg::BufferData);
|
||||
I_Constructor0(____Image,
|
||||
"",
|
||||
"");
|
||||
@@ -85,6 +85,16 @@ BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
__C5_char_P1__className,
|
||||
"return the name of the object's class type. ",
|
||||
"Must be defined by derived classes. ");
|
||||
I_Method0(const GLvoid *, getDataPointer,
|
||||
Properties::VIRTUAL,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
"",
|
||||
"");
|
||||
I_Method0(unsigned int, getTotalDataSize,
|
||||
Properties::VIRTUAL,
|
||||
__unsigned_int__getTotalDataSize,
|
||||
"",
|
||||
"");
|
||||
I_Method1(int, compare, IN, const osg::Image &, rhs,
|
||||
Properties::VIRTUAL,
|
||||
__int__compare__C5_Image_R1,
|
||||
@@ -310,21 +320,6 @@ BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
__void__ensureValidSizeForTexturing__GLint,
|
||||
"Ensure image dimensions are a power of two. ",
|
||||
"Mipmapped textures require the image dimensions to be power of two and are within the maxiumum texture size for the host machine. ");
|
||||
I_Method0(void, dirty,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__dirty,
|
||||
"Dirty the image, which increments the modified count, to force osg::Texture to reload the image. ",
|
||||
"");
|
||||
I_Method1(void, setModifiedCount, IN, unsigned int, value,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setModifiedCount__unsigned_int,
|
||||
"Set the modified count value. ",
|
||||
"Used by osg::Texture when using texture subloading. ");
|
||||
I_Method0(unsigned int, getModifiedCount,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getModifiedCount,
|
||||
"Get modified count value. ",
|
||||
"Used by osg::Texture when using texture subloading. ");
|
||||
I_Method0(bool, isMipmap,
|
||||
Properties::NON_VIRTUAL,
|
||||
__bool__isMipmap,
|
||||
@@ -447,6 +442,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
I_SimpleProperty(osg::Image::AllocationMode, AllocationMode,
|
||||
__AllocationMode__getAllocationMode,
|
||||
__void__setAllocationMode__AllocationMode);
|
||||
I_SimpleProperty(const GLvoid *, DataPointer,
|
||||
__C5_GLvoid_P1__getDataPointer,
|
||||
0);
|
||||
I_SimpleProperty(GLenum, DataType,
|
||||
__GLenum__getDataType,
|
||||
__void__setDataType__GLenum);
|
||||
@@ -465,9 +463,6 @@ BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
I_SimpleProperty(const osg::Image::MipmapDataType &, MipmapLevels,
|
||||
__C5_MipmapDataType_R1__getMipmapLevels,
|
||||
__void__setMipmapLevels__C5_MipmapDataType_R1);
|
||||
I_SimpleProperty(unsigned int, ModifiedCount,
|
||||
__unsigned_int__getModifiedCount,
|
||||
__void__setModifiedCount__unsigned_int);
|
||||
I_SimpleProperty(osg::Image::Origin, Origin,
|
||||
__Origin__getOrigin,
|
||||
__void__setOrigin__Origin);
|
||||
@@ -489,6 +484,9 @@ BEGIN_OBJECT_REFLECTOR(osg::Image)
|
||||
I_SimpleProperty(unsigned int, RowSizeInBytes,
|
||||
__unsigned_int__getRowSizeInBytes,
|
||||
0);
|
||||
I_SimpleProperty(unsigned int, TotalDataSize,
|
||||
__unsigned_int__getTotalDataSize,
|
||||
0);
|
||||
I_SimpleProperty(unsigned int, TotalSizeInBytes,
|
||||
__unsigned_int__getTotalSizeInBytes,
|
||||
0);
|
||||
|
||||
@@ -157,11 +157,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::DrawElements)
|
||||
__C5_DrawElements_P1__getDrawElements,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, dirty,
|
||||
Properties::VIRTUAL,
|
||||
__void__dirty,
|
||||
"Dirty the primitive, which increments the modified count, to force buffer objects to update. ",
|
||||
"");
|
||||
I_Method1(void, setElementBufferObject, IN, osg::ElementBufferObject *, ebo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setElementBufferObject__osg_ElementBufferObject_P1,
|
||||
@@ -177,26 +172,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::DrawElements)
|
||||
__C5_osg_ElementBufferObject_P1__getElementBufferObject,
|
||||
"Get the const ElementBufferObject. ",
|
||||
"If no EBO is assigned returns NULL ");
|
||||
I_Method1(void, setElementBufferObjectOffset, IN, const GLvoid *, offset,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setElementBufferObjectOffset__C5_GLvoid_P1,
|
||||
"Set the offset into the ElementBufferObject, if used. ",
|
||||
"");
|
||||
I_Method0(const GLvoid *, getElementBufferObjectOffset,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_GLvoid_P1__getElementBufferObjectOffset,
|
||||
"Get the offset into the ElementBufferOffset, if used. ",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned int, maxSize,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned_int,
|
||||
"Resize any per context GLObject buffers to specified size. ",
|
||||
"");
|
||||
I_MethodWithDefaults1(void, releaseGLObjects, IN, osg::State *, state, 0,
|
||||
Properties::VIRTUAL,
|
||||
__void__releaseGLObjects__State_P1,
|
||||
"If State is non-zero, this function releases OpenGL objects for the specified graphics context. ",
|
||||
"Otherwise, releases OpenGL objects for all graphics contexts. ");
|
||||
I_Method1(void, reserveElements, IN, unsigned int, numIndices,
|
||||
Properties::PURE_VIRTUAL,
|
||||
__void__reserveElements__unsigned_int,
|
||||
@@ -223,9 +198,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::DrawElements)
|
||||
I_SimpleProperty(osg::ElementBufferObject *, ElementBufferObject,
|
||||
__osg_ElementBufferObject_P1__getElementBufferObject,
|
||||
__void__setElementBufferObject__osg_ElementBufferObject_P1);
|
||||
I_SimpleProperty(const GLvoid *, ElementBufferObjectOffset,
|
||||
__C5_GLvoid_P1__getElementBufferObjectOffset,
|
||||
__void__setElementBufferObjectOffset__C5_GLvoid_P1);
|
||||
END_REFLECTOR
|
||||
|
||||
TYPE_NAME_ALIAS(osg::VectorGLubyte, osg::DrawElementsUByte::vector_type)
|
||||
@@ -429,7 +401,7 @@ END_REFLECTOR
|
||||
|
||||
BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::PrimitiveSet)
|
||||
I_DeclaringFile("osg/PrimitiveSet");
|
||||
I_BaseType(osg::Object);
|
||||
I_BaseType(osg::BufferData);
|
||||
I_ConstructorWithDefaults3(IN, osg::PrimitiveSet::Type, primType, osg::PrimitiveSet::PrimitiveType, IN, GLenum, mode, 0, IN, int, numInstances, 0,
|
||||
____PrimitiveSet__Type__GLenum__int,
|
||||
"",
|
||||
@@ -538,31 +510,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::PrimitiveSet)
|
||||
__unsigned_int__getNumPrimitives,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, dirty,
|
||||
Properties::VIRTUAL,
|
||||
__void__dirty,
|
||||
"Dirty the primitive, which increments the modified count, to force buffer objects to update. ",
|
||||
"");
|
||||
I_Method1(void, setModifiedCount, IN, unsigned int, value,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setModifiedCount__unsigned_int,
|
||||
"Set the modified count value. ",
|
||||
"");
|
||||
I_Method0(unsigned int, getModifiedCount,
|
||||
Properties::NON_VIRTUAL,
|
||||
__unsigned_int__getModifiedCount,
|
||||
"Get modified count value. ",
|
||||
"");
|
||||
I_Method1(void, resizeGLObjectBuffers, IN, unsigned, int,
|
||||
Properties::VIRTUAL,
|
||||
__void__resizeGLObjectBuffers__unsigned,
|
||||
"Resize any per context GLObject buffers to specified size. ",
|
||||
"");
|
||||
I_MethodWithDefaults1(void, releaseGLObjects, IN, osg::State *, x, 0,
|
||||
Properties::VIRTUAL,
|
||||
__void__releaseGLObjects__State_P1,
|
||||
"If State is non-zero, this function releases OpenGL objects for the specified graphics context. ",
|
||||
"Otherwise, releases OpenGL objects for all graphics contexts. ");
|
||||
I_Method0(void, computeRange,
|
||||
Properties::VIRTUAL,
|
||||
__void__computeRange,
|
||||
@@ -577,9 +524,6 @@ BEGIN_ABSTRACT_OBJECT_REFLECTOR(osg::PrimitiveSet)
|
||||
I_SimpleProperty(GLenum, Mode,
|
||||
__GLenum__getMode,
|
||||
__void__setMode__GLenum);
|
||||
I_SimpleProperty(unsigned int, ModifiedCount,
|
||||
__unsigned_int__getModifiedCount,
|
||||
__void__setModifiedCount__unsigned_int);
|
||||
I_SimpleProperty(int, NumInstances,
|
||||
0,
|
||||
__void__setNumInstances__int);
|
||||
|
||||
@@ -331,19 +331,19 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
__void__dirtyAllVertexArrays,
|
||||
"dirty the vertex, normal, color, tex coords, secondary color, fog coord and index arrays. ",
|
||||
"");
|
||||
I_Method1(void, setCurrentVertexBufferObject, IN, osg::VertexBufferObject *, vbo,
|
||||
I_Method1(void, setCurrentVertexBufferObject, IN, osg::GLBufferObject *, vbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setCurrentVertexBufferObject__osg_VertexBufferObject_P1,
|
||||
__void__setCurrentVertexBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osg::VertexBufferObject *, getCurrentVertexBufferObject,
|
||||
I_Method0(const osg::GLBufferObject *, getCurrentVertexBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_VertexBufferObject_P1__getCurrentVertexBufferObject,
|
||||
__C5_GLBufferObject_P1__getCurrentVertexBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, bindVertexBufferObject, IN, const osg::VertexBufferObject *, vbo,
|
||||
I_Method1(void, bindVertexBufferObject, IN, osg::GLBufferObject *, vbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__bindVertexBufferObject__C5_osg_VertexBufferObject_P1,
|
||||
__void__bindVertexBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, unbindVertexBufferObject,
|
||||
@@ -351,19 +351,19 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
__void__unbindVertexBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setCurrentElementBufferObject, IN, osg::ElementBufferObject *, ebo,
|
||||
I_Method1(void, setCurrentElementBufferObject, IN, osg::GLBufferObject *, ebo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setCurrentElementBufferObject__osg_ElementBufferObject_P1,
|
||||
__void__setCurrentElementBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osg::ElementBufferObject *, getCurrentElementBufferObject,
|
||||
I_Method0(const osg::GLBufferObject *, getCurrentElementBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_ElementBufferObject_P1__getCurrentElementBufferObject,
|
||||
__C5_GLBufferObject_P1__getCurrentElementBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, bindElementBufferObject, IN, const osg::ElementBufferObject *, ebo,
|
||||
I_Method1(void, bindElementBufferObject, IN, osg::GLBufferObject *, ebo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__bindElementBufferObject__C5_osg_ElementBufferObject_P1,
|
||||
__void__bindElementBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, unbindElementBufferObject,
|
||||
@@ -371,19 +371,19 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
__void__unbindElementBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, setCurrentPixelBufferObject, IN, osg::PixelBufferObject *, pbo,
|
||||
I_Method1(void, setCurrentPixelBufferObject, IN, osg::GLBufferObject *, pbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__setCurrentPixelBufferObject__osg_PixelBufferObject_P1,
|
||||
__void__setCurrentPixelBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(const osg::PixelBufferObject *, getCurrentPixelBufferObject,
|
||||
I_Method0(const osg::GLBufferObject *, getCurrentPixelBufferObject,
|
||||
Properties::NON_VIRTUAL,
|
||||
__C5_PixelBufferObject_P1__getCurrentPixelBufferObject,
|
||||
__C5_GLBufferObject_P1__getCurrentPixelBufferObject,
|
||||
"",
|
||||
"");
|
||||
I_Method1(void, bindPixelBufferObject, IN, const osg::PixelBufferObject *, pbo,
|
||||
I_Method1(void, bindPixelBufferObject, IN, osg::GLBufferObject *, pbo,
|
||||
Properties::NON_VIRTUAL,
|
||||
__void__bindPixelBufferObject__C5_osg_PixelBufferObject_P1,
|
||||
__void__bindPixelBufferObject__osg_GLBufferObject_P1,
|
||||
"",
|
||||
"");
|
||||
I_Method0(void, unbindPixelBufferObject,
|
||||
@@ -830,15 +830,15 @@ BEGIN_OBJECT_REFLECTOR(osg::State)
|
||||
I_SimpleProperty(unsigned int, ContextID,
|
||||
__unsigned_int__getContextID,
|
||||
__void__setContextID__unsigned_int);
|
||||
I_SimpleProperty(osg::ElementBufferObject *, CurrentElementBufferObject,
|
||||
I_SimpleProperty(osg::GLBufferObject *, CurrentElementBufferObject,
|
||||
0,
|
||||
__void__setCurrentElementBufferObject__osg_ElementBufferObject_P1);
|
||||
I_SimpleProperty(osg::PixelBufferObject *, CurrentPixelBufferObject,
|
||||
__void__setCurrentElementBufferObject__osg_GLBufferObject_P1);
|
||||
I_SimpleProperty(osg::GLBufferObject *, CurrentPixelBufferObject,
|
||||
0,
|
||||
__void__setCurrentPixelBufferObject__osg_PixelBufferObject_P1);
|
||||
I_SimpleProperty(osg::VertexBufferObject *, CurrentVertexBufferObject,
|
||||
__void__setCurrentPixelBufferObject__osg_GLBufferObject_P1);
|
||||
I_SimpleProperty(osg::GLBufferObject *, CurrentVertexBufferObject,
|
||||
0,
|
||||
__void__setCurrentVertexBufferObject__osg_VertexBufferObject_P1);
|
||||
__void__setCurrentVertexBufferObject__osg_GLBufferObject_P1);
|
||||
I_SimpleProperty(const osg::Viewport *, CurrentViewport,
|
||||
__C5_Viewport_P1__getCurrentViewport,
|
||||
0);
|
||||
|
||||
Reference in New Issue
Block a user