Lines Matching refs:gears
25 * Yet-another-version of gears. Originally ported to GLX by Brian Paul on
268 struct gears {
280 reshape(struct gears *gears, int width, int height)
282 gears->width = width;
283 gears->height = height;
302 /* make the gears */
338 int x, int y, int width, int height, struct gears *gears)
356 gears->width = width;
357 gears->height = height;
377 gears->win = XCreateWindow( dpy, root, 0, 0, width, height,
389 XSetNormalHints(dpy, gears->win, &sizehints);
390 XSetStandardProperties(dpy, gears->win, name, name,
394 gears->gc = XCreateGC(dpy, gears->win, 0, NULL);
396 gears->pixmap = XCreatePixmap(dpy, gears->win,
398 if (!gears->pixmap) {
403 gears->glxpixmap = glXCreatePixmap(dpy, fbconfig[0], gears->pixmap, NULL);
404 if (!gears->glxpixmap) {
409 gears->ctx = glXCreateNewContext(dpy, fbconfig[0],
411 if (!gears->ctx) {
421 event_loop(Display *dpy, struct gears *gears)
434 reshape(gears, event.xconfigure.width, event.xconfigure.height);
471 for (x = 0; x < gears->width; x += 100)
472 for (y = 0; y < gears->width; y += 100)
473 XCopyArea(dpy, gears->pixmap, gears->win, gears->gc,
507 struct gears gears;
526 make_window(dpy, "glxgears", 0, 0, width, height, &gears);
527 XMapWindow(dpy, gears.win);
528 glXMakeCurrent(dpy, gears.glxpixmap, gears.ctx);
539 event_loop(dpy, &gears);
541 glXDestroyContext(dpy, gears.ctx);
542 XDestroyWindow(dpy, gears.win);
543 glXDestroyPixmap(dpy, gears.glxpixmap);
544 XFreePixmap(dpy, gears.pixmap);