With OpenGL, one of the first ways to troubleshoot a problem is by checking if we made a call or passed in an argument that OpenGL didn’t like. We can do this by calling glGetError to get the state of OpenGL’s error flags. Here are some of the most common error codes:
We passed in a value to a function that doesn’t accept that value. For example, maybe we passed in GL_FLOAT to glEnable or something else that doesn’t make sense for that function.
One of the numeric arguments we passed in to a function was out of range.
We tried to perform an invalid operation for the given OpenGL state.
In addition to glGetError, we also have more specific ways of looking for an error, ...