diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 577e1cedd6..fa6980f0f4 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -71,6 +71,8 @@ static const uint32_t colors[4] = { static std::unique_ptr bgTexture; +static bool backgroundInited; + void UIBackgroundInit(UIContext &dc) { const std::string bgPng = GetSysDirectory(DIRECTORY_SYSTEM) + "background.png"; const std::string bgJpg = GetSysDirectory(DIRECTORY_SYSTEM) + "background.jpg"; @@ -82,9 +84,15 @@ void UIBackgroundInit(UIContext &dc) { void UIBackgroundShutdown() { bgTexture.reset(nullptr); + backgroundInited = false; } void DrawBackground(UIContext &dc, float alpha) { + if (!backgroundInited) { + UIBackgroundInit(dc); + backgroundInited = true; + } + static float xbase[100] = {0}; static float ybase[100] = {0}; float xres = dc.GetBounds().w; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 59344be74e..cbfceed7c2 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -664,8 +664,6 @@ bool NativeInitGraphics(GraphicsContext *graphicsContext) { screenManager->setDrawContext(g_draw); screenManager->setPostRenderCallback(&RenderOverlays, nullptr); - UIBackgroundInit(*uiContext); - #ifdef _WIN32 winAudioBackend = CreateAudioBackend((AudioBackendType)g_Config.iAudioBackend); #if PPSSPP_PLATFORM(UWP)