Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects

This commit is contained in:
Robert Osfield
2009-10-01 20:19:42 +00:00
parent cfac6a7809
commit f75013d534
24 changed files with 1067 additions and 842 deletions

View File

@@ -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();