<?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>glMatrixMode</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="glMaterial.3G.xml" title="glMaterial"/><link rel="next" href="glMinmax.3G.xml" title="glMinmax"/></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">glMatrixMode</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glMaterial.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glMinmax.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glMatrixMode.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glMatrixMode.3G-name"/><h2>Name</h2><p>glMatrixMode &#8212; specify which matrix is the current matrix</p></div><div class="refsynopsisdiv"><a name="glMatrixMode.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glMatrixMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>mode</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glMatrixMode.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glMatrixMode</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>mode</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glMatrixMode.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>mode</tt></i></span></dt><dd>
						Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted:
						<tt>GL_MODELVIEW</tt>, <tt>GL_PROJECTION</tt>, and <tt>GL_TEXTURE</tt>.
						The initial value is <tt>GL_MODELVIEW</tt>. Additionally, if the
						<tt>GL_ARB_imaging</tt> extension is supported, <tt>GL_COLOR</tt> is also accepted.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glMatrixMode.3G-description"/><h2>Description</h2><p>
			<tt>glMatrixMode</tt> sets the current matrix mode. <i><tt>mode</tt></i> can assume one of four
			values:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_MODELVIEW</tt></span></dt><dd>
						Applies subsequent matrix operations to the modelview matrix stack.
					</dd><dt><span class="term"><tt>GL_PROJECTION</tt></span></dt><dd>
						Applies subsequent matrix operations to the projection matrix stack.
					</dd><dt><span class="term"><tt>GL_TEXTURE</tt></span></dt><dd>
						Applies subsequent matrix operations to the texture matrix stack.
					</dd><dt><span class="term"><tt>GL_COLOR</tt></span></dt><dd>
						Applies subsequent matrix operations to the color matrix stack.
					</dd></dl></div><p>
			To find out which matrix stack is currently the target of all matrix operations, call <tt>glGet</tt> with argument <tt>GL_MATRIX_MODE</tt>. The initial value is
			<tt>GL_MODELVIEW</tt>.
		</p></div><div class="refsect1" lang="en"><a name="glMatrixMode.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>mode</tt></i> is not an accepted value.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glMatrixMode</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>.
		</p></div><div class="refsect1" lang="en"><a name="glMatrixMode.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_MATRIX_MODE</tt>
		</p></div><div class="refsect1" lang="en"><a name="glMatrixMode.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glLoadMatrix.3G.xml">glLoadMatrix</a>, <a href="glPushMatrix.3G.xml">glPushMatrix</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glMaterial.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="glMinmax.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glMaterial </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glMinmax</td></tr></table></div></body></html>
