Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

DerVisH

SetTimer help

This topic is 5671 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know this is a bit noobie but what are the causes of a timer to return non zero and then not send any ticks, i thought it had something to do with my multithreaded rendering cycle but as i have removed it and still no ticks i cant see whats wrong. Facts: hwnd = handle is valid and not null id = (unsigned int)this, (timer class) delay = 100 function = points to a static member of the correct type settimer returns (unsigned int)this, which means sucessful This never give a tick (activates the function) after running for some time 2-3 min. Anyone with any ideas? Peter Beardsley

Share this post


Link to post
Share on other sites
Advertisement
Do you have a GetMessage/TranslateMessage/DispatchMessage loop and are you calling DefWindowProc in your window message handler?

If not, then your timer function won''t get called.

Share this post


Link to post
Share on other sites
Yes, I do have the Pump and it is activated within the same thread as the timers creation.

Share this post


Link to post
Share on other sites
Thought i would tell everyone incase anyone else didnt know,
If you dont ValidateRect(hWindow,NULL); a window then what happens the window is sent a stream of WM_PAINT messages correct, also WM_PAINT has heigher prio than WM_TIMER, (hint hint)

So in conclusion if your timer isnt working check to see that you havent forgotten to validate the rect to clear the back paint messages.

This is so no one else has to chase their tail for 3 hours.

Peter Bearsley

Share this post


Link to post
Share on other sites
So the ID parameter should be any unique UINT_PTR, correct?

Using the this pointer makes more sense then a static counter.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!