diff options
author | Stijn Buys <ingar@osirion.org> | 2008-04-27 13:08:12 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-04-27 13:08:12 +0000 |
commit | a4b36e6d1e20b5036d1ed7cf9f61a48dbbf77812 (patch) | |
tree | 7efd0048fd8c10b1f04d427c78e3ac8da402f059 /src/render/gl.cc | |
parent | fe95954f9d17c9dade1827fe5d4cf8cffffddbce (diff) |
3D flight
Diffstat (limited to 'src/render/gl.cc')
-rw-r--r-- | src/render/gl.cc | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/render/gl.cc b/src/render/gl.cc index a5f2d99..37ff75f 100644 --- a/src/render/gl.cc +++ b/src/render/gl.cc @@ -7,6 +7,8 @@ #include "GL/gl.h" #include "render/gl.h" +#include "math/matrix4f.h" + using math::Vector3f; using math::Color; @@ -121,7 +123,7 @@ void scale(const float x, const float y, const float z) { } void vertex(const Vector3f& vector) { - glVertex3fv(vector.coord); + glVertex3fv(vector.ptr()); } void vertex(const float x, const float y, const float z) { @@ -129,7 +131,7 @@ void vertex(const float x, const float y, const float z) { } void normal(const Vector3f & vector) { - glNormal3fv(vector.coord); + glNormal3fv(vector.ptr()); } void normal(const float x, const float y, const float z) { @@ -144,11 +146,22 @@ void pop() { glPopMatrix(); } +void multmatrix(const math::Matrix4f & matrix) +{ + glMultMatrixf(matrix.ptr()); +} + +void multmatrix(const math::Axis & axis) +{ + math::Matrix4f matrix(axis); + glMultMatrixf(matrix.ptr()); +} + void color(const float r, const float g, const float b, const float a) { glColor4f(r,g,b,a); } void color(Color const & color) { - glColor4fv(color.rgba_data); + glColor4fv(color.ptr()); } void matrixmode(GLenum mode) { |