From f364f378cf497faf61d78aadd8f1aebce678c0ec Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 18 Jul 2012 19:08:34 +0200 Subject: Fixed OpenGL transformations - fixed wrong order of transformations - added transform_test --- src/graphics/opengl/gldevice.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/graphics/opengl/gldevice.cpp') diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp index e329ff4..b8f3bed 100644 --- a/src/graphics/opengl/gldevice.cpp +++ b/src/graphics/opengl/gldevice.cpp @@ -179,7 +179,7 @@ void Gfx::CGLDevice::BeginScene() void Gfx::CGLDevice::EndScene() { - glFinish(); + glFlush(); } void Gfx::CGLDevice::Clear() @@ -192,14 +192,14 @@ void Gfx::CGLDevice::SetTransform(Gfx::TransformType type, const Math::Matrix &m if (type == Gfx::TRANSFORM_WORLD) { m_worldMat = matrix; - m_modelviewMat = Math::MultiplyMatrices(m_worldMat, m_viewMat); + m_modelviewMat = Math::MultiplyMatrices(m_viewMat, m_worldMat); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(m_modelviewMat.Array()); } else if (type == Gfx::TRANSFORM_VIEW) { m_viewMat = matrix; - m_modelviewMat = Math::MultiplyMatrices(m_worldMat, m_viewMat); + m_modelviewMat = Math::MultiplyMatrices(m_viewMat, m_worldMat); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(m_modelviewMat.Array()); } @@ -234,14 +234,14 @@ void Gfx::CGLDevice::MultiplyTransform(Gfx::TransformType type, const Math::Matr if (type == Gfx::TRANSFORM_WORLD) { m_worldMat = Math::MultiplyMatrices(m_worldMat, matrix); - m_modelviewMat = Math::MultiplyMatrices(m_worldMat, m_viewMat); + m_modelviewMat = Math::MultiplyMatrices(m_viewMat, m_worldMat); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(m_modelviewMat.Array()); } else if (type == Gfx::TRANSFORM_VIEW) { m_viewMat = Math::MultiplyMatrices(m_viewMat, matrix); - m_modelviewMat = Math::MultiplyMatrices(m_worldMat, m_viewMat); + m_modelviewMat = Math::MultiplyMatrices(m_viewMat, m_worldMat); glMatrixMode(GL_MODELVIEW); glLoadMatrixf(m_modelviewMat.Array()); } -- cgit v1.2.3-1-g7c22