The shared function for reading back context attributes,
_glfwRefreshContextAttribs, did not check whether the newly created
context had been successfully made current. This violated the invariant
that the context TLS slot always points to a valid window and that its
context is current whenever _glfw.platform.getProcAddress is called.
Related to #2327
After creating surface context in _glfwPlatformCreateWindow function
proceeds with reading context parameters in _glfwRefreshContextAttribs,
which ends with clearing the front buffer when double buffering is
enabled.
Such buffer clearing implicitly calls swapBuffer, which may not behave
properly with the default swap interval. And user has no control to
override this swap interval value with the glfwSwapInterval, because
latter may only be called after the glfwCreateWindow, when it is too
late.
Either clearing buffer should be disablable, or user should have
control on the initial swap interval value before implicit swapBuffer
is invoked.
This patch implements latter by introducing GLFW_SWAP_INTERVAL window
hint. Default value is -1, which matches current policy of avoiding
to override swap interval.
This skips the buffer swap after the initial glClear performed during
window creation, if the window is single-buffered. This call confused
apitrace into thinking the window was double-buffered.
Fixes#1873.
This completes support for window framebuffer transparency on Windows,
macOS and X11. Note that the hint/attribute may be renamed before
release to clarify its relationship to GLFW_OPACITY.
Fixes#197.
Closes#1079.
Related to #663.
Related to #715.
Related to #723.
Related to #1078.
If the expected constants are defined in hexadecimal in the header then
the error string should also use hexadecimal.
Idea by IntellectualKitty.
Related to #970.
Add separate strings for each client API to make it easier to grep.
Remove 'client' from fallback error messages as API-related error tokens
are used for non-client APIs as well.
Fixed incorrect error types. Added missing error string prefixes.
Removed some invalid or superfluous error emissions. Clarified some
error strings. Joined error string lines to aid grep. Replaced some
generic error strings with specific ones. Documentation work.
Fixes#450.