]> git.tdb.fi Git - libs/gl.git/blob - source/matrix.cpp
Move transform functions to matrix.h
[libs/gl.git] / source / matrix.cpp
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 #include "matrix.h"
9
10 namespace Msp {
11 namespace GL {
12
13 void matrix_mode(MatrixMode m)
14 {
15         glMatrixMode(m);
16 }
17
18 void load_identity()
19 {
20         glLoadIdentity();
21 }
22
23 void mult_matrix(const float *matrix)
24 {
25         glMultMatrixf(matrix);
26 }
27
28 void mult_matrix(const double *matrix)
29 {
30         glMultMatrixd(matrix);
31 }
32
33 void push_matrix()
34 {
35         glPushMatrix();
36 }
37
38 void pop_matrix()
39 {
40         glPopMatrix();
41 }
42
43 void translate(float x, float y, float z)
44 {
45         glTranslatef(x, y, z);
46 }
47
48 void rotate(float a, float x, float y, float z)
49 {
50         glRotatef(a, x, y, z);
51 }
52
53 void scale(float x, float y, float z)
54 {
55         glScalef(x, y, z);
56 }
57
58 void scale_uniform(float s)
59 {
60         scale(s, s, s);
61 }
62
63 } // namespace GL
64 } // namespace Msp