summaryrefslogtreecommitdiff
path: root/doc/gl-docs/GL/gl/pushmatrix.3gl
blob: 294efd4a14cbc9545fad83ec9eed3034e5559cf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 pushmatri
.ds Xs 41127 5 pushmatrix.gl
.TH GLPUSHMATRIX 3G
.SH NAME
.B "glPushMatrix, glPopMatrix
\- push and pop the current matrix stack

.SH C SPECIFICATION
void \f3glPushMatrix\fP( void )
.nf
.fi

.SH C SPECIFICATION
void \f3glPopMatrix\fP( void )
.nf
.fi

.SH DESCRIPTION
There is a stack of matrices for each of the matrix modes.
In \%\f3GL_MODELVIEW\fP mode,
the stack depth is at least 32.
In the other modes,
\%\f3GL_COLOR\fP, const(PROJECTION), and \%\f3GL_TEXTURE\fP,
the depth is at least 2.
The current matrix in any mode is the matrix on the top of the stack
for that mode.
.P
\%\f3glPushMatrix\fP pushes the current matrix stack down by one,
duplicating the current matrix.
That is,
after a \%\f3glPushMatrix\fP call,
the matrix on top of the stack is identical to the one below it.
.P
\%\f3glPopMatrix\fP pops the current matrix stack,
replacing the current matrix with the one below it on the stack. 
.P
Initially, each of the stacks contains one matrix, an identity matrix.
.P
It is an error to push a full matrix stack,
or to pop a matrix stack that contains only a single matrix.
In either case, the error flag is set
and no other change is made to GL state.
.SH ERRORS
\%\f3GL_STACK_OVERFLOW\fP is generated if \%\f3glPushMatrix\fP is called while
the current matrix stack is full.
.P
\%\f3GL_STACK_UNDERFLOW\fP is generated if \%\f3glPopMatrix\fP is called while
the current matrix stack contains only a single matrix.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glPushMatrix\fP or \%\f3glPopMatrix\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_MATRIX_MODE\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MODELVIEW_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_PROJECTION_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_TEXTURE_MATRIX\fP
.br
\%\f3glGet\fP with argument \%\f3GL_COLOR_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MODELVIEW_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_PROJECTION_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_TEXTURE_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAX_MODELVIEW_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAX_PROJECTION_STACK_DEPTH\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAX_TEXTURE_STACK_DEPTH\fP
.SH SEE ALSO
\%\f3glFrustum(3G)\fP, 
\%\f3glLoadIdentity(3G)\fP,
\%\f3glLoadMatrix(3G)\fP,
\%\f3glMatrixMode(3G)\fP,
\%\f3glMultMatrix(3G)\fP,
\%\f3glOrtho(3G)\fP,
\%\f3glRotate(3G)\fP,
\%\f3glScale(3G)\fP,
\%\f3glTranslate(3G)\fP,
\%\f3glViewport(3G)\fP