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

Summary: SDL_WaitEventTimeout function
Product: SDL Reporter: Pierre Phaneuf <pphaneuf>
Component: eventsAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: API change    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Mac OS X 10.5 (Intel)   
Attachments: adds SDL_WaitEventTimeout function

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.