/* Copyright (c) Mark J. Kilgard, 1994. */ /* This program is freely distributable without licensing fees and is provided without guarantee or warrantee expressed or implied. This program is -not- in the public domain. */ #include #include #include #include #include int *dials, *buttons; int numdials, numbuttons; int dw, bw; /* Some files do not define M_PI... */ #ifndef M_PI #define M_PI 3.14159265358979323846 #endif void drawCircle(int x, int y, int r, int dir) { float angle; glPushMatrix(); glTranslatef(x,y,0); glBegin(GL_TRIANGLE_FAN); glVertex2f(0,0); for(angle = 2*M_PI; angle >= 0; angle -= M_PI/12) { glVertex2f(r*cos(angle),r*sin(angle)); } glEnd(); glColor3f(0,0,1); glBegin(GL_LINES); glVertex2f(0,0); glVertex2f(r*cos(dir*M_PI/180),r*sin(dir*M_PI/180)); glEnd(); glPopMatrix(); } void displayDials(void) { int i; glClear(GL_COLOR_BUFFER_BIT); for(i=0;i