MSVC++ 5.0, WinNT4.0SP3
I'm trying to sync up a aircraft simulation to real-time. Becuase the model itself runs very fast (like 20simulated seconds in .2 realtime seconds), I need some kind of timer that once the model frame has been run through, it waits until the real frame time is up to continue.
I've found the WaitablTimer set of functions to be exactly what I want. However, after creating the timer and then calling SetWaitableTimer(), I am unsure of the exact specifics of what the variable inputs to this function do.
The 2nd parameter, *pDueTime in 100 nano-second intervals.... is this what I want to set the single frame time of the model as? If not, what is it for?
The 3rd paramter, lPeriod in milliseconds.....what about this? If not, what is it for?
I want to set the timer at the initialization of the model, then call WaitForSingleObject() at the bottom of each frame, so it should wait until the specified real-time frame time is up to go back through the loop again, over and over. I'm just not sure where to put the periodic cycle time I need.
btw, I don't need a completion routine (the 4th, 5th params).