From 329e40019a8aaad560d0efbb7436453d21e4da83 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sun, 17 Dec 2023 11:11:39 -0700 Subject: [PATCH] Print out new video mode when current mode is rejected --- src/SFML/Window/Window.cpp | 2 ++ src/SFML/Window/WindowBase.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index d28fd0e62..81f987fb8 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -94,6 +94,8 @@ void Window::create(VideoMode mode, const String& title, std::uint32_t style, co err() << "The requested video mode is not available, switching to a valid mode" << std::endl; assert(!VideoMode::getFullscreenModes().empty() && "No video modes available"); mode = VideoMode::getFullscreenModes()[0]; + err() << " VideoMode: { size: { " << mode.size.x << ", " << mode.size.y + << " }, bitsPerPixel: " << mode.bitsPerPixel << " }" << std::endl; } // Update the fullscreen window diff --git a/src/SFML/Window/WindowBase.cpp b/src/SFML/Window/WindowBase.cpp index 9be065b28..29f475a42 100644 --- a/src/SFML/Window/WindowBase.cpp +++ b/src/SFML/Window/WindowBase.cpp @@ -96,7 +96,10 @@ void WindowBase::create(VideoMode mode, const String& title, std::uint32_t style if (!mode.isValid()) { err() << "The requested video mode is not available, switching to a valid mode" << std::endl; + assert(!VideoMode::getFullscreenModes().empty() && "No video modes available"); mode = VideoMode::getFullscreenModes()[0]; + err() << " VideoMode: { size: { " << mode.size.x << ", " << mode.size.y + << " }, bitsPerPixel: " << mode.bitsPerPixel << " }" << std::endl; } // Update the fullscreen window