Headless: Setup logman earlier.

So we can control all the GPU init logging.
This commit is contained in:
Unknown W. Brackets 2020-09-08 15:52:39 -07:00
parent cbeeb8fdf1
commit c1ce8383ae

View File

@ -328,14 +328,6 @@ int main(int argc, const char* argv[])
if (testFilenames.empty())
return printUsage(argv[0], argc <= 1 ? NULL : "No executables specified");
HeadlessHost *headlessHost = getHost(gpuCore);
headlessHost->SetGraphicsCore(gpuCore);
host = headlessHost;
std::string error_string;
GraphicsContext *graphicsContext = nullptr;
bool glWorking = host->InitGraphics(&error_string, &graphicsContext);
LogManager::Init(&g_Config.bEnableLogging);
LogManager *logman = LogManager::GetInstance();
@ -348,6 +340,14 @@ int main(int argc, const char* argv[])
}
logman->AddListener(printfLogger);
HeadlessHost *headlessHost = getHost(gpuCore);
headlessHost->SetGraphicsCore(gpuCore);
host = headlessHost;
std::string error_string;
GraphicsContext *graphicsContext = nullptr;
bool glWorking = host->InitGraphics(&error_string, &graphicsContext);
CoreParameter coreParameter;
coreParameter.cpuCore = cpuCore;
coreParameter.gpuCore = glWorking ? gpuCore : GPUCORE_NULL;