Instead of calling uiMainStep on some arbitrary timer, provide a way know when to step next.
I'd suggest a function that returns both:
- a file descriptor (unix) or
HANDLE (windows) to wait on
- a timeout
These would then be passed (by the user) to poll/select(unix)/WaitForMultipleObjects(windows) to multiplex the UI with other (e.g. network) resources.
Instead of calling
uiMainStepon some arbitrary timer, provide a way know when to step next.I'd suggest a function that returns both:
HANDLE(windows) to wait onThese would then be passed (by the user) to
poll/select(unix)/WaitForMultipleObjects(windows) to multiplex the UI with other (e.g. network) resources.