1GLGETERROR(3G) GLGETERROR(3G)
2
3
4
6 glGetError - return error information
7
8
10 GLenum glGetError( void )
11
12
14 glGetError returns the value of the error flag. Each detectable error
15 is assigned a numeric code and symbolic name. When an error occurs,
16 the error flag is set to the appropriate error code value. No other
17 errors are recorded until glGetError is called, the error code is
18 returned, and the flag is reset to GL_NO_ERROR. If a call to
19 glGetError returns GL_NO_ERROR, there has been no detectable error
20 since the last call to glGetError, or since the GL was initialized.
21
22 To allow for distributed implementations, there may be several error
23 flags. If any single error flag has recorded an error, the value of
24 that flag is returned and that flag is reset to GL_NO_ERROR when
25 glGetError is called. If more than one flag has recorded an error,
26 glGetError returns and clears an arbitrary error flag value. Thus,
27 glGetError should always be called in a loop, until it returns
28 GL_NO_ERROR, if all error flags are to be reset.
29
30 Initially, all error flags are set to GL_NO_ERROR.
31
32 The following errors are currently defined:
33
34 GL_NO_ERROR No error has been recorded. The value of
35 this symbolic constant is guaranteed to
36 be 0.
37
38 GL_INVALID_ENUM An unacceptable value is specified for an
39 enumerated argument. The offending com‐
40 mand is ignored, and has no other side
41 effect than to set the error flag.
42
43 GL_INVALID_VALUE A numeric argument is out of range. The
44 offending command is ignored, and has no
45 other side effect than to set the error
46 flag.
47
48 GL_INVALID_OPERATION The specified operation is not allowed in
49 the current state. The offending command
50 is ignored, and has no other side effect
51 than to set the error flag.
52
53 GL_STACK_OVERFLOW This command would cause a stack over‐
54 flow. The offending command is ignored,
55 and has no other side effect than to set
56 the error flag.
57
58 GL_STACK_UNDERFLOW This command would cause a stack under‐
59 flow. The offending command is ignored,
60 and has no other side effect than to set
61 the error flag.
62
63 GL_OUT_OF_MEMORY There is not enough memory left to exe‐
64 cute the command. The state of the GL is
65 undefined, except for the state of the
66 error flags, after this error is
67 recorded.
68
69 GL_TABLE_TOO_LARGE The specified table exceeds the implemen‐
70 tation's maximum supported table size.
71 The offending command is ignored, and has
72 no other side effect than to set the
73 error flag.
74
75 When an error flag is set, results of a GL operation are undefined only
76 if GL_OUT_OF_MEMORY has occurred. In all other cases, the command gen‐
77 erating the error is ignored and has no effect on the GL state or frame
78 buffer contents. If the generating command returns a value, it returns
79 0. If glGetError itself generates an error, it returns 0.
80
82 GL_TABLE_TOO_LARGE was introduced in GL version 1.2.
83
85 GL_INVALID_OPERATION is generated if glGetError is executed between the
86 execution of glBegin and the corresponding execution of glEnd. In this
87 case glGetError returns 0.
88
89
90
91 GLGETERROR(3G)