1 /* 2 * Mesa 3-D graphics library 3 * 4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice shall be included 15 * in all copies or substantial portions of the Software. 16 * 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 * OTHER DEALINGS IN THE SOFTWARE. 24 */ 25 26 27 #ifndef MATRIX_H 28 #define MATRIX_H 29 30 31 #include "glheader.h" 32 33 struct gl_context; 34 struct gl_matrix_stack; 35 36 extern void 37 _mesa_load_identity_matrix(struct gl_context *ctx, struct gl_matrix_stack *s); 38 39 extern void 40 _mesa_load_matrix(struct gl_context *ctx, struct gl_matrix_stack *s, 41 const GLfloat *m); 42 43 extern void GLAPIENTRY 44 _mesa_Frustum( GLdouble left, GLdouble right, 45 GLdouble bottom, GLdouble top, 46 GLdouble nearval, GLdouble farval ); 47 48 extern void GLAPIENTRY 49 _mesa_Ortho( GLdouble left, GLdouble right, 50 GLdouble bottom, GLdouble top, 51 GLdouble nearval, GLdouble farval ); 52 53 extern void GLAPIENTRY 54 _mesa_PushMatrix( void ); 55 56 extern void GLAPIENTRY 57 _mesa_PopMatrix( void ); 58 59 extern void GLAPIENTRY 60 _mesa_LoadIdentity( void ); 61 62 extern void GLAPIENTRY 63 _mesa_LoadMatrixf( const GLfloat *m ); 64 65 extern void GLAPIENTRY 66 _mesa_LoadMatrixd( const GLdouble *m ); 67 68 extern void GLAPIENTRY 69 _mesa_MatrixMode( GLenum mode ); 70 71 extern void GLAPIENTRY 72 _mesa_MultMatrixf( const GLfloat *m ); 73 74 extern void GLAPIENTRY 75 _mesa_MultMatrixd( const GLdouble *m ); 76 77 extern void GLAPIENTRY 78 _mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); 79 80 extern void GLAPIENTRY 81 _mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); 82 83 extern void GLAPIENTRY 84 _mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ); 85 86 extern void GLAPIENTRY 87 _mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ); 88 89 extern void GLAPIENTRY 90 _mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ); 91 92 extern void GLAPIENTRY 93 _mesa_Translated( GLdouble x, GLdouble y, GLdouble z ); 94 95 extern void GLAPIENTRY 96 _mesa_LoadTransposeMatrixf( const GLfloat *m ); 97 98 extern void GLAPIENTRY 99 _mesa_LoadTransposeMatrixd( const GLdouble *m ); 100 101 extern void GLAPIENTRY 102 _mesa_MultTransposeMatrixf( const GLfloat *m ); 103 104 extern void GLAPIENTRY 105 _mesa_MultTransposeMatrixd( const GLdouble *m ); 106 107 extern void GLAPIENTRY 108 _mesa_MatrixLoadfEXT( GLenum matrixMode, const GLfloat *m ); 109 110 extern void GLAPIENTRY 111 _mesa_MatrixLoaddEXT( GLenum matrixMode, const GLdouble *m ); 112 113 extern void GLAPIENTRY 114 _mesa_MatrixMultfEXT( GLenum matrixMode, const GLfloat *m ); 115 116 extern void GLAPIENTRY 117 _mesa_MatrixMultdEXT( GLenum matrixMode, const GLdouble *m ); 118 119 extern void GLAPIENTRY 120 _mesa_MatrixLoadIdentityEXT( GLenum matrixMode ); 121 122 extern void GLAPIENTRY 123 _mesa_MatrixRotatefEXT( GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); 124 125 extern void GLAPIENTRY 126 _mesa_MatrixRotatedEXT( GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); 127 128 extern void GLAPIENTRY 129 _mesa_MatrixScalefEXT( GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z ); 130 131 extern void GLAPIENTRY 132 _mesa_MatrixScaledEXT( GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z ); 133 134 extern void GLAPIENTRY 135 _mesa_MatrixTranslatefEXT( GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z ); 136 137 extern void GLAPIENTRY 138 _mesa_MatrixTranslatedEXT( GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z ); 139 140 extern void GLAPIENTRY 141 _mesa_MatrixOrthoEXT( GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, 142 GLdouble n, GLdouble f ); 143 144 extern void GLAPIENTRY 145 _mesa_MatrixFrustumEXT( GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, 146 GLdouble n, GLdouble f ); 147 148 extern void GLAPIENTRY 149 _mesa_MatrixPushEXT( GLenum matrixMode ); 150 151 extern void GLAPIENTRY 152 _mesa_MatrixPopEXT( GLenum matrixMode ); 153 154 extern void GLAPIENTRY 155 _mesa_MatrixLoadTransposefEXT( GLenum matrixMode, const GLfloat* m ); 156 157 extern void GLAPIENTRY 158 _mesa_MatrixLoadTransposedEXT( GLenum matrixMode, const GLdouble* m ); 159 160 extern void GLAPIENTRY 161 _mesa_MatrixMultTransposefEXT( GLenum matrixMode, const GLfloat* m ); 162 163 extern void GLAPIENTRY 164 _mesa_MatrixMultTransposedEXT( GLenum matrixMode, const GLdouble* m ); 165 166 extern void 167 _mesa_init_matrix( struct gl_context * ctx ); 168 169 extern void 170 _mesa_init_transform( struct gl_context *ctx ); 171 172 extern void 173 _mesa_free_matrix_data( struct gl_context *ctx ); 174 175 extern void 176 _mesa_update_modelview_project( struct gl_context *ctx, GLuint newstate ); 177 178 179 #endif 180