rename upstream-man-pages to upstream-doc
[clinton/guile-figl.git] / upstream-doc / man2 / glPushMatrix.xml
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">
5 <refmeta>
6 <refmetainfo>
7 <copyright>
8 <year>1991-2006</year>
9 <holder>Silicon Graphics, Inc.</holder>
10 </copyright>
11 </refmetainfo>
12 <refentrytitle>glPushMatrix</refentrytitle>
13 <manvolnum>3G</manvolnum>
14 </refmeta>
15 <refnamediv>
16 <refname>glPushMatrix</refname>
17 <refpurpose>push and pop the current matrix stack</refpurpose>
18 </refnamediv>
19 <refsynopsisdiv><title>C Specification</title>
20 <funcsynopsis>
21 <funcprototype>
22 <funcdef>void <function>glPushMatrix</function></funcdef>
23 <paramdef> <parameter>void</parameter></paramdef>
24 </funcprototype>
25 </funcsynopsis>
26 </refsynopsisdiv>
27 <refsynopsisdiv><title>C Specification</title>
28 <funcsynopsis>
29 <funcprototype>
30 <funcdef>void <function>glPopMatrix</function></funcdef>
31 <paramdef> <parameter>void</parameter></paramdef>
32 </funcprototype>
33 </funcsynopsis>
34 </refsynopsisdiv>
35 <refsect1 id="description"><title>Description</title>
36 <para>
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.
40 In the other modes,
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
44 for that mode.
45 </para>
46 <para>
47 <function>glPushMatrix</function> pushes the current matrix stack down by one,
48 duplicating the current matrix.
49 That is,
50 after a <function>glPushMatrix</function> call,
51 the matrix on top of the stack is identical to the one below it.
52 </para>
53 <para>
54 <citerefentry><refentrytitle>glPopMatrix</refentrytitle></citerefentry> pops the current matrix stack,
55 replacing the current matrix with the one below it on the stack.
56 </para>
57 <para>
58 Initially, each of the stacks contains one matrix, an identity matrix.
59 </para>
60 <para>
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.
65 </para>
66 </refsect1>
67 <refsect1 id="errors"><title>Errors</title>
68 <para>
69 <constant>GL_STACK_OVERFLOW</constant> is generated if <function>glPushMatrix</function> is called while
70 the current matrix stack is full.
71 </para>
72 <para>
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.
75 </para>
76 <para>
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>.
80 </para>
81 </refsect1>
82 <refsect1 id="associatedgets"><title>Associated Gets</title>
83 <para>
84 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MATRIX_MODE</constant>
85 </para>
86 <para>
87 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_MATRIX</constant>
88 </para>
89 <para>
90 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MODELVIEW_MATRIX</constant>
91 </para>
92 <para>
93 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PROJECTION_MATRIX</constant>
94 </para>
95 <para>
96 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_MATRIX</constant>
97 </para>
98 <para>
99 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_MATRIX_STACK_DEPTH</constant>
100 </para>
101 <para>
102 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MODELVIEW_STACK_DEPTH</constant>
103 </para>
104 <para>
105 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PROJECTION_STACK_DEPTH</constant>
106 </para>
107 <para>
108 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_STACK_DEPTH</constant>
109 </para>
110 <para>
111 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MAX_MODELVIEW_STACK_DEPTH</constant>
112 </para>
113 <para>
114 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MAX_PROJECTION_STACK_DEPTH</constant>
115 </para>
116 <para>
117 <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_MAX_TEXTURE_STACK_DEPTH</constant>
118 </para>
119 </refsect1>
120 <refsect1 id="seealso"><title>See Also</title>
121 <para>
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>
134 </para>
135 </refsect1>
136 <refsect1 id="Copyright"><title>Copyright</title>
137 <para>
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>.
142 </para>
143 </refsect1>
144 </refentry>