diff options
author | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-04-08 22:00:04 +0200 |
---|---|---|
committer | Dennis Kasprzyk <onestone@opencompositing.org> | 2008-04-08 22:00:04 +0200 |
commit | 78161d469e844a89acd43627d92ce1705274c217 (patch) | |
tree | 3746275c0df8fd10b1173e0cb257dac4f8376d25 | |
parent | bb8317d6e18a1c2da587f3313fadae42715e04a1 (diff) |
Flip cull face instead of disabling it.
-rw-r--r-- | plugins/cube.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/plugins/cube.c b/plugins/cube.c index 61067116..60aa28eb 100644 --- a/plugins/cube.c +++ b/plugins/cube.c @@ -1417,7 +1417,8 @@ cubePaintTransformedOutput (CompScreen *s, Bool capsPainted; Bool wasCulled = FALSE; Bool topDir, bottomDir, allCaps; - int output = 0; + int cullNorm, cullInv; + int output = 0; CUBE_SCREEN (s); @@ -1434,6 +1435,8 @@ cubePaintTransformedOutput (CompScreen *s, hsize = s->hsize * cs->nOutput; size = hsize; + glGetIntegerv (GL_CULL_FACE_MODE, &cullNorm); + cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK; wasCulled = glIsEnabled (GL_CULL_FACE); if (!cs->fullscreenOutput) @@ -1522,8 +1525,7 @@ cubePaintTransformedOutput (CompScreen *s, { /* Outside cube - start with FTB faces */ paintOrder = FTB; - if (wasCulled && cs->paintAllViewports) - glDisable (GL_CULL_FACE); + glCullFace (cullInv); } else { @@ -1535,6 +1537,8 @@ cubePaintTransformedOutput (CompScreen *s, cubePaintAllViewports (s, &sa, transform, region, outputPtr, mask, xMove, size, hsize, paintOrder); + glCullFace (cullNorm); + if (wasCulled && cs->paintAllViewports) glDisable (GL_CULL_FACE); @@ -1594,17 +1598,19 @@ cubePaintTransformedOutput (CompScreen *s, glNormal3f (0.0f, 0.0f, -1.0f); } + if (wasCulled) + glEnable (GL_CULL_FACE); + if (cs->invert == 1) { /* Outside cube - continue with BTF faces */ paintOrder = BTF; - if (wasCulled && cs->paintAllViewports) - glEnable (GL_CULL_FACE); } else { /* Inside cube - continue with FTB faces */ paintOrder = FTB; + glCullFace (cullInv); } if (cs->invert == 1 || cs->paintAllViewports) @@ -1612,10 +1618,9 @@ cubePaintTransformedOutput (CompScreen *s, outputPtr, mask, xMove, size, hsize, paintOrder); - s->display->textureFilter = filter; + glCullFace (cullNorm); - if (wasCulled) - glEnable (GL_CULL_FACE); + s->display->textureFilter = filter; WRAP (cs, s, paintTransformedOutput, cubePaintTransformedOutput); } |