From e489c7b1bfecc1c2dc9ba88377866bf6d2d104bb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 23 Feb 2011 10:37:51 +0000 Subject: [PATCH] Added extra check for GL_BGR and GL_BGRA formats and messages describing image format loaded --- examples/osgvolume/osgvolume.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/osgvolume/osgvolume.cpp b/examples/osgvolume/osgvolume.cpp index a0bd0d465..97bda1a13 100644 --- a/examples/osgvolume/osgvolume.cpp +++ b/examples/osgvolume/osgvolume.cpp @@ -476,7 +476,9 @@ osg::Image* createTexture3D(ImageList& imageList, ProcessRow& processRow, pixelFormat==GL_LUMINANCE || pixelFormat==GL_LUMINANCE_ALPHA || pixelFormat==GL_RGB || - pixelFormat==GL_RGBA) + pixelFormat==GL_RGBA || + pixelFormat==GL_BGR || + pixelFormat==GL_BGRA) { max_s = osg::maximum(image->s(), max_s); max_t = osg::maximum(image->t(), max_t); @@ -485,7 +487,7 @@ osg::Image* createTexture3D(ImageList& imageList, ProcessRow& processRow, } else { - osg::notify(osg::NOTICE)<<"Image "<getFileName()<<" has unsuitable pixel format"<< std::hex<< pixelFormat << std::dec << std::endl; + osg::notify(osg::NOTICE)<<"Image "<getFileName()<<" has unsuitable pixel format 0x"<< std::hex<< pixelFormat << std::dec << std::endl; } } @@ -1242,6 +1244,7 @@ int main( int argc, char **argv ) if(image) { + OSG_NOTICE<<"Read osg::Image FileName::"<getFileName()<<", pixelFormat=0x"<getPixelFormat()<getFileName()<<", pixelFormat=0x"<getPixelFormat()<