mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-01 10:15:43 -04:00
NoGUI: Fail startup if font atlas creation fails
This commit is contained in:
parent
6a0bd7ee64
commit
3c83ef4939
@ -114,7 +114,8 @@ bool NoGUIHostInterface::CreateDisplay()
|
|||||||
if (!m_display->CreateRenderDevice(wi.value(), g_settings.gpu_adapter, g_settings.gpu_use_debug_device,
|
if (!m_display->CreateRenderDevice(wi.value(), g_settings.gpu_adapter, g_settings.gpu_use_debug_device,
|
||||||
g_settings.gpu_threaded_presentation) ||
|
g_settings.gpu_threaded_presentation) ||
|
||||||
!m_display->InitializeRenderDevice(GetShaderCacheBasePath(), g_settings.gpu_use_debug_device,
|
!m_display->InitializeRenderDevice(GetShaderCacheBasePath(), g_settings.gpu_use_debug_device,
|
||||||
g_settings.gpu_threaded_presentation))
|
g_settings.gpu_threaded_presentation) ||
|
||||||
|
!CreateHostDisplayResources())
|
||||||
{
|
{
|
||||||
m_display->DestroyRenderDevice();
|
m_display->DestroyRenderDevice();
|
||||||
m_display.reset();
|
m_display.reset();
|
||||||
@ -125,7 +126,8 @@ bool NoGUIHostInterface::CreateDisplay()
|
|||||||
if (!CreateHostDisplayResources())
|
if (!CreateHostDisplayResources())
|
||||||
Log_WarningPrint("Failed to create host display resources");
|
Log_WarningPrint("Failed to create host display resources");
|
||||||
|
|
||||||
Log_InfoPrintf("Host display initialized at %ux%u resolution", m_display->GetWindowWidth(), m_display->GetWindowHeight());
|
Log_InfoPrintf("Host display initialized at %ux%u resolution", m_display->GetWindowWidth(),
|
||||||
|
m_display->GetWindowHeight());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -517,11 +517,6 @@ void CommonHostInterface::CreateImGuiContext()
|
|||||||
|
|
||||||
bool CommonHostInterface::CreateHostDisplayResources()
|
bool CommonHostInterface::CreateHostDisplayResources()
|
||||||
{
|
{
|
||||||
m_logo_texture = m_display->CreateTexture(APP_ICON_WIDTH, APP_ICON_HEIGHT, 1, 1, 1, HostDisplayPixelFormat::RGBA8,
|
|
||||||
APP_ICON_DATA, sizeof(u32) * APP_ICON_WIDTH, false);
|
|
||||||
if (!m_logo_texture)
|
|
||||||
Log_WarningPrintf("Failed to create logo texture");
|
|
||||||
|
|
||||||
const float framebuffer_scale = m_display->GetWindowScale();
|
const float framebuffer_scale = m_display->GetWindowScale();
|
||||||
ImGui::GetIO().DisplayFramebufferScale = ImVec2(framebuffer_scale, framebuffer_scale);
|
ImGui::GetIO().DisplayFramebufferScale = ImVec2(framebuffer_scale, framebuffer_scale);
|
||||||
ImGui::GetIO().DisplaySize.x = static_cast<float>(m_display->GetWindowWidth());
|
ImGui::GetIO().DisplaySize.x = static_cast<float>(m_display->GetWindowWidth());
|
||||||
@ -548,13 +543,16 @@ bool CommonHostInterface::CreateHostDisplayResources()
|
|||||||
if (!m_fullscreen_ui_enabled)
|
if (!m_fullscreen_ui_enabled)
|
||||||
ImGuiFullscreen::ResetFonts();
|
ImGuiFullscreen::ResetFonts();
|
||||||
|
|
||||||
if (!m_display->UpdateImGuiFontTexture())
|
m_logo_texture = m_display->CreateTexture(APP_ICON_WIDTH, APP_ICON_HEIGHT, 1, 1, 1, HostDisplayPixelFormat::RGBA8,
|
||||||
|
APP_ICON_DATA, sizeof(u32) * APP_ICON_WIDTH, false);
|
||||||
|
if (!m_logo_texture || !m_display->UpdateImGuiFontTexture())
|
||||||
{
|
{
|
||||||
Log_ErrorPrintf("Failed to create ImGui font text");
|
Log_ErrorPrintf("Failed to create ImGui font text");
|
||||||
if (m_fullscreen_ui_enabled)
|
if (m_fullscreen_ui_enabled)
|
||||||
FullscreenUI::Shutdown();
|
FullscreenUI::Shutdown();
|
||||||
|
|
||||||
m_display->DestroyImGuiContext();
|
m_display->DestroyImGuiContext();
|
||||||
|
m_logo_texture.reset();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user