views:

82

answers:

3

I was wondering would I still need to use a basic game loop for this particular operation?

+3  A: 

No, just use CreateWaitableTimer, SetWaitableTimer, and then use MsgWaitForMultipleObjects instead of GetMessage or PeekMessage in your event dispatch loop (typically in WinMain).

Ben Voigt
+3  A: 

You could create a timer and perform that action on WM_TIMER message handling or on timer proc function you specify when creating the timer.

See SetTimer and WM_TIMER.

Cătălin Pitiș
+1  A: 

You can implement timers more generally and portably by using the Boost Asio library.

Here's an example of creating an asynchronous timer.

Peter Alexander