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=
"glPushMatrix">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glPushMatrix
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glPushMatrix
</refname>
17 <refpurpose>push and pop the current matrix stack
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glPushMatrix
</function></funcdef>
23 <paramdef> <parameter>void
</parameter></paramdef>
27 <refsynopsisdiv><title>C Specification
</title>
30 <funcdef>void
<function>glPopMatrix
</function></funcdef>
31 <paramdef> <parameter>void
</parameter></paramdef>
35 <refsect1 id=
"description"><title>Description
</title>
37 There is a stack of matrices for each of the matrix modes.
38 In
<constant>GL_MODELVIEW
</constant> mode,
39 the stack depth is at least
32.
41 <constant>GL_COLOR
</constant>,
<constant>GL_PROJECTION
</constant>, and
<constant>GL_TEXTURE
</constant>,
42 the depth is at least
2.
43 The current matrix in any mode is the matrix on the top of the stack
47 <function>glPushMatrix
</function> pushes the current matrix stack down by one,
48 duplicating the current matrix.
50 after a
<function>glPushMatrix
</function> call,
51 the matrix on top of the stack is identical to the one below it.
54 <citerefentry><refentrytitle>glPopMatrix
</refentrytitle></citerefentry> pops the current matrix stack,
55 replacing the current matrix with the one below it on the stack.
58 Initially, each of the stacks contains one matrix, an identity matrix.
61 It is an error to push a full matrix stack
62 or to pop a matrix stack that contains only a single matrix.
63 In either case, the error flag is set
64 and no other change is made to GL state.
67 <refsect1 id=
"errors"><title>Errors
</title>
69 <constant>GL_STACK_OVERFLOW
</constant> is generated if
<function>glPushMatrix
</function> is called while
70 the current matrix stack is full.
73 <constant>GL_STACK_UNDERFLOW
</constant> is generated if
<citerefentry><refentrytitle>glPopMatrix
</refentrytitle></citerefentry> is called while
74 the current matrix stack contains only a single matrix.
77 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glPushMatrix
</function> or
<citerefentry><refentrytitle>glPopMatrix
</refentrytitle></citerefentry>
78 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
79 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
82 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
84 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MATRIX_MODE
</constant>
87 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_MATRIX
</constant>
90 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MODELVIEW_MATRIX
</constant>
93 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PROJECTION_MATRIX
</constant>
96 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_MATRIX
</constant>
99 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_MATRIX_STACK_DEPTH
</constant>
102 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MODELVIEW_STACK_DEPTH
</constant>
105 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PROJECTION_STACK_DEPTH
</constant>
108 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_STACK_DEPTH
</constant>
111 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MAX_MODELVIEW_STACK_DEPTH
</constant>
114 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MAX_PROJECTION_STACK_DEPTH
</constant>
117 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MAX_TEXTURE_STACK_DEPTH
</constant>
120 <refsect1 id=
"seealso"><title>See Also
</title>
122 <citerefentry><refentrytitle>glFrustum
</refentrytitle></citerefentry>,
123 <citerefentry><refentrytitle>glLoadIdentity
</refentrytitle></citerefentry>,
124 <citerefentry><refentrytitle>glLoadMatrix
</refentrytitle></citerefentry>,
125 <citerefentry><refentrytitle>glLoadTransposeMatrix
</refentrytitle></citerefentry>,
126 <citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>,
127 <citerefentry><refentrytitle>glMultMatrix
</refentrytitle></citerefentry>,
128 <citerefentry><refentrytitle>glMultTransposeMatrix
</refentrytitle></citerefentry>,
129 <citerefentry><refentrytitle>glOrtho
</refentrytitle></citerefentry>,
130 <citerefentry><refentrytitle>glRotate
</refentrytitle></citerefentry>,
131 <citerefentry><refentrytitle>glScale
</refentrytitle></citerefentry>,
132 <citerefentry><refentrytitle>glTranslate
</refentrytitle></citerefentry>,
133 <citerefentry><refentrytitle>glViewport
</refentrytitle></citerefentry>
136 <refsect1 id=
"Copyright"><title>Copyright
</title>
138 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
139 Silicon Graphics, Inc. This document is licensed under the SGI
140 Free Software B License. For details, see
141 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.