From Chris Denham, changed gluGetErrorString to using osg::State::checkGLErrors() to avoid null pointer dereference

This commit is contained in:
Robert Osfield 2008-09-20 10:34:47 +00:00
parent 4aaf24b5d8
commit c35159fdde

View File

@ -1521,11 +1521,8 @@ void SceneView::draw()
if (state->getCheckForGLErrors()!=osg::State::NEVER_CHECK_GL_ERRORS) if (state->getCheckForGLErrors()!=osg::State::NEVER_CHECK_GL_ERRORS)
{ {
GLenum errorNo = glGetError(); if (state->checkGLErrors("end of SceneView::draw()"))
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 // go into debug mode of OGL error in a fine grained way to help
// track down OpenGL errors. // track down OpenGL errors.
state->setCheckForGLErrors(osg::State::ONCE_PER_ATTRIBUTE); state->setCheckForGLErrors(osg::State::ONCE_PER_ATTRIBUTE);