source: trunk/src/opengl/mesa/matrix.h@ 3582

Last change on this file since 3582 was 2938, checked in by sandervl, 25 years ago

created

File size: 3.5 KB
Line 
1/* $Id: matrix.h,v 1.1 2000-02-29 00:48:33 sandervl Exp $ */
2
3/*
4 * Mesa 3-D graphics library
5 * Version: 3.1
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
29
30
31#ifndef MATRIX_H
32#define MATRIX_H
33
34
35#include "gl.h"
36#include "config.h"
37
38typedef struct {
39 GLfloat m[16];
40 GLfloat *inv; /* optional */
41 GLuint flags;
42 GLuint type;
43} GLmatrix;
44
45#ifdef VMS
46#define gl_calculate_model_project_matrix gl_calculate_model_project_matr
47#endif
48
49
50extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z,
51 GLfloat m[] );
52
53
54
55extern void gl_Frustum( GLcontext *ctx,
56 GLdouble left, GLdouble right,
57 GLdouble bottom, GLdouble top,
58 GLdouble nearval, GLdouble farval );
59
60extern void gl_Ortho( GLcontext *ctx,
61 GLdouble left, GLdouble right,
62 GLdouble bottom, GLdouble top,
63 GLdouble nearval, GLdouble farval );
64
65extern void gl_PushMatrix( GLcontext *ctx );
66
67extern void gl_PopMatrix( GLcontext *ctx );
68
69extern void gl_LoadIdentity( GLcontext *ctx );
70
71extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m );
72
73extern void gl_MatrixMode( GLcontext *ctx, GLenum mode );
74
75extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m );
76
77extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags );
78extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 );
79
80extern void gl_Rotatef( GLcontext *ctx,
81 GLfloat angle, GLfloat x, GLfloat y, GLfloat z );
82
83extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );
84
85extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z );
86
87extern void gl_Viewport( GLcontext *ctx,
88 GLint x, GLint y, GLsizei width, GLsizei height );
89
90extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval );
91
92
93
94
95
96extern void gl_calculate_model_project_matrix( GLcontext *ctx );
97
98
99extern void gl_matrix_ctr( GLmatrix *m );
100
101extern void gl_matrix_dtr( GLmatrix *m );
102
103extern void gl_matrix_alloc_inv( GLmatrix *m );
104
105extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from );
106
107extern void gl_matrix_mul( GLmatrix *dest,
108 const GLmatrix *a,
109 const GLmatrix *b );
110
111extern void gl_matrix_analyze( GLmatrix *mat );
112
113
114extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m );
115extern GLboolean gl_matrix_invert( GLmatrix *mat );
116extern void gl_print_matrix( const GLmatrix *m );
117
118
119#endif
Note: See TracBrowser for help on using the repository browser.