| 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 |  | 
|---|
| 38 | typedef 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 |  | 
|---|
| 50 | extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z, | 
|---|
| 51 | GLfloat m[] ); | 
|---|
| 52 |  | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | extern void gl_Frustum( GLcontext *ctx, | 
|---|
| 56 | GLdouble left, GLdouble right, | 
|---|
| 57 | GLdouble bottom, GLdouble top, | 
|---|
| 58 | GLdouble nearval, GLdouble farval ); | 
|---|
| 59 |  | 
|---|
| 60 | extern void gl_Ortho( GLcontext *ctx, | 
|---|
| 61 | GLdouble left, GLdouble right, | 
|---|
| 62 | GLdouble bottom, GLdouble top, | 
|---|
| 63 | GLdouble nearval, GLdouble farval ); | 
|---|
| 64 |  | 
|---|
| 65 | extern void gl_PushMatrix( GLcontext *ctx ); | 
|---|
| 66 |  | 
|---|
| 67 | extern void gl_PopMatrix( GLcontext *ctx ); | 
|---|
| 68 |  | 
|---|
| 69 | extern void gl_LoadIdentity( GLcontext *ctx ); | 
|---|
| 70 |  | 
|---|
| 71 | extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ); | 
|---|
| 72 |  | 
|---|
| 73 | extern void gl_MatrixMode( GLcontext *ctx, GLenum mode ); | 
|---|
| 74 |  | 
|---|
| 75 | extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ); | 
|---|
| 76 |  | 
|---|
| 77 | extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); | 
|---|
| 78 | extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); | 
|---|
| 79 |  | 
|---|
| 80 | extern void gl_Rotatef( GLcontext *ctx, | 
|---|
| 81 | GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); | 
|---|
| 82 |  | 
|---|
| 83 | extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); | 
|---|
| 84 |  | 
|---|
| 85 | extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); | 
|---|
| 86 |  | 
|---|
| 87 | extern void gl_Viewport( GLcontext *ctx, | 
|---|
| 88 | GLint x, GLint y, GLsizei width, GLsizei height ); | 
|---|
| 89 |  | 
|---|
| 90 | extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval ); | 
|---|
| 91 |  | 
|---|
| 92 |  | 
|---|
| 93 |  | 
|---|
| 94 |  | 
|---|
| 95 |  | 
|---|
| 96 | extern void gl_calculate_model_project_matrix( GLcontext *ctx ); | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 | extern void gl_matrix_ctr( GLmatrix *m ); | 
|---|
| 100 |  | 
|---|
| 101 | extern void gl_matrix_dtr( GLmatrix *m ); | 
|---|
| 102 |  | 
|---|
| 103 | extern void gl_matrix_alloc_inv( GLmatrix *m ); | 
|---|
| 104 |  | 
|---|
| 105 | extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); | 
|---|
| 106 |  | 
|---|
| 107 | extern void gl_matrix_mul( GLmatrix *dest, | 
|---|
| 108 | const GLmatrix *a, | 
|---|
| 109 | const GLmatrix *b ); | 
|---|
| 110 |  | 
|---|
| 111 | extern void gl_matrix_analyze( GLmatrix *mat ); | 
|---|
| 112 |  | 
|---|
| 113 |  | 
|---|
| 114 | extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m ); | 
|---|
| 115 | extern GLboolean gl_matrix_invert( GLmatrix *mat ); | 
|---|
| 116 | extern void gl_print_matrix( const GLmatrix *m ); | 
|---|
| 117 |  | 
|---|
| 118 |  | 
|---|
| 119 | #endif | 
|---|