ok so i have problem using gdi to create a animation
i have this code but it creates that creates a circle than it update its location so if like x = 1 it will be x = 2... that works file but when i try to clear what was painted and repaint it that doesn't work so it creates mroe than one circle with different locations(x).
here is the code for that creates the cricle
and here is the update code
i thought that InvalidateRect would earse/delete everything that was painted and repaint what should be paint but it didn't please help me thanks in adavance
i have this code but it creates that creates a circle than it update its location so if like x = 1 it will be x = 2... that works file but when i try to clear what was painted and repaint it that doesn't work so it creates mroe than one circle with different locations(x).
here is the code for that creates the cricle
Code:
VOID onPaint(HDC hdc)
{
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 255));
graphics.DrawEllipse(&pen,sf , 0, 50, 50);//sf is globale varabile
}
Code:
while(sd==1)
{
sf++;
onPaint(hdc);
InvalidateRect (hWnd, NULL, TRUE);
}