summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/cube.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 18:42:31 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-02-13 18:42:31 +0000
commit4db67f7f814f428f6ebc629e0823e8f582c1b92b (patch)
tree7361942e99f8fbe584561cad015f812a42babb97 /beryl-plugins/src/cube.c
parent31811f6d60a682e0c184833a09dc546f1b73ccdd (diff)
downloadmarex-dev-4db67f7f814f428f6ebc629e0823e8f582c1b92b.tar.gz
marex-dev-4db67f7f814f428f6ebc629e0823e8f582c1b92b.tar.bz2
beryl-plugins: cube: fixed clip planes calculation
git-svn-id: file:///beryl/trunk@4035 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/cube.c')
-rw-r--r--beryl-plugins/src/cube.c60
1 files changed, 16 insertions, 44 deletions
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index d2289d9..5fe0929 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -362,68 +362,40 @@ static void cubeSetClipPlanes (CompScreen *s, int output)
{
CUBE_SCREEN(s);
- if (cs->mmMode == Multiple || s->nOutputDev == 1)
+ glPushMatrix();
+ glTranslatef(cs->outputXOffset, -cs->outputYOffset, 0.0f);
+ glScalef( cs->outputXScale, cs->outputYScale, 1.0f);
+
+ if (cs->invert == 1)
{
- if (cs->invert != 1)
- {
- UNWRAP(cs, s, setClipPlanes);
- (*s->setClipPlanes) (s, output);
- WRAP(cs, s, setClipPlanes, cubeSetClipPlanes);
- return;
- }
GLdouble clipPlane0[] = { 1.0, 0.0, 0.5 / cs->distance, 0.0 };
GLdouble clipPlane1[] = { -1.0, 0.0, 0.5 / cs->distance, 0.0 };
GLdouble clipPlane2[] = { 0.0, -1.0, 0.5 / cs->distance, 0.0 };
GLdouble clipPlane3[] = { 0.0, 1.0, 0.5 / cs->distance, 0.0 };
-
glClipPlane (GL_CLIP_PLANE0, clipPlane0);
glClipPlane (GL_CLIP_PLANE1, clipPlane1);
glClipPlane (GL_CLIP_PLANE2, clipPlane2);
glClipPlane (GL_CLIP_PLANE3, clipPlane3);
- return;
}
-
- float left = s->outputDev[output].region.extents.x1 /
- s->outputDev[output].width;
- float top = s->outputDev[output].region.extents.y1 /
- s->outputDev[output].height;
-
- float right = (s->width - s->outputDev[output].region.extents.x2) /
- s->outputDev[output].width;
- float bottom = (s->height - s->outputDev[output].region.extents.y2) /
- s->outputDev[output].height;
-
-
- if (cs->invert != 1)
+ else
{
- GLdouble clipPlane0[] = { 0.0, -1.0, 0.0, 0.5 + top};
- GLdouble clipPlane1[] = { 0.0, 1.0, 0.0, 0.5 + bottom };
- GLdouble clipPlane2[] = { 1.0, 0.0, 0.0, 0.5 + left};
- GLdouble clipPlane3[] = { -1.0, 0.0, 0.0, 0.5 + right};
-
+ GLdouble clipPlane0[] = { -1.0, 0.0, -0.5 / cs->distance, 0.0 };
+ GLdouble clipPlane1[] = { 1.0, 0.0, -0.5 / cs->distance, 0.0 };
+ GLdouble clipPlane2[] = { 0.0, 1.0, -0.5 / cs->distance, 0.0 };
+ GLdouble clipPlane3[] = { 0.0, -1.0, -0.5 / cs->distance, 0.0 };
glClipPlane (GL_CLIP_PLANE0, clipPlane0);
glClipPlane (GL_CLIP_PLANE1, clipPlane1);
glClipPlane (GL_CLIP_PLANE2, clipPlane2);
glClipPlane (GL_CLIP_PLANE3, clipPlane3);
- return;
}
+ glPopMatrix();
- float w = (float)(s->width - s->outputDev[output].width) /
- s->outputDev[output].width;
-
- float h = (float)(s->height - s->outputDev[output].height) /
- s->outputDev[output].height;
-
- GLdouble clipPlane0[] = { 1.0, 0.0, (0.5 + w) / cs->distance, 0.0 };
- GLdouble clipPlane1[] = { -1.0, 0.0, (0.5 + w) / cs->distance, 0.0 };
- GLdouble clipPlane2[] = { 0.0, -1.0, (0.5 + h) / cs->distance, 0.0 };
- GLdouble clipPlane3[] = { 0.0, 1.0, (0.5 + h) / cs->distance, 0.0 };
-
- glClipPlane (GL_CLIP_PLANE0, clipPlane0);
- glClipPlane (GL_CLIP_PLANE1, clipPlane1);
- glClipPlane (GL_CLIP_PLANE2, clipPlane2);
- glClipPlane (GL_CLIP_PLANE3, clipPlane3);
+ /*
+ UNWRAP(cs, s, setClipPlanes);
+ (*s->setClipPlanes) (s, output);
+ WRAP(cs, s, setClipPlanes, cubeSetClipPlanes);
+ */
}
static void cubeLoadImg(CompScreen * s, CubeCapInfo * cubeCap, int n)