summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mikos <metastability@opencompositing.org>2008-01-10 18:12:33 +1030
committerDavid Mikos <metastability@opencompositing.org>2008-01-10 18:12:33 +1030
commit5d230f447bfd7f30adf4a81a79b3ab295284e047 (patch)
tree548f230edcf150790ddf948c7d96078ce3209c00
parentaba235cd8ec26c5ce45026a1b5807d3b68263c25 (diff)
downloadrubik-5d230f447bfd7f30adf4a81a79b3ab295284e047.tar.gz
rubik-5d230f447bfd7f30adf4a81a79b3ab295284e047.tar.bz2
Fix clipping bug.
-rw-r--r--rubik.c39
1 files changed, 27 insertions, 12 deletions
diff --git a/rubik.c b/rubik.c
index 3eae0a3..f99dfa2 100644
--- a/rubik.c
+++ b/rubik.c
@@ -934,7 +934,7 @@ static Bool RubikPaintOutput(CompScreen *s, const ScreenPaintAttrib *sAttrib,
RUBIK_SCREEN(s);
if(rs->initiated) {
- //mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
+ mask |= PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK;
//mask |= PAINT_SCREEN_REGION_MASK;
}
@@ -1154,16 +1154,16 @@ static Bool RubikPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
if (rubikGetEnableDepthTest(w->screen) && cs->rotationState!=RotationNone)
glEnable (GL_DEPTH_TEST);
- glDisable (GL_CLIP_PLANE0);
- glDisable (GL_CLIP_PLANE1);
- glDisable (GL_CLIP_PLANE2);
- glDisable (GL_CLIP_PLANE3);
-
GLdouble oldClipPlane4[4];
GLdouble oldClipPlane5[4];
glGetClipPlane(GL_CLIP_PLANE4, oldClipPlane4);
glGetClipPlane(GL_CLIP_PLANE5, oldClipPlane5);
+ GLboolean oldClipPlane0status = glIsEnabled(GL_CLIP_PLANE0);
+ GLboolean oldClipPlane1status = glIsEnabled(GL_CLIP_PLANE1);
+ GLboolean oldClipPlane2status = glIsEnabled(GL_CLIP_PLANE2);
+ GLboolean oldClipPlane3status = glIsEnabled(GL_CLIP_PLANE3);
+
GLboolean oldClipPlane4status = glIsEnabled(GL_CLIP_PLANE4);
GLboolean oldClipPlane5status = glIsEnabled(GL_CLIP_PLANE5);
@@ -1173,7 +1173,12 @@ static Bool RubikPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
glClipPlane (GL_CLIP_PLANE4, clipPlane4);
glClipPlane (GL_CLIP_PLANE5, clipPlane5);
-
+
+ glDisable (GL_CLIP_PLANE0);
+ glDisable (GL_CLIP_PLANE1);
+ glDisable (GL_CLIP_PLANE2);
+ glDisable (GL_CLIP_PLANE3);
+
glEnable (GL_CLIP_PLANE4);
glEnable (GL_CLIP_PLANE5);
@@ -1240,6 +1245,20 @@ static Bool RubikPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
status = (*w->screen->paintWindow)(w, attrib, &wTransform, region, mask);
}
+
+ if (oldClipPlane0status)
+ glEnable (GL_CLIP_PLANE0);
+
+ if (oldClipPlane1status)
+ glEnable (GL_CLIP_PLANE1);
+
+ if (oldClipPlane2status)
+ glEnable (GL_CLIP_PLANE2);
+
+ if (oldClipPlane3status)
+ glEnable (GL_CLIP_PLANE3);
+
+
glDisable (GL_CLIP_PLANE4);
glDisable (GL_CLIP_PLANE5);
@@ -1278,11 +1297,7 @@ static Bool RubikPaintWindow(CompWindow *w, const WindowPaintAttrib *attrib,
- glEnable (GL_CLIP_PLANE0);
- glEnable (GL_CLIP_PLANE1);
- glEnable (GL_CLIP_PLANE2);
- glEnable (GL_CLIP_PLANE3);
-
+
if(wasCulled)
glDisable(GL_CULL_FACE);