glfwWaitEventsTimeout function

void glfwWaitEventsTimeout(
  1. double timeout
)

! @brief Waits with timeout until events are queued and processes them.

This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If one or more events are available, it behaves exactly like @ref glfwPollEvents, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause the window and input callbacks associated with those events to be called.

The timeout value must be a positive finite number.

Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all callbacks.

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on those platforms. You can use the window refresh callback(@ref window_refresh) to redraw the contents of your window when necessary during such operations.

Do not assume that callbacks you set will only be called in response to event processing functions like this one. While it is necessary to poll for events, window systems that require GLFW to register callbacks of its own can pass events to GLFW in response to many window system function calls. GLFW will pass those events on to the application callbacks before returning.

Event processing is not required for joystick input to work.

@paramin timeout The maximum amount of time, in seconds, to wait.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_INVALID_VALUE and @ref GLFW_PLATFORM_ERROR.

@reentrancy This function must not be called from a callback.

@thread_safety This function must only be called from the main thread.

@sa @ref events @sa @ref glfwPollEvents @sa @ref glfwWaitEvents

@since Added in version 3.2.

@ingroup window

GLFWAPI void glfwWaitEventsTimeout(double timeout)

Implementation

void glfwWaitEventsTimeout(double timeout) {
  final glfwWaitEventsTimeoutLookupFunction = libglfw.lookupFunction<
      Void Function(Double timeout),
      void Function(double timeout)>('glfwWaitEventsTimeout');
  return glfwWaitEventsTimeoutLookupFunction(timeout);
}