Difference between revisions of "Example/OpenGL Error Testing"

From OpenGL Wiki
Jump to: navigation, search
(Error testing code snippet.)
 
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.
}