I think this would be better with GL_ASSERTIONS?