mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
Warn when falling back to another DisplayServer
Before it was a bit unclear on what was happening, since a display server has to fail to fall back and so the user would be left with an error _and_ a (hopefully) running game. Should make the experience more pleasant on Linux/BSD now that we have two display servers.
This commit is contained in:
parent
62de80d613
commit
56eb272e90
@ -2838,6 +2838,8 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||||||
Error err;
|
Error err;
|
||||||
display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err);
|
display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err);
|
||||||
if (err != OK || display_server == nullptr) {
|
if (err != OK || display_server == nullptr) {
|
||||||
|
String last_name = DisplayServer::get_create_function_name(display_driver_idx);
|
||||||
|
|
||||||
// We can't use this display server, try other ones as fallback.
|
// We can't use this display server, try other ones as fallback.
|
||||||
// Skip headless (always last registered) because that's not what users
|
// Skip headless (always last registered) because that's not what users
|
||||||
// would expect if they didn't request it explicitly.
|
// would expect if they didn't request it explicitly.
|
||||||
@ -2845,6 +2847,9 @@ Error Main::setup2(bool p_show_boot_logo) {
|
|||||||
if (i == display_driver_idx) {
|
if (i == display_driver_idx) {
|
||||||
continue; // Don't try the same twice.
|
continue; // Don't try the same twice.
|
||||||
}
|
}
|
||||||
|
String name = DisplayServer::get_create_function_name(i);
|
||||||
|
WARN_PRINT(vformat("Display driver %s failed, falling back to %s.", last_name, name));
|
||||||
|
|
||||||
display_server = DisplayServer::create(i, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err);
|
display_server = DisplayServer::create(i, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, context, err);
|
||||||
if (err == OK && display_server != nullptr) {
|
if (err == OK && display_server != nullptr) {
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user