Hi Robert,
You may be right about the cause of the GL error as I am currently doing
horrible things experimenting with code to try and support an SVI display.
However, I stand by this submission, as it was not really about the cause of
the GL error, more about how it is reported and the re-use of the GL error
reporting code in State.cpp.
Basically, <<gluErrorString(errorNo)<<" goes bang! if there is no error
string for the code passed in.
It seemed to me that the original code makes an assumption the return value
of gluErrorString(errorCode) being non NULL.
An assumption that is not made by the code in State::checkGLErrors(), so it
makes sense to reuse that code in any case.
Hope that explains my reasoning for submitting this trivial little change.
And it might stop an app crashing unnecessarily when it gets a GLerror for
which there is no 'pretty string' available..
Chris.
----- Original Message -----
From: "Robert Osfield" <[EMAIL PROTECTED]>
To: "Chris Denham" <[EMAIL PROTECTED]>; "OpenSceneGraph Submissions"
<[email protected]>
Sent: Friday, September 19, 2008 4:43 PM
Subject: Re: [osg-submissions] SceneView OpenGL error trap succeptable to
null pointer exception in OSG2.6.
Hi Chris,
If glGetError() is crashing then it suggests that you are calling this
code from a thread that doesn't have valid graphics context, which is
a bug at the application level, rather than SceneView itself.
Robert.
On Fri, Sep 19, 2008 at 4:09 PM, Chris Denham <[EMAIL PROTECTED]>
wrote:
Just found a little problem with SceneView.cpp crashing with NULL pointer
exception because it tried to use a NULL returned by gluErrorString().
I noticed that there is GL error reporting code in State.cpp that
probably
should have be used here.
Mods shown below, and I have attached modified osg2.6 SceneView.cpp
//////////////////BEFORE//////////////////////
GLenum errorNo = glGetError();
if (errorNo!=GL_NO_ERROR)
{
osg::notify(WARN)<<"Warning: detected OpenGL error
'"<<gluErrorString(errorNo)<<"'"<< std::endl;
// go into debug mode of OGL error in a fine grained way to
help
// track down OpenGL errors.
state->setCheckForGLErrors(osg::State::ONCE_PER_ATTRIBUTE);
}
}
/////////////AFTER////////////////////////////
if (state->checkGLErrors("end of SceneView::draw()"))
{
// go into debug mode of OGL error in a fine grained way to
help
// track down OpenGL errors.
state->setCheckForGLErrors(osg::State::ONCE_PER_ATTRIBUTE);
}
//////////////////////////////////////////////////////
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org