Commit 3ffd6b73 authored by bitplane's avatar bitplane

opengl render targets were flipped again after drawing 2d stuff

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@791 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 71c42fb1
...@@ -1218,6 +1218,27 @@ void COpenGLDriver::setRenderStates3DMode() ...@@ -1218,6 +1218,27 @@ void COpenGLDriver::setRenderStates3DMode()
createGLMatrix(glmat, Matrices[ETS_PROJECTION]); createGLMatrix(glmat, Matrices[ETS_PROJECTION]);
glmat[12] *= -1.0f; glmat[12] *= -1.0f;
// in render targets, flip the screen
if ( CurrentRendertargetSize.Width > 0 )
{
glmat[5] *= -1.0f;
// because we flipped the screen, triangles are the wrong way around
if (ClockwiseWinding)
{
glFrontFace(GL_CCW);
ClockwiseWinding = false;
}
}
else
{
if (!ClockwiseWinding)
{
glFrontFace(GL_CW);
ClockwiseWinding = true;
}
}
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadMatrixf(glmat); glLoadMatrixf(glmat);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment