]> git.tdb.fi Git - libs/gl.git/blob - source/matrix.cpp
Add Vector3 and Vector4 classes
[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 load_matrix(const float *matrix)
24 {
25         glLoadMatrixf(matrix);
26 }
27
28 void load_matrix(const double *matrix)
29 {
30         glLoadMatrixd(matrix);
31 }
32
33 void mult_matrix(const float *matrix)
34 {
35         glMultMatrixf(matrix);
36 }
37
38 void mult_matrix(const double *matrix)
39 {
40         glMultMatrixd(matrix);
41 }
42
43 void push_matrix()
44 {
45         glPushMatrix();
46 }
47
48 void pop_matrix()
49 {
50         glPopMatrix();
51 }
52
53 void translate(float x, float y, float z)
54 {
55         glTranslatef(x, y, z);
56 }
57
58 void rotate(float a, float x, float y, float z)
59 {
60         glRotatef(a, x, y, z);
61 }
62
63 void scale(float x, float y, float z)
64 {
65         glScalef(x, y, z);
66 }
67
68 void scale_uniform(float s)
69 {
70         scale(s, s, s);
71 }
72
73 } // namespace GL
74 } // namespace Msp