From Alberto Luaces, "here are some minor fixes to notify warnings were the std::hex modifier was

used but never restored to the decimal notation. That made OSG print messages
like the following after some notifications:

Warning: detected OpenGL error 'invalid value' after RenderBin::draw(,)
RenderStage::drawInner(,) FBO status= 0x8cd5
[...]
Scaling image 'brick_side.JPG' from (1b4,24f) to (200,200) <--- Values in hex
because of previous error.
[...]"
This commit is contained in:
Robert Osfield
2009-02-06 10:35:18 +00:00
parent d0e12bd379
commit fde95d5ccf
5 changed files with 10 additions and 10 deletions

View File

@@ -276,7 +276,7 @@ GLenum Image::computeFormatDataType(GLenum pixelFormat)
default:
{
notify(WARN)<<"error computeFormatType = "<<std::hex<<pixelFormat<<std::endl;
notify(WARN)<<"error computeFormatType = "<<std::hex<<pixelFormat<<std::dec<<std::endl;
return 0;
}
}
@@ -377,7 +377,7 @@ unsigned int Image::computeNumComponents(GLenum pixelFormat)
default:
{
notify(WARN)<<"error pixelFormat = "<<std::hex<<pixelFormat<<std::endl;
notify(WARN)<<"error pixelFormat = "<<std::hex<<pixelFormat<<std::dec<<std::endl;
return 0;
}
}

View File

@@ -965,7 +965,7 @@ bool State::checkGLErrors(const char* str) const
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '" << error<<"'";
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo;
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x" << std::hex << errorNo << std::dec;
if (str) osg::notify(WARN)<<" at "<<str<< std::endl;
else osg::notify(WARN)<<" in osg::State."<< std::endl;
@@ -996,7 +996,7 @@ bool State::checkGLErrors(const StateAttribute* attribute) const
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(WARN)<<"Warning: detected OpenGL error '"<< error <<"' after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::endl;
else osg::notify(WARN)<<"Warning: detected OpenGL error number 0x"<< std::hex << errorNo <<" after applying attribute "<<attribute->className()<<" "<<attribute<< std::dec << std::endl;
return true;
}

View File

@@ -677,7 +677,7 @@ class ReaderWriterDICOM : public osgDB::ReaderWriter
matrix->preMult(osg::Matrix::scale(double(image->s()), double(image->t()), double(image->r())));
notice()<<"Image dimensions = "<<image->s()<<", "<<image->t()<<", "<<image->r()<<" pixelFormat=0x"<<std::hex<<pixelFormat<<" dataType=0x"<<std::hex<<dataType<<std::endl;
notice()<<"Image dimensions = "<<image->s()<<", "<<image->t()<<", "<<image->r()<<" pixelFormat=0x"<<std::hex<<pixelFormat<<" dataType=0x"<<std::hex<<dataType<<std::dec<<std::endl;
}
else if (pixelData->getPlanes()>numPlanes ||
pixelData->getRepresentation()>pixelRep)

View File

@@ -71,7 +71,7 @@ bool ImageLayer_readLocalData(osg::Object& obj, osgDB::Input &fr)
image = osgDB::readRefImageFile( filename );
}
osg::notify(osg::INFO)<<"osgVolume::ImageLyaer image read: "<<filename<<" pixelFormat "<<std::hex<<image->getPixelFormat()<<" textureFormat "<<image->getInternalTextureFormat()<<" dataType "<<image->getDataType()<<std::endl;
osg::notify(osg::INFO)<<"osgVolume::ImageLayer image read: "<<filename<<" pixelFormat "<<std::hex<<image->getPixelFormat()<<" textureFormat "<<image->getInternalTextureFormat()<<" dataType "<<image->getDataType()<<std::dec<<std::endl;
if (image.valid())
{

View File

@@ -441,7 +441,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
if (status != GL_FRAMEBUFFER_COMPLETE_EXT)
{
osg::notify(osg::NOTICE)<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::endl;
osg::notify(osg::NOTICE)<<"RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x"<<std::hex<<status<<std::dec<<std::endl;
fbo_supported = false;
fbo_ext->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
@@ -472,7 +472,7 @@ void RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo)
{
notify(NOTICE) << "RenderStage::runCameraSetUp(), "
"multisample FBO setup failed, FBO status = 0x"
<< std::hex << status << std::endl;
<< std::hex << status << std::dec << std::endl;
fbo->apply(state);
fbo_multisample = 0;
@@ -852,9 +852,9 @@ void RenderStage::drawInner(osg::RenderInfo& renderInfo,RenderLeaf*& previous, b
{
const char* error = (char*)gluErrorString(errorNo);
if (error) osg::notify(osg::NOTICE)<<"Warning: detected OpenGL error '"<<error<<"' after RenderBin::draw(,)"<<std::endl;
else osg::notify(osg::NOTICE)<<"Warning: detected OpenGL errorNo= 0x"<<std::hex<<errorNo<<" after RenderBin::draw(,)"<<std::endl;
else osg::notify(osg::NOTICE)<<"Warning: detected OpenGL errorNo= 0x"<<std::hex<<errorNo<<" after RenderBin::draw(,)"<<std::dec<<std::endl;
if (fbo_ext) osg::notify(osg::NOTICE)<<"RenderStage::drawInner(,) FBO status= 0x"<<std::hex<<fbo_ext->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)<<std::endl;
if (fbo_ext) osg::notify(osg::NOTICE)<<"RenderStage::drawInner(,) FBO status= 0x"<<std::hex<<fbo_ext->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)<<std::dec<<std::endl;
}
}