From a4b36e6d1e20b5036d1ed7cf9f61a48dbbf77812 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 27 Apr 2008 13:08:12 +0000 Subject: 3D flight --- src/render/gl.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/render/gl.cc') 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) { -- cgit v1.2.3