]> git.tdb.fi Git - libs/gl.git/blobdiff - source/matrix.cpp
Add Vector3 and Vector4 classes
[libs/gl.git] / source / matrix.cpp
index dc855d2b0899f638782b1e2bc44cf52d157948d7..9af850d2dfa68956037be0e4854716813fdc79a6 100644 (file)
@@ -1,3 +1,10 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
 #include "matrix.h"
 
 namespace Msp {
@@ -13,6 +20,16 @@ void load_identity()
        glLoadIdentity();
 }
 
+void load_matrix(const float *matrix)
+{
+       glLoadMatrixf(matrix);
+}
+
+void load_matrix(const double *matrix)
+{
+       glLoadMatrixd(matrix);
+}
+
 void mult_matrix(const float *matrix)
 {
        glMultMatrixf(matrix);
@@ -33,5 +50,25 @@ void pop_matrix()
        glPopMatrix();
 }
 
+void translate(float x, float y, float z)
+{
+       glTranslatef(x, y, z);
+}
+
+void rotate(float a, float x, float y, float z)
+{
+       glRotatef(a, x, y, z);
+}
+
+void scale(float x, float y, float z)
+{
+       glScalef(x, y, z);
+}
+
+void scale_uniform(float s)
+{
+       scale(s, s, s);
+}
+
 } // namespace GL
 } // namespace Msp