static void draw_ticks (struct state *st, Drawable d, struct disc *disc, int x, int y, int radius) { XSegment segs[72]; int i; double tick = (M_PI * 2) / 72; for (i = 0; i < 72; i++) { int radius2 = radius; double th = (i * tick) + (2 * M_PI * (disc->theta / ((double) 360*64))); if (i % 6) radius2 -= radius / 16; else radius2 -= radius / 8; segs[i].x1 = x + radius * cos(th); segs[i].y1 = y + radius * sin(th); segs[i].x2 = x + radius2 * cos(th); segs[i].y2 = y + radius2 * sin(th); } XDrawSegments (st->dpy, d, disc->gc, segs, countof(segs)); draw_letters (st, d, disc, x, y, radius); }
void draw_logo(float scale) { /* Draws the unofficial OpenGL logo using GLC, the OpenGL */ /* character rendering library. */ static GLboolean have_dlist = GL_FALSE; static GLuint dlist; access_font(); if (have_dlist == GL_FALSE) { /* Compile the graphics into a display list. */ dlist = glGenLists(1); if (!glIsList(dlist)) { fprintf(stderr, "glGenLists() failed.\n"); } else { glNewList(dlist, GL_COMPILE); { draw_letters(scale); } glEndList(); have_dlist = GL_TRUE; } } /* Draw everything by calling the display list. */ if (glIsList(dlist)) { glCallList(dlist); } }