added Window-isms previously in gl.h
[mesa.git] / src / mesa / main / matrix.h
1 /* $Id: matrix.h,v 1.5 1999/12/10 20:01:06 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 *
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 */
26
27
28 #ifndef MATRIX_H
29 #define MATRIX_H
30
31
32 #include "types.h"
33 #include "config.h"
34
35
36 typedef struct {
37 GLfloat m[16];
38 GLfloat *inv; /* optional */
39 GLuint flags;
40 GLuint type;
41 } GLmatrix;
42
43
44 #ifdef VMS
45 #define gl_calculate_model_project_matrix gl_calculate_model_project_matr
46 #endif
47
48
49 extern void gl_matrix_transposef( GLfloat to[16], const GLfloat from[16] );
50
51 extern void gl_matrix_transposed( GLdouble to[16], const GLdouble from[16] );
52
53
54 extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z,
55 GLfloat m[] );
56
57
58 extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags );
59
60 extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 );
61
62 extern void gl_calculate_model_project_matrix( GLcontext *ctx );
63
64 extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from );
65
66 extern void gl_matrix_ctr( GLmatrix *m );
67
68 extern void gl_matrix_dtr( GLmatrix *m );
69
70 extern void gl_matrix_alloc_inv( GLmatrix *m );
71
72 extern void gl_matrix_mul( GLmatrix *dest,
73 const GLmatrix *a,
74 const GLmatrix *b );
75
76 extern void gl_matrix_analyze( GLmatrix *mat );
77
78 extern GLboolean gl_matrix_invert( GLmatrix *mat );
79
80 extern void gl_print_matrix( const GLmatrix *m );
81
82
83
84 extern void
85 _mesa_Frustum( GLdouble left, GLdouble right,
86 GLdouble bottom, GLdouble top,
87 GLdouble nearval, GLdouble farval );
88
89 extern void
90 _mesa_Ortho( GLdouble left, GLdouble right,
91 GLdouble bottom, GLdouble top,
92 GLdouble nearval, GLdouble farval );
93
94 extern void
95 _mesa_PushMatrix( void );
96
97 extern void
98 _mesa_PopMatrix( void );
99
100 extern void
101 _mesa_LoadIdentity( void );
102
103 extern void
104 _mesa_LoadMatrixf( const GLfloat *m );
105
106 extern void
107 _mesa_LoadMatrixd( const GLdouble *m );
108
109 extern void
110 _mesa_MatrixMode( GLenum mode );
111
112 extern void
113 _mesa_MultMatrixf( const GLfloat *m );
114
115 extern void
116 _mesa_MultMatrixd( const GLdouble *m );
117
118 extern void
119 _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
120
121 extern void
122 _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z );
123
124 extern void
125 _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z );
126
127 extern void
128 _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z );
129
130 extern void
131 _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z );
132
133 extern void
134 _mesa_Translated( GLdouble x, GLdouble y, GLdouble z );
135
136 extern void
137 _mesa_LoadTransposeMatrixfARB( const GLfloat *m );
138
139 extern void
140 _mesa_LoadTransposeMatrixdARB( const GLdouble *m );
141
142 extern void
143 _mesa_MultTransposeMatrixfARB( const GLfloat *m );
144
145 extern void
146 _mesa_MultTransposeMatrixdARB( const GLdouble *m );
147
148 extern void
149 _mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height );
150
151 extern void
152 gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height );
153
154 extern void
155 _mesa_DepthRange( GLclampd nearval, GLclampd farval );
156
157
158
159 #endif