Here's code for a filled circle that I've just converted from some DBPro code I wrote years ago:
#include <DarkGDK.h>
#pragma warning(disable: 4244) // conversion from '<x>' to '<y>', possible loss of data
void FilledCircle( int cx, int cy, int r )
{
// precalculate the square of the radius - this is the hypotenuse
int i = r * r;
// calculate the size of the central square
int s = r * 0.70710678; // this magic number is sin(45)
// draw it
dbBox( cx-s, cy-s, cx+s+1, cy+s+1 );
++s;
// loop through the bit we have not yet drawn
for ( int y = s; y <= r; ++y )
{
int x = sqrt( (float)(i - ( y * y )) );
// draw top and bottom
dbBox( cx-x, cy-y, cx+x+1, cy-y+1 );
dbBox( cx-x, cy+y, cx+x+1, cy+y+1 );
// draw left and right
dbBox( cx-y, cy-x, cx-y+1, cy+x+1 );
dbBox( cx+y, cy-x, cx+y+1, cy+x+1 );
}
}
void DarkGDK()
{
dbSyncOn();
dbSyncRate(60);
int Radius = 20;
while (LoopGDK())
{
dbCLS();
FilledCircle( dbMouseX(), dbMouseY(), Radius );
if (dbUpKey() && Radius < 100) ++Radius;
if (dbDownKey() && Radius > 1) --Radius;
dbSetCursor(0, 0);
dbPrint( (LONGLONG) Radius );
dbSync();
}
}
When you look for code on the forums, don't just limit yourself to searching in the GDK forum - it's surprisingly easy to convert code from DBPro to GDK, so it's worth searching further afield.