Example/OpenGL Error Testing: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
(Error testing code snippet.)
 
No edit summary
Line 5: Line 5:
while((err = glGetError()) != GL_NO_ERROR)
while((err = glGetError()) != GL_NO_ERROR)
{
{
   //Process/log the error.
   // Process/log the error.
}
}
</source>
</source>
<noinclude>[[Category:Example Code]]</noinclude>
<noinclude>[[Category:Example Code]]</noinclude>

Revision as of 17:42, 2 January 2018

A simple loop to extract the current OpenGL errors:

GLenum err;
while((err = glGetError()) != GL_NO_ERROR)
{
  // Process/log the error.
}