summaryrefslogtreecommitdiffstats
path: root/src/graphics/opengl/gldevice.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-18 19:08:34 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-18 19:08:34 +0200
commitf364f378cf497faf61d78aadd8f1aebce678c0ec (patch)
tree02de3c2415247a7856a02657b1eff9500b5d1e50 /src/graphics/opengl/gldevice.cpp
parent68a7bafe37adef0e5ef12c2d0e8461a21e05363b (diff)
downloadcolobot-f364f378cf497faf61d78aadd8f1aebce678c0ec.tar.gz
colobot-f364f378cf497faf61d78aadd8f1aebce678c0ec.tar.bz2
colobot-f364f378cf497faf61d78aadd8f1aebce678c0ec.zip
Fixed OpenGL transformations
- fixed wrong order of transformations - added transform_test
Diffstat (limited to 'src/graphics/opengl/gldevice.cpp')
-rw-r--r--src/graphics/opengl/gldevice.cpp10
1 files changed, 5 insertions, 5 deletions
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());
}