Print out new video mode when current mode is rejected

This commit is contained in:
Chris Thrasher 2023-12-17 11:11:39 -07:00
parent a474654ea7
commit 329e40019a
2 changed files with 5 additions and 0 deletions

View File

@ -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

View File

@ -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