From 7364d5b578c60cb8ec3015f9a13803a5b3f55e2b Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Tue, 21 Dec 2021 19:48:27 +0100 Subject: [PATCH] Fix broken OpenGL example --- examples/opengl/OpenGL.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/opengl/OpenGL.cpp b/examples/opengl/OpenGL.cpp index 471f0eda..21bba5bd 100644 --- a/examples/opengl/OpenGL.cpp +++ b/examples/opengl/OpenGL.cpp @@ -282,8 +282,9 @@ int main() // Make the window the active window for OpenGL calls if (!window.setActive(true)) { - std::cerr << "Failed to set window to active" << std::endl; - return EXIT_FAILURE; + // On failure, try re-creating the window, as it is intentionally + // closed when changing color space. + continue; } // Clear the depth buffer