summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-01-28 17:02:34 +0100
committerDennis kasprzyk <onestone@opencompositing.org>2008-01-28 17:02:34 +0100
commit396b9200d5e62df30ca061a74c75d359e12662c5 (patch)
tree00f4256c93eeb856a2d9a803186b4f405918a0e5
parent59e03c1b5ade27844ed1250b650e59e0d23c587e (diff)
download3d-396b9200d5e62df30ca061a74c75d359e12662c5.tar.gz
3d-396b9200d5e62df30ca061a74c75d359e12662c5.tar.bz2
Flip cull face instead of setting it directly, to fix cube reflections.
-rw-r--r--3d.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/3d.c b/3d.c
index f3a6a99..da88a90 100644
--- a/3d.c
+++ b/3d.c
@@ -231,7 +231,7 @@ tdPaintWindowWithDepth (CompWindow *w,
Bool wasCulled;
Bool status;
int wx, wy, ww, wh;
- int bevel, cull, temp;
+ int bevel, cull, cullInv, temp;
CompScreen *s = w->screen;
CompVector point, tPoint;
unsigned short *c;
@@ -249,6 +249,7 @@ tdPaintWindowWithDepth (CompWindow *w,
bevel = tdGetBevel (s);
glGetIntegerv (GL_CULL_FACE_MODE, &cull);
+ cullInv = (cull == GL_BACK)? GL_FRONT : GL_BACK;
if (ww && wh && !(mask & PAINT_WINDOW_OCCLUSION_DETECTION_MASK))
{
@@ -257,7 +258,7 @@ tdPaintWindowWithDepth (CompWindow *w,
if (!tdw->ftb)
{
glEnable (GL_CULL_FACE);
- glCullFace (GL_FRONT);
+ glCullFace (cullInv);
UNWRAP (tds, s, paintWindow);
status = (*s->paintWindow) (w, attrib, &tds->bTransform, region,
@@ -267,7 +268,7 @@ tdPaintWindowWithDepth (CompWindow *w,
else
{
glEnable (GL_CULL_FACE);
- glCullFace (GL_BACK);
+ glCullFace (cull);
UNWRAP (tds, s, paintWindow);
status = (*s->paintWindow) (w, attrib, transform, region, mask);
@@ -372,7 +373,7 @@ tdPaintWindowWithDepth (CompWindow *w,
if (tdw->ftb)
{
glEnable (GL_CULL_FACE);
- glCullFace (GL_FRONT);
+ glCullFace (cullInv);
glPushMatrix ();
glLoadMatrixf (tds->bTransform.m);
@@ -387,7 +388,7 @@ tdPaintWindowWithDepth (CompWindow *w,
else
{
glEnable (GL_CULL_FACE);
- glCullFace (GL_BACK);
+ glCullFace (cull);
UNWRAP(tds, s, paintWindow);
status = (*s->paintWindow) (w, attrib, transform, region, mask);