Commit | Line | Data |
---|---|---|
7faf1d71 AW |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd"> |
2 | <!-- saved from url=(0013)about:internet --> | |
3 | <?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glGetError</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetError"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetError — return error information</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">GLenum <b class="fsfunc">glGetError</b>(</code></td><td> </td><td><var class="pdparam">void</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p> | |
4 | <code class="function">glGetError</code> returns the value of the error flag. | |
5 | Each detectable error is assigned a numeric code and symbolic name. | |
6 | When an error occurs, | |
7 | the error flag is set to the appropriate error code value. | |
8 | No other errors are recorded until <code class="function">glGetError</code> is called, | |
9 | the error code is returned, | |
10 | and the flag is reset to <code class="constant">GL_NO_ERROR</code>. | |
11 | If a call to <code class="function">glGetError</code> returns <code class="constant">GL_NO_ERROR</code>, | |
12 | there has been no detectable error since the last call to <code class="function">glGetError</code>, | |
13 | or since the GL was initialized. | |
14 | </p><p> | |
15 | To allow for distributed implementations, | |
16 | there may be several error flags. | |
17 | If any single error flag has recorded an error, | |
18 | the value of that flag is returned | |
19 | and that flag is reset to <code class="constant">GL_NO_ERROR</code> | |
20 | when <code class="function">glGetError</code> is called. | |
21 | If more than one flag has recorded an error, | |
22 | <code class="function">glGetError</code> returns and clears an arbitrary error flag value. | |
23 | Thus, <code class="function">glGetError</code> should always be called in a loop, | |
24 | until it returns <code class="constant">GL_NO_ERROR</code>, | |
25 | if all error flags are to be reset. | |
26 | </p><p> | |
27 | Initially, all error flags are set to <code class="constant">GL_NO_ERROR</code>. | |
28 | </p><p> | |
29 | The following errors are currently defined: | |
30 | </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_NO_ERROR</code></span></dt><dd><p> | |
31 | No error has been recorded. | |
32 | The value of this symbolic constant is guaranteed to be 0. | |
33 | </p></dd><dt><span class="term"><code class="constant">GL_INVALID_ENUM</code></span></dt><dd><p> | |
34 | An unacceptable value is specified for an enumerated argument. | |
35 | The offending command is ignored | |
36 | and has no other side effect than to set the error flag. | |
37 | </p></dd><dt><span class="term"><code class="constant">GL_INVALID_VALUE</code></span></dt><dd><p> | |
38 | A numeric argument is out of range. | |
39 | The offending command is ignored | |
40 | and has no other side effect than to set the error flag. | |
41 | </p></dd><dt><span class="term"><code class="constant">GL_INVALID_OPERATION</code></span></dt><dd><p> | |
42 | The specified operation is not allowed in the current state. | |
43 | The offending command is ignored | |
44 | and has no other side effect than to set the error flag. | |
45 | </p></dd><dt><span class="term"><code class="constant">GL_STACK_OVERFLOW</code></span></dt><dd><p> | |
46 | This command would cause a stack overflow. | |
47 | The offending command is ignored | |
48 | and has no other side effect than to set the error flag. | |
49 | </p></dd><dt><span class="term"><code class="constant">GL_STACK_UNDERFLOW</code></span></dt><dd><p> | |
50 | This command would cause a stack underflow. | |
51 | The offending command is ignored | |
52 | and has no other side effect than to set the error flag. | |
53 | </p></dd><dt><span class="term"><code class="constant">GL_OUT_OF_MEMORY</code></span></dt><dd><p> | |
54 | There is not enough memory left to execute the command. | |
55 | The state of the GL is undefined, | |
56 | except for the state of the error flags, | |
57 | after this error is recorded. | |
58 | </p></dd><dt><span class="term"><code class="constant">GL_TABLE_TOO_LARGE</code></span></dt><dd><p> | |
59 | The specified table exceeds the implementation's maximum supported table | |
60 | size. The offending command is ignored and has no other side effect | |
61 | than to set the error flag. | |
62 | </p></dd></dl></div><p> | |
63 | When an error flag is set, | |
64 | results of a GL operation are undefined only if <code class="constant">GL_OUT_OF_MEMORY</code> | |
65 | has occurred. | |
66 | In all other cases, | |
67 | the command generating the error is ignored and has no effect on the GL state | |
68 | or frame buffer contents. | |
69 | If the generating command returns a value, it returns 0. | |
70 | If <code class="function">glGetError</code> itself generates an error, it returns 0. | |
71 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p> | |
72 | <code class="constant">GL_TABLE_TOO_LARGE</code> was introduced in GL version 1.2. | |
73 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p> | |
74 | <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glGetError</code> | |
75 | is executed between the execution of <a class="citerefentry" href="glBegin.xml"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a> | |
76 | and the corresponding execution of <a class="citerefentry" href="glEnd.xml"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>. | |
77 | In this case, <code class="function">glGetError</code> returns 0. | |
78 | </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p> | |
79 | Copyright <span class="trademark"></span>© 1991-2006 | |
80 | Silicon Graphics, Inc. This document is licensed under the SGI | |
81 | Free Software B License. For details, see | |
82 | <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>. | |
83 | </p></div></div></body></html> |