]> git.tdb.fi Git - libs/gl.git/blob - source/matrix.h
Move transform functions to matrix.h
[libs/gl.git] / source / matrix.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_MATRIX_H_
9 #define MSP_GL_MATRIX_H_
10
11 #include "gl.h"
12
13 namespace Msp {
14 namespace GL {
15
16 enum MatrixMode
17 {
18         MODELVIEW=GL_MODELVIEW,
19         PROJECTION=GL_PROJECTION,
20         TEXTURE=GL_TEXTURE
21 };
22
23 void matrix_mode(MatrixMode);
24 void load_identity();
25 void mult_matrix(const float *);
26 void mult_matrix(const double *);
27 void push_matrix();
28 void pop_matrix();
29
30 /// RAII object - pushes matrix when constructed and pops when destroyed
31 struct PushMatrix
32 {
33         PushMatrix() { push_matrix(); }
34         ~PushMatrix() { pop_matrix(); }
35 };
36
37 void translate(float, float, float);
38 void rotate(float, float, float, float);
39 void scale(float, float, float);
40 void scale_uniform(float);
41
42 } // namespace GL
43 } // namespace Msp
44
45 #endif