- clip[0] = 0;
- clip[1] = 1;
- clip[2] = y-size;
- glClipPlane(GL_CLIP_PLANE2, clip);
- glEnable(GL_CLIP_PLANE2);
-
- clip[1] = -1;
- clip[2] = -(y+size);
- glClipPlane(GL_CLIP_PLANE3, clip);
- glEnable(GL_CLIP_PLANE3);
-
- glPopMatrix();
+ GL::ClipPlane(1, 0, x-size, 0).apply_to(0);
+ GL::ClipPlane(-1, 0, -x-size, 0).apply_to(1);
+ GL::ClipPlane(0, 1, y-size, 0).apply_to(2);
+ GL::ClipPlane(0, -1, -y-size, 0).apply_to(3);
+ }