title: Set CheckForGLErrors State
body: <p>I have a problem with multiple "Warning: detected OpenGL error 'invalid value' after RenderBin::draw(...)" error messages emitted by OSG. I found <a href="https://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg03657.html" rel="nofollow">this thread</a> showing a way to add additional debug information. Unfortunately I can't find a way to set the State.</p>
  
  <p>I can create a State and set the flag using the code:</p>
  
  <pre><code>osg::ref_ptr&lt;osg::State&gt; debugState = new osg::State();  
  debugState-&gt;setCheckForGLErrors(osg::State::CheckForGLErrors::ONCE_PER_ATTRIBUTE);
  </code></pre>
  
  <p>But what do I do after? I can't find a way to add the State to a StateSet.</p>