We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 684 - SDL_WaitEventTimeout function
Summary: SDL_WaitEventTimeout function
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: All Mac OS X 10.5 (Intel)
: P2 API change
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-18 21:14 UTC by Pierre Phaneuf
Modified: 2009-02-16 22:01 UTC (History)
0 users

See Also:


Attachments
adds SDL_WaitEventTimeout function (1.94 KB, patch)
2009-01-18 21:14 UTC, Pierre Phaneuf
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Phaneuf 2009-01-18 21:14:28 UTC
Created attachment 292 [details]
adds SDL_WaitEventTimeout function

Here's a patch to add an SDL_WaitEventTimeout method to SDL 1.3 (as of r4406) without changing anything underneath. It is careful to avoid calling SDL_GetTicks() if either a zero or an infinite timeout have been requested.

Also, it reimplement SDL_PollEvent and SDL_WaitEvent in terms of this more generic function. It would be better if they were inlined in the header, but I wasn't sure of the policy for that, since strange compilers might be involved (I'm usually more of a C++ hacker).
Comment 1 Sam Lantinga 2009-02-16 22:01:35 UTC
Thanks!  I reworked this a little bit and committed it as revision 4438.