/****************************************************************************
* Draw the actual circle points in each section.
***************************************************************************/
void drawCirclePoints (int x, int y, int xc, int yc)
{
glBegin(GL_POINTS);
glVertex2i (xc+x,yc+y);
glVertex2i (xc-x,yc+y);
glVertex2i (xc+x,yc-y);
glVertex2i (xc-x,yc-y);
glVertex2i (xc+y,yc+x);
glVertex2i (xc-y,yc+x);
glVertex2i (xc+y,yc-x);
glVertex2i (xc-y,yc-x);
glEnd();
}
/****************************************************************************
* Function to make sure all points of a whole circle get drawn
***************************************************************************/
void awCircle (int xc, int yc, int rad)
{
int x,y,d;
x = 0;
y = rad;
drawCirclePoints (x,y,xc,yc);
d = 1 - rad;
while (x < y)
{
if (d < 0)
{x++;d += 2*x +1;}
else
{ x++; y--;d += 2*(x-y) + 1;}
drawCirclePoints (x,y,xc,yc);
}
}