Difference between revisions of "Example/OpenGL Error Testing"

From OpenGL Wiki
Jump to navigation Jump to search
(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>
+
<source lang="cpp">
 
GLenum err;
 
GLenum err;
 
while((err = glGetError()) != GL_NO_ERROR)
 
while((err = glGetError()) != GL_NO_ERROR)

Revision as of 02:26, 25 May 2020

A simple loop to extract the current OpenGL errors:

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