Difference between revisions of "Example/OpenGL Error Testing"

From OpenGL Wiki
Jump to navigation Jump to search
(Attempting to fix syntax highlighting.)
(Still attempting to fix syntax highlighting.)
 
Line 1: Line 1:
 
A simple loop to extract the current OpenGL errors:
 
A simple loop to extract the current OpenGL errors:
  
<source lang="cpp">
+
<syntaxhighlight lang="cpp">
 
GLenum err;
 
GLenum err;
 
while((err = glGetError()) != GL_NO_ERROR)
 
while((err = glGetError()) != GL_NO_ERROR)
Line 7: Line 7:
 
   // Process/log the error.
 
   // Process/log the error.
 
}
 
}
</source>
+
</syntaxhighlight>
 
<noinclude>[[Category:Example Code]]</noinclude>
 
<noinclude>[[Category:Example Code]]</noinclude>

Latest revision as of 02:27, 25 May 2020

A simple loop to extract the current OpenGL errors:

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