- glVertex2i(r->x, r->y);
- glVertex2i(r->x, r->y + r->height);
- glVertex2i(r->x + r->width, r->y + r->height);
- glVertex2i(r->x + r->width, r->y);
- }
- glEnd();
-*/
-
- glEnableClientState (GL_VERTEX_ARRAY);
- glDisableClientState (GL_TEXTURE_COORD_ARRAY);
-
- for (unsigned long i = 0; i != nrectangles; ++i)
- {
- const XRectangle *r = &rectangles[i];
-
- GLfloat coords[4][2] =
- {
- {r->x, r->y},
- {r->x, r->y + r->height},
- {r->x + r->width, r->y + r->height},
- {r->x + r->width, r->y}
- };
-
- // TODO: Several rects at once. Maybe even tune for XScreenSaver workloads.
- glVertexPointer (2, GL_FLOAT, 0, coords);
- jwxyz_assert_gl ();
- glDrawArrays (GL_TRIANGLE_FAN, 0, 4);
- jwxyz_assert_gl ();
+ GLfloat *coords = enqueue (dpy, d, gc, GL_TRIANGLE_STRIP, 4, pixel);
+ coords[0] = r->x;
+ coords[1] = r->y;
+ coords[2] = r->x;
+ coords[3] = r->y + r->height;
+ coords[4] = r->x + r->width;
+ coords[5] = r->y;
+ coords[6] = r->x + r->width;
+ coords[7] = r->y + r->height;
+ finish_triangle_strip (dpy, coords);