Added automatic selection of the pixel type according to the window type

This commit is contained in:
Robert Osfield
2008-05-26 11:59:25 +00:00
parent d2afe3e956
commit 8ed9b303f1

View File

@@ -65,6 +65,12 @@ class WindowCaptureCallback : public osg::Camera::DrawCallback
_currentImageIndex(0),
_currentPboIndex(0)
{
if (gc->getTraits())
{
if (gc->getTraits()->alpha) _pixelFormat = GL_BGRA;
else _pixelFormat = GL_BGR;
}
getSize(gc, _width, _height);
std::cout<<"Window size "<<_width<<", "<<_height<<std::endl;
@@ -378,7 +384,7 @@ void WindowCaptureCallback::ContextData::multiPBO(osg::BufferObject::Extensions*
if(src)
{
memcpy(image->data(), src, image->getTotalSizeInBytes());
// memcpy(image->data(), src, image->getTotalSizeInBytes());
ext->glUnmapBuffer(GL_PIXEL_PACK_BUFFER_ARB);
}