Don't call SwapBuffers on single-buffer contexts.

It's generally harmless to call SwapBuffers on single-buffer contexts.

But it's unnecessary at the very least, and it confuses
https://github.com/apitrace/apitrace into thinking the GLFW3 application
is using double-buffered back-buffers even when it isn't.
This commit is contained in:
Jose Fonseca 2021-03-27 14:03:41 +00:00
parent 33cd8b865d
commit f4c8857572
2 changed files with 4 additions and 1 deletions

View File

@ -130,6 +130,7 @@ information on what to include when reporting a bug.
- Made joystick subsystem initialize at first use (#1284,#1646)
- Updated the minimum required CMake version to 3.1
- Disabled tests and examples by default when built as a CMake subdirectory
- Don't call SwapBuffers on single-buffer contexts.
- Bugfix: The CMake config-file package used an absolute path and was not
relocatable (#1470)
- Bugfix: Video modes with a duplicate screen area were discarded (#1555,#1556)

View File

@ -570,7 +570,9 @@ GLFWbool _glfwRefreshContextAttribs(_GLFWwindow* window,
PFNGLCLEARPROC glClear = (PFNGLCLEARPROC)
window->context.getProcAddress("glClear");
glClear(GL_COLOR_BUFFER_BIT);
window->context.swapBuffers(window);
if (_glfw.hints.framebuffer.doublebuffer) {
window->context.swapBuffers(window);
}
}
glfwMakeContextCurrent((GLFWwindow*) previous);