Don't use glGetError() it was such a horrible design decision to use that for debugging. A better way to debug was introduced. https://www.khronos.org/opengl/wiki/Debug_Output