Moved global resource creation to startup instead of context creation. Fixes #645.

This commit is contained in:
Leonardo Zide
2021-03-10 21:22:41 -08:00
parent 44d0e92b50
commit 233affe3fc
9 changed files with 79 additions and 86 deletions
+2 -15
View File
@@ -905,7 +905,7 @@ lcStartupMode lcApplication::Initialize(const QList<QPair<QString, bool>>& Libra
if (Options.Exit)
return lcStartupMode::Success;
if (!InitializeRenderer())
if (!lcContext::InitializeRenderer())
{
StdErr << tr("Error creating OpenGL context.\n");
return lcStartupMode::Error;
@@ -1206,20 +1206,7 @@ void lcApplication::Shutdown()
delete mLibrary;
mLibrary = nullptr;
ShutdownRenderer();
}
bool lcApplication::InitializeRenderer()
{
if (!lcContext::CreateOffscreenContext())
return false;
return true;
}
void lcApplication::ShutdownRenderer()
{
lcContext::DestroyOffscreenContext();
lcContext::ShutdownRenderer();
}
void lcApplication::ShowPreferencesDialog()