Skip to main content
GameDev.net gamedev.net
🔒 Locked

WM_TIMER

Started by bdc256 May 26, 2002 at 12:02 PM 1 replies 450+ views
Original Post
bdc256
bdc256
how often does windows send WM_TIMER or is there a better way to cuase time based effects currently there based on game cycles and would change on difernet speed machines
IndirectX
IndirectX
WM_TIMER is sent so many milliseconds. However, it is only extracted by GetMessage if no other messages are in the queue, making it a potentially high-latency message. You can use waitable timers for more precise timing, see CreateWaitableTimer/SetWaitableTimer. Or you can just use timeGetTime/QueryPerformanceCounter and see if enough time passed since last event to repeat the event.
---visit #directxdev on afternet <- not just for directx, despite the name
Shannon Barber
Shannon Barber
WM_TIMER isn''t a very good way to run events like that - it''s too dependant upon the message pump and has rather high variance.

Magmai Kai Holmlor

"Oh, like you''ve never written buggy code" - Lee

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]

[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows]

Shamelessly ripped from Oluseyi
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.