| 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_INVALID_FRAMEBUFFER_OPERATION</constant></term> |
| 101 | <listitem> |
| 102 | <para> |
| 103 | The framebuffer object is not complete. The offending command |
| 104 | is ignored and has no other side effect than to set the error flag. |
| 105 | </para> |
| 106 | </listitem> |
| 107 | </varlistentry> |
| 108 | <varlistentry> |
| 109 | <term><constant>GL_OUT_OF_MEMORY</constant></term> |
| 110 | <listitem> |
| 111 | <para> |
| 112 | There is not enough memory left to execute the command. |
| 113 | The state of the GL is undefined, |
| 114 | except for the state of the error flags, |
| 115 | after this error is recorded. |
| 116 | </para> |
| 117 | </listitem> |
| 118 | </varlistentry> |
| 119 | <varlistentry> |
| 120 | <term><constant>GL_STACK_UNDERFLOW</constant></term> |
| 121 | <listitem> |
| 122 | <para> |
| 123 | An attempt has been made to perform an operation that would |
| 124 | cause an internal stack to underflow. |
| 125 | </para> |
| 126 | </listitem> |
| 127 | </varlistentry> |
| 128 | <varlistentry> |
| 129 | <term><constant>GL_STACK_OVERFLOW</constant></term> |
| 130 | <listitem> |
| 131 | <para> |
| 132 | An attempt has been made to perform an operation that would |
| 133 | cause an internal stack to overflow. |
| 134 | </para> |
| 135 | </listitem> |
| 136 | </varlistentry> |
| 137 | </variablelist> |
| 138 | <para> |
| 139 | When an error flag is set, |
| 140 | results of a GL operation are undefined only if <constant>GL_OUT_OF_MEMORY</constant> |
| 141 | has occurred. |
| 142 | In all other cases, |
| 143 | the command generating the error is ignored and has no effect on the GL state |
| 144 | or frame buffer contents. |
| 145 | If the generating command returns a value, it returns 0. |
| 146 | If <function>glGetError</function> itself generates an error, it returns 0. |
| 147 | </para> |
| 148 | </refsect1> |
| 149 | <refsect1 id="Copyright"><title>Copyright</title> |
| 150 | <para> |
| 151 | Copyright <trademark class="copyright"></trademark> 1991-2006 |
| 152 | Silicon Graphics, Inc. |
| 153 | Copyright <trademark class="copyright"></trademark> 2012 |
| 154 | Khronos Group. |
| 155 | This document is licensed under the SGI |
| 156 | Free Software B License. For details, see |
| 157 | <ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>. |
| 158 | </para> |
| 159 | </refsect1> |
| 160 | </refentry> |