From d2afe3e956f42d5d2ead5a7daf9a641e497147f7 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 26 May 2008 11:53:51 +0000 Subject: [PATCH] Added option for doing triple buffering, and set the default read format to GL_RGBA --- examples/osgscreencapture/osgscreencapture.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/osgscreencapture/osgscreencapture.cpp b/examples/osgscreencapture/osgscreencapture.cpp index 0af555a6c..d4764cdf8 100644 --- a/examples/osgscreencapture/osgscreencapture.cpp +++ b/examples/osgscreencapture/osgscreencapture.cpp @@ -40,7 +40,8 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback { READ_PIXELS, SINGLE_PBO, - DOUBLE_PBO + DOUBLE_PBO, + TRIPLE_PBO }; enum FramePosition @@ -57,7 +58,7 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback _mode(mode), _readBuffer(readBuffer), _fileName(name), - _pixelFormat(GL_BGR), + _pixelFormat(GL_BGRA), _type(GL_UNSIGNED_BYTE), _width(0), _height(0), @@ -86,6 +87,12 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback _pboBuffer.push_back(0); _pboBuffer.push_back(0); break; + case(TRIPLE_PBO): + osg::notify(osg::NOTICE)<<"Reading window usig glReadPixels, with a double buffer PixelBufferObject."<