<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glGetError</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glGetConvolutionParameter.3G.xml" title="glGetConvolutionParameter"/><link rel="next" href="glGetHistogram.3G.xml" title="glGetHistogram"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glGetError</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glGetConvolutionParameter.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glGetHistogram.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glGetError.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glGetError.3G-name"/><h2>Name</h2><p>glGetError &#8212; return error information</p></div><div class="refsynopsisdiv"><a name="glGetError.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>GLenum <tt>glGetError</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glGetError.3G-python_spec"/><h2>Python Specification</h2><p>
			PyOpenGL does not export a binding for <tt>glGetError</tt> since OpenGL errors are raised as exceptions.
			For more information see ???.
		</p></div><div class="refsect1" lang="en"><a name="glGetError.3G-description"/><h2>Description</h2><p>
			<tt>glGetError</tt> returns the value of the error flag. Each detectable error is assigned a numeric code
			and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are
			recorded until <tt>glGetError</tt> is called, the error code is returned, and the flag is reset to
			<tt>GL_NO_ERROR</tt>. If a call to <tt>glGetError</tt> returns
			<tt>GL_NO_ERROR</tt>, there has been no detectable error since the last call to
			<tt>glGetError</tt>, or since the GL was initialized.
		</p><p>
			To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an
			error, the value of that flag is returned and that flag is reset to <tt>GL_NO_ERROR</tt> when
			<tt>glGetError</tt> is called. If more than one flag has recorded an error, <tt>glGetError</tt>
			returns and clears an arbitrary error flag value. Thus, <tt>glGetError</tt> should always be called in a
			loop, until it returns <tt>GL_NO_ERROR</tt>, if all error flags are to be reset.
		</p><p>
			Initially, all error flags are set to <tt>GL_NO_ERROR</tt>.
		</p><p>
			The following errors are currently defined:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_NO_ERROR</tt></span></dt><dd>
						No error has been recorded. The value of this symbolic constant is guaranteed to be 0.
					</dd><dt><span class="term"><tt>GL_INVALID_ENUM</tt></span></dt><dd>
						An unacceptable value is specified for an enumerated argument. The offending command is ignored, and has no
						other side effect than to set the error flag.
					</dd><dt><span class="term"><tt>GL_INVALID_VALUE</tt></span></dt><dd>
						A numeric argument is out of range. The offending command is ignored, and has no other side effect than to
						set the error flag.
					</dd><dt><span class="term"><tt>GL_INVALID_OPERATION</tt></span></dt><dd>
						The specified operation is not allowed in the current state. The offending command is ignored, and has no
						other side effect than to set the error flag.
					</dd><dt><span class="term"><tt>GL_STACK_OVERFLOW</tt></span></dt><dd>
						This command would cause a stack overflow. The offending command is ignored, and has no other side effect
						than to set the error flag.
					</dd><dt><span class="term"><tt>GL_STACK_UNDERFLOW</tt></span></dt><dd>
						This command would cause a stack underflow. The offending command is ignored, and has no other side effect
						than to set the error flag.
					</dd><dt><span class="term"><tt>GL_OUT_OF_MEMORY</tt></span></dt><dd>
						There is not enough memory left to execute the command. The state of the GL is undefined, except for the
						state of the error flags, after this error is recorded.
					</dd><dt><span class="term"><tt>GL_TABLE_TOO_LARGE</tt></span></dt><dd>
						The specified table exceeds the implementation's maximum supported table size. The offending command is
						ignored, and has no other side effect than to set the error flag.
					</dd></dl></div><p>
			When an error flag is set, results of a GL operation are undefined only if <tt>GL_OUT_OF_MEMORY</tt> has
			occurred. In all other cases, the command generating the error is ignored and has no effect on the GL state or frame
			buffer contents. If the generating command returns a value, it returns 0. If <tt>glGetError</tt> itself
			generates an error, it returns 0.
		</p></div><div class="refsect1" lang="en"><a name="glGetError.3G-notes"/><h2>Notes</h2><p>
			<tt>GL_TABLE_TOO_LARGE</tt> was introduced in GL version 1.2.
		</p></div><div class="refsect1" lang="en"><a name="glGetError.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glGetError</tt> is executed between the
			execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>. In this case <tt>glGetError</tt> returns 0.
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glGetConvolutionParameter.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glGetHistogram.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glGetConvolutionParameter </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glGetHistogram</td></tr></table></div></body></html>
