When Should One Call glGetError?

后端 未结 3 1079
南方客
南方客 2021-02-01 22:41

glLoadIdentity says

GL_INVALID_OPERATION is generated if glLoadIdentity is executed between the execution of glBegin<

3条回答
  •  误落风尘
    2021-02-01 23:08

    Normally you should call glGetError after every other gl... call as one of the effects of the call is to clear the error from the stack (from the MSDN):

    When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until glGetError is called, the error code is returned, and the flag is reset to GL_NO_ERROR.

    However, if you have calls wrapped in glBegin and glEnd call glError after the glEnd. This should return you the correct error code (if there was one) and clear the error stack.

提交回复
热议问题