rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glGetError.xml
CommitLineData
7faf1d71
AW
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4<refentry id="glGetError">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glGetError</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glGetError</refname>
17 <refpurpose>return error information</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>GLenum <function>glGetError</function></funcdef>
23 <paramdef> <parameter>void</parameter></paramdef>
24 </funcprototype>
25 </funcsynopsis>
26 </refsynopsisdiv>
27 <refsect1 id="description"><title>Description</title>
28 <para>
29 <function>glGetError</function> returns the value of the error flag.
30 Each detectable error is assigned a numeric code and symbolic name.
31 When an error occurs,
32 the error flag is set to the appropriate error code value.
33 No other errors are recorded until <function>glGetError</function> is called,
34 the error code is returned,
35 and the flag is reset to <constant>GL_NO_ERROR</constant>.
36 If a call to <function>glGetError</function> returns <constant>GL_NO_ERROR</constant>,
37 there has been no detectable error since the last call to <function>glGetError</function>,
38 or since the GL was initialized.
39 </para>
40 <para>
41 To allow for distributed implementations,
42 there may be several error flags.
43 If any single error flag has recorded an error,
44 the value of that flag is returned
45 and that flag is reset to <constant>GL_NO_ERROR</constant>
46 when <function>glGetError</function> is called.
47 If more than one flag has recorded an error,
48 <function>glGetError</function> returns and clears an arbitrary error flag value.
49 Thus, <function>glGetError</function> should always be called in a loop,
50 until it returns <constant>GL_NO_ERROR</constant>,
51 if all error flags are to be reset.
52 </para>
53 <para>
54 Initially, all error flags are set to <constant>GL_NO_ERROR</constant>.
55 </para>
56 <para>
57 The following errors are currently defined:
58 </para>
59 <variablelist>
60 <varlistentry>
61 <term><constant>GL_NO_ERROR</constant></term>
62 <listitem>
63 <para>
64 No error has been recorded.
65 The value of this symbolic constant is guaranteed to be 0.
66 </para>
67 </listitem>
68 </varlistentry>
69 <varlistentry>
70 <term><constant>GL_INVALID_ENUM</constant></term>
71 <listitem>
72 <para>
73 An unacceptable value is specified for an enumerated argument.
74 The offending command is ignored
75 and has no other side effect than to set the error flag.
76 </para>
77 </listitem>
78 </varlistentry>
79 <varlistentry>
80 <term><constant>GL_INVALID_VALUE</constant></term>
81 <listitem>
82 <para>
83 A numeric argument is out of range.
84 The offending command is ignored
85 and has no other side effect than to set the error flag.
86 </para>
87 </listitem>
88 </varlistentry>
89 <varlistentry>
90 <term><constant>GL_INVALID_OPERATION</constant></term>
91 <listitem>
92 <para>
93 The specified operation is not allowed in the current state.
94 The offending command is ignored
95 and has no other side effect than to set the error flag.
96 </para>
97 </listitem>
98 </varlistentry>
99 <varlistentry>
100 <term><constant>GL_STACK_OVERFLOW</constant></term>
101 <listitem>
102 <para>
103 This command would cause a stack overflow.
104 The offending command is ignored
105 and has no other side effect than to set the error flag.
106 </para>
107 </listitem>
108 </varlistentry>
109 <varlistentry>
110 <term><constant>GL_STACK_UNDERFLOW</constant></term>
111 <listitem>
112 <para>
113 This command would cause a stack underflow.
114 The offending command is ignored
115 and has no other side effect than to set the error flag.
116 </para>
117 </listitem>
118 </varlistentry>
119 <varlistentry>
120 <term><constant>GL_OUT_OF_MEMORY</constant></term>
121 <listitem>
122 <para>
123 There is not enough memory left to execute the command.
124 The state of the GL is undefined,
125 except for the state of the error flags,
126 after this error is recorded.
127 </para>
128 </listitem>
129 </varlistentry>
130 <varlistentry>
131 <term><constant>GL_TABLE_TOO_LARGE</constant></term>
132 <listitem>
133 <para>
134 The specified table exceeds the implementation's maximum supported table
135 size. The offending command is ignored and has no other side effect
136 than to set the error flag.
137 </para>
138 </listitem>
139 </varlistentry>
140 </variablelist>
141 <para>
142 When an error flag is set,
143 results of a GL operation are undefined only if <constant>GL_OUT_OF_MEMORY</constant>
144 has occurred.
145 In all other cases,
146 the command generating the error is ignored and has no effect on the GL state
147 or frame buffer contents.
148 If the generating command returns a value, it returns 0.
149 If <function>glGetError</function> itself generates an error, it returns 0.
150 </para>
151 </refsect1>
152 <refsect1 id="notes"><title>Notes</title>
153 <para>
154 <constant>GL_TABLE_TOO_LARGE</constant> was introduced in GL version 1.2.
155 </para>
156 </refsect1>
157 <refsect1 id="errors"><title>Errors</title>
158 <para>
159 <constant>GL_INVALID_OPERATION</constant> is generated if <function>glGetError</function>
160 is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
161 and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
162 In this case, <function>glGetError</function> returns 0.
163 </para>
164 </refsect1>
165 <refsect1 id="Copyright"><title>Copyright</title>
166 <para>
167 Copyright <trademark class="copyright"></trademark> 1991-2006
168 Silicon Graphics, Inc. This document is licensed under the SGI
169 Free Software B License. For details, see
170 <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
171 </para>
172 </refsect1>
173</refentry>