I have a problem with multiple "Warning: detected OpenGL error 'invalid value' after RenderBin::draw(...)" error messages emitted by OSG. I found this thread showing a way to add additional debug information. Unfortunately I can't find a way to set the State.
I can create a State and set the flag using the code:
osg::ref_ptr<osg::State> debugState = new osg::State();
debugState->setCheckForGLErrors(osg::State::CheckForGLErrors::ONCE_PER_ATTRIBUTE);
But what do I do after? I can't find a way to add the State to a StateSet.