I have made a simple test application that I use to paint objects while I study and try to give them physics such as gravity, velocity, wind, momentum, etc.
I have the app setup like this:
WM_PAINT
PaintFunction();
break;
DWORD CalculationsThread()
{
while( 1 )
{
//-_-_Calculations here
SendMessage( WindowsHandle, WM_PAINT, 0, 0 ):
Sleep( DelayTime );// usually 10 miliseconds
}
return 0;
}
This animation is what happens: http://img220.imageshack.us/img220/3913/42771348.gif
Everything paints fine, but after little time it all goes into default colors and never returns.
I dont want to jump into Opengl or directx yet since I want to focus on being able to give objects life before how they are drawn.
Is there a way to fix this?
Regards,
Gen