Add glfwWaitEventsTimeout

This function will put the calling thread to sleep until an event
arrives or until the specified timeout has elapsed.
This commit is contained in:
Camilla Berglund
2016-02-02 21:11:16 +01:00
parent 337c77a39b
commit 5620895e88
11 changed files with 150 additions and 0 deletions
+11
View File
@@ -58,6 +58,17 @@ processes all received events. This saves a great deal of CPU cycles and is
useful for, for example, editing tools. There must be at least one GLFW window
for this function to sleep.
If you want to wait for events but have UI elements that need periodic updates,
call @ref glfwWaitEventsTimeout.
@code
glfwWaitEventsTimeout(0.7);
@endcode
It puts the thread to sleep until at least one event has been received, or until
the specified number of seconds have elapsed. It then processes any received
events.
If the main thread is sleeping in @ref glfwWaitEvents, you can wake it from
another thread by posting an empty event to the event queue with @ref
glfwPostEmptyEvent.
+6
View File
@@ -43,6 +43,12 @@ GLFW now supports raw timer values with @ref glfwGetTimerValue and @ref
glfwGetTimerFrequency.
@subsection news_32_waittimeout Wait for events with timeout
GLFW now supports waiting for events for a set amount of time with @ref
glfwWaitEventsTimeout.
@section news_31 New features in 3.1
These are the release highlights. For a full list of changes see the