From 5ea9937457a3cb46883985853acf6ea5960cffcb Mon Sep 17 00:00:00 2001 From: nillerusr Date: Fri, 18 Aug 2023 13:49:07 +0300 Subject: [PATCH] android: fix black screen after minimizing window in materialsystem queue mode --- engine/sys_mainwind.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/engine/sys_mainwind.cpp b/engine/sys_mainwind.cpp index 8cbb3fdc..aecf5ebd 100644 --- a/engine/sys_mainwind.cpp +++ b/engine/sys_mainwind.cpp @@ -263,7 +263,6 @@ GameMessageHandler_t g_GameMessageHandlers[] = { IE_Quit, &CGame::HandleMsg_Close }, }; - void CGame::AppActivate( bool fActive ) { // If text mode, force it to be active. @@ -299,8 +298,18 @@ void CGame::AppActivate( bool fActive ) // Clear keyboard states (should be cleared already but...) // VGui_ActivateMouse will reactivate the mouse soon. ClearIOStates(); - UpdateMaterialSystemConfig(); + +#ifdef ANDROID + ConVarRef mat_queue_mode( "mat_queue_mode" ); + + // Hack to reset internal queue buffers + int nSavedQueueMode = mat_queue_mode.GetInt(); + mat_queue_mode.SetValue( 0 ); + materials->BeginFrame( host_frametime ); + materials->EndFrame(); + mat_queue_mode.SetValue( nSavedQueueMode ); +#endif } else {