summaryrefslogtreecommitdiff
path: root/3d.c
diff options
context:
space:
mode:
Diffstat (limited to '3d.c')
-rw-r--r--3d.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/3d.c b/3d.c
index 16c6004..de36890 100644
--- a/3d.c
+++ b/3d.c
@@ -431,7 +431,7 @@ tdPostPaintViewport (CompScreen *s,
if (tds->active)
{
- CompTransform sTransform = *transform;
+ CompTransform mTransform;
CompTransform screenSpace;
CompTransform screenSpaceOffset;
CompWindow *w;
@@ -440,6 +440,8 @@ tdPostPaintViewport (CompScreen *s,
float wDepth = 0.0;
float pointZ = cs->invert * cs->distance;
Bool foundFtb;
+ int offX, offY;
+ unsigned int newMask;
CompVector vPoints[3] = { { .v = { -0.5, 0.0, pointZ, 1.0 } },
{ .v = { 0.0, 0.5, pointZ, 1.0 } },
@@ -489,13 +491,11 @@ tdPostPaintViewport (CompScreen *s,
transformToScreenSpace (s, output, -sAttrib->zTranslate,
&screenSpace);
+ glPushMatrix ();
+
/* paint all windows from bottom to top */
for (w = (*walk.first) (s); w; w = (*walk.next) (w))
{
- CompTransform mTransform = sTransform;
- int offX, offY;
- unsigned int newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
-
if (w->destroyed)
continue;
@@ -505,6 +505,9 @@ tdPostPaintViewport (CompScreen *s,
continue;
}
+ mTransform = *transform;
+ newMask = PAINT_WINDOW_ON_TRANSFORMED_SCREEN_MASK;
+
tdw = (tdWindow *) (w)->base.privates[tds->windowPrivateIndex].ptr;
if (tdw->depth != 0.0f)
@@ -516,7 +519,7 @@ tdPostPaintViewport (CompScreen *s,
if (wDepth != 0.0)
{
tds->currentScale += wDepth;
- tds->bTransform = sTransform;
+ tds->bTransform = *transform;
(*s->applyScreenTransform) (s, sAttrib, output,
&tds->bTransform);
tds->currentScale -= wDepth;
@@ -550,17 +553,17 @@ tdPostPaintViewport (CompScreen *s,
matrixMultiply (&mTransform, &mTransform, &screenSpace);
}
- glPushMatrix ();
glLoadMatrixf (mTransform.m);
(*s->paintWindow) (w, &w->paint, &mTransform, &infiniteRegion,
newMask);
- glPopMatrix ();
(*s->disableOutputClipping) (s);
}
}
+ glPopMatrix ();
+
tds->painting3D = FALSE;
tds->currentScale = tds->basicScale;
}