Transfer: http://blog.csdn.net/u010270148/article/details/52934295
An OpenGL Error is caused if the function arguments do not match the current context Settings. It is represented by error code. In the vast majority of cases, the OpenGL functions produces errors and this will not work. A few work.
The
OpenGL Error is stored in a queue until the Error is processed. So, if you don’t check for errors regularly, you won’t know that a function call has triggered an error. Therefore, error detection should be checked periodically to ensure that the details of the error are known.
gets the next OpenGL Error in the queue and removes it from the queue. If GL_NO_ERROR is returned, the team is empty.
GLenum glGetError ()
if all OpenGL errors are obtained
for(GLenum err; (err = glGetError()) ! = GL_NO_ERROR;)
{
//Process/log the error.
}
all return values are:
GL_NO_ERROR
(0) No error value currently
GL_INVALID_ENUM
(1280) Returns GL_INVALID_OPERATION only if an invalid enumeration parameter is used, if the specified environment is used
GL_INVALID_VALUE
(1281) Returns GL_INVALID_OPERATION only if an invalid value parameter is used, if the specified environment is used
GL_INVALID_OPERATION
The :(1282) command’s state set is invalid for the specified argument.
GL_STACK_OVERFLOW
:(1283) a stack push operation exceeds the stack size.
GL_STACK_UNDERFLOW
(1284) The push – out operation reaches the bottom of the stack.
GL_OUT_OF_MEMORY
(1285) cannot allocate enough memory.
GL_INVALID_FRAMEBUFFER_OPERATION
(1286) when the operation is not ready for the true cache.
GL_CONTEXT_LOST
(1287) OpenGL Context is lost due to graphics card reset.
Read More:
- Gles2.0 Chinese API glgeterror
- OpenGL learning — problems encountered in compiling OpenGL program for the first time
- OpenGL basic graphics programming – OpenGL and 3D graphics world
- OpenGL runtime returned 1283 (stack overflow) error
- Beginners of OpenGL (1): preparation
- Vs2015 OpenGL environment configuration
- 2016.11.1 OpenGL learning, black screen does not display graphics
- OpenGL step pit record
- Configuration of OpenGL under CodeBlocks and solutions to problems encountered
- Solution to the failure of creating bitmap with multithreaded OpenGL
- The first day of OpenGL [vs2017 + OpenGL environment configuration]
- Building OpenGL environment
- Vs2015 + OpenGL configuration method
- How to use high version OpenGL under Windows
- Construction of vs2015 OpenGL configuration environment
- Solution of OpenGL window flicker in MFC framework
- Vs2017 installing OpenGL
- The solution of flicker and no refresh caused by OpenGL + MFC
- Vs2013 + glfw + glew configure OpenGL development environment
- Configure OpenGL development environment (vs2015)