Mail Archives: djgpp/1999/05/02/07:48:41
make a function like this
#include <go32.h>
unsigned long QueryTimer(void)
{
unsigned long clock = _farpeekl(_dos_ds, 0x0046C);
return(clock);
}
then so each game loop takes at least 100 milliseconds, you save the time
setting in the beggining of the game loop. Then at the end you get the time
again and test if the difference between the two times is less than 100, if it
is...it waits. Here's an example:
start_time = TimerQuery()
// do game processing
while((start_time-TimerQuery())<100) { }
Hope that helps...
-Chad
- Raw text -