1GLGETERROR(3G) OpenGL Manual GLGETERROR(3G)
2
3
4
6 glGetError - return error information
7
9 GLenum glGetError(void);
10
12 glGetError returns the value of the error flag. Each detectable error
13 is assigned a numeric code and symbolic name. When an error occurs, the
14 error flag is set to the appropriate error code value. No other errors
15 are recorded until glGetError is called, the error code is returned,
16 and the flag is reset to GL_NO_ERROR. If a call to glGetError returns
17 GL_NO_ERROR, there has been no detectable error since the last call to
18 glGetError, or since the GL was initialized.
19
20 To allow for distributed implementations, there may be several error
21 flags. If any single error flag has recorded an error, the value of
22 that flag is returned and that flag is reset to GL_NO_ERROR when
23 glGetError is called. If more than one flag has recorded an error,
24 glGetError returns and clears an arbitrary error flag value. Thus,
25 glGetError should always be called in a loop, until it returns
26 GL_NO_ERROR, if all error flags are to be reset.
27
28 Initially, all error flags are set to GL_NO_ERROR.
29
30 The following errors are currently defined:
31
32 GL_NO_ERROR
33 No error has been recorded. The value of this symbolic constant is
34 guaranteed to be 0.
35
36 GL_INVALID_ENUM
37 An unacceptable value is specified for an enumerated argument. The
38 offending command is ignored and has no other side effect than to
39 set the error flag.
40
41 GL_INVALID_VALUE
42 A numeric argument is out of range. The offending command is
43 ignored and has no other side effect than to set the error flag.
44
45 GL_INVALID_OPERATION
46 The specified operation is not allowed in the current state. The
47 offending command is ignored and has no other side effect than to
48 set the error flag.
49
50 GL_INVALID_FRAMEBUFFER_OPERATION
51 The framebuffer object is not complete. The offending command is
52 ignored and has no other side effect than to set the error flag.
53
54 GL_OUT_OF_MEMORY
55 There is not enough memory left to execute the command. The state
56 of the GL is undefined, except for the state of the error flags,
57 after this error is recorded.
58
59 GL_STACK_UNDERFLOW
60 An attempt has been made to perform an operation that would cause
61 an internal stack to underflow.
62
63 GL_STACK_OVERFLOW
64 An attempt has been made to perform an operation that would cause
65 an internal stack to overflow.
66
67 When an error flag is set, results of a GL operation are undefined only
68 if GL_OUT_OF_MEMORY has occurred. In all other cases, the command
69 generating the error is ignored and has no effect on the GL state or
70 frame buffer contents. If the generating command returns a value, it
71 returns 0. If glGetError itself generates an error, it returns 0.
72
74 Copyright © 1991-2006 Silicon Graphics, Inc. Copyright © 2012 Khronos
75 Group. This document is licensed under the SGI Free Software B License.
76 For details, see http://oss.sgi.com/projects/FreeB/.
77
79 opengl.org
80
81
82
83opengl.org 06/10/2014 GLGETERROR(3G)