Code:
void Gadget::PaintClock(int x, int y)
{
struct tm * current_tm;
time_t current_time;
time (¤t_time);
current_tm = localtime (¤t_time);
//for(int r = 0; r < 50; r++)
//{
// Surface->DrawColoredCircle(x,y,r,0,0,0,255);
//}
Surface->DrawColoredCircle(x,y,50,255,255,255,255);
Surface->DrawColoredCircle(x,y,49,255,255,255,255);
float alpha = 30*current_tm->tm_hour;
float beta = 6*current_tm->tm_min;
float phi = 6*current_tm->tm_sec;
int nx = x+35*sin(ToRadia(alpha));
int ny = y-35*cos(ToRadia(alpha));
int nx2 = x+45*sin(ToRadia(beta));
int ny2 = y-45*cos(ToRadia(beta));
int nx3 = x+40*sin(ToRadia(phi));
int ny3 = y-40*cos(ToRadia(phi));
DrawLine(x,y,nx,ny);
DrawLine(x+1,y+1,nx,ny);
DrawLine(x,y,nx2,ny2);
DrawLine(x+1,y+1,nx2,ny2);
DrawLine(x,y,nx3,ny3);
}
CREDITS TO WHOEVER MADE THIS!!