Remove window requirement for all event functions

This lets an application wait for non-window events without needing to
create a window.

Fixes #1317.
This commit is contained in:
Camilla Löwy 2019-01-15 19:28:17 +01:00
parent ea7eb2ddab
commit 55b1a16f90
4 changed files with 3 additions and 22 deletions

View File

@ -189,6 +189,8 @@ information on what to include when reporting a bug.
- Removed `GLFW_USE_RETINA` compile-time option
- Removed `GLFW_USE_CHDIR` compile-time option
- Removed `GLFW_USE_MENUBAR` compile-time option
- Removed requirement of at least one window for `glfwWaitEvents` and
`glfwPostEmptyEvent` (#1317)
- Bugfix: Calling `glfwMaximizeWindow` on a full screen window was not ignored
- Bugfix: `GLFW_INCLUDE_VULKAN` could not be combined with the corresponding
OpenGL and OpenGL ES header macros

View File

@ -57,8 +57,7 @@ glfwWaitEvents();
It puts the thread to sleep until at least one event has been received and then
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.
useful for, for example, editing tools.
If you want to wait for events but have UI elements or other tasks that need
periodic updates, @ref glfwWaitEventsTimeout lets you specify a timeout.

View File

@ -3718,10 +3718,6 @@ GLFWAPI void glfwPollEvents(void);
* GLFW will pass those events on to the application callbacks before
* returning.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* Event processing is not required for joystick input to work.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
@ -3769,10 +3765,6 @@ GLFWAPI void glfwWaitEvents(void);
* GLFW will pass those events on to the application callbacks before
* returning.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* Event processing is not required for joystick input to work.
*
* @param[in] timeout The maximum amount of time, in seconds, to wait.
@ -3799,10 +3791,6 @@ GLFWAPI void glfwWaitEventsTimeout(double timeout);
* This function posts an empty event from the current thread to the event
* queue, causing @ref glfwWaitEvents or @ref glfwWaitEventsTimeout to return.
*
* If no windows exist, this function returns immediately. For synchronization
* of threads in applications that do not create windows, use your threading
* library of choice.
*
* @errors Possible errors include @ref GLFW_NOT_INITIALIZED and @ref
* GLFW_PLATFORM_ERROR.
*

View File

@ -1078,10 +1078,6 @@ GLFWAPI void glfwPollEvents(void)
GLFWAPI void glfwWaitEvents(void)
{
_GLFW_REQUIRE_INIT();
if (!_glfw.windowListHead)
return;
_glfwPlatformWaitEvents();
}
@ -1104,10 +1100,6 @@ GLFWAPI void glfwWaitEventsTimeout(double timeout)
GLFWAPI void glfwPostEmptyEvent(void)
{
_GLFW_REQUIRE_INIT();
if (!_glfw.windowListHead)
return;
_glfwPlatformPostEmptyEvent();
}