diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-01-11 19:14:43 +0100 |
---|---|---|
committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-01-12 21:42:51 +0100 |
commit | d0e37cd04c5a5a2f3dbd15ab192a70ddd02710a0 (patch) | |
tree | 94500a37cfb31e4bc8f16341eb2cc8420e1a078c /main | |
parent | 73ab51465748a15ed4d80d66a44db83bfe574bb6 (diff) |
Add framework for avoidance of color flash in new windows
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main/main.cpp b/main/main.cpp index 5736aedfe5..6b04cdc6d6 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -1920,6 +1920,9 @@ Error Main::setup2(Thread::ID p_main_tid_override) { window_position = &position; } + Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color); + DisplayServer::set_early_window_clear_color_override(true, boot_bg_color); + // rendering_driver now held in static global String in main and initialized in setup() Error err; display_server = DisplayServer::create(display_driver_idx, rendering_driver, window_mode, window_vsync_mode, window_flags, window_position, window_size, init_screen, err); @@ -2085,7 +2088,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0)); } - Color boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", boot_splash_bg_color); + Color boot_bg_color = GLOBAL_GET("application/boot_splash/bg_color"); #if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH) boot_bg_color = @@ -2120,6 +2123,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) { #endif } + DisplayServer::set_early_window_clear_color_override(false); + MAIN_PRINT("Main: DCC"); RenderingServer::get_singleton()->set_default_clear_color( GLOBAL_GET("rendering/environment/defaults/default_clear_color")); |