From 7a1be69ec02cd6ae2cf09ae2b11b641f984c24da Mon Sep 17 00:00:00 2001 From: The Dax Date: Sat, 13 Sep 2014 01:33:45 -0400 Subject: [PATCH] Win32: Change --gfx to --graphics (and its suboptions) to be consistent with Headless. Also, software force-activates OpenGL mode, since it does not work with Direct3D currently. Thanks to @unknownbrackets for the suggestions. --- Windows/main.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Windows/main.cpp b/Windows/main.cpp index 4d0debc8d2..414c1cb0b8 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -434,7 +434,7 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin bool debugLogLevel = false; - const std::wstring gpuBackend = L"--gfx="; + const std::wstring gpuBackend = L"--graphics="; // The rest is handled in NativeInit(). for (size_t i = 1; i < wideArgs.size(); ++i) { @@ -465,10 +465,23 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin if (wideArgs[i].find(gpuBackend) != std::wstring::npos && wideArgs[i].size() > gpuBackend.size()) { const std::wstring restOfOption = wideArgs[i].substr(gpuBackend.size()); - if (restOfOption == L"d3d") + // Force software rendering off, as picking directx9 or gles implies HW acceleration. + // Once software rendering supports Direct3D9/11, we can add more options for software, + // such as "software-gles", "software-d3d9", and "software-d3d11", or something similar. + // For now, software rendering force-activates OpenGL. + if (restOfOption == L"directx9") { g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D9; - else if (restOfOption == L"ogl") + g_Config.bSoftwareRendering = false; + } + else if (restOfOption == L"gles") { g_Config.iGPUBackend = GPU_BACKEND_OPENGL; + g_Config.bSoftwareRendering = false; + } + + else if (restOfOption == L"software") { + g_Config.iGPUBackend = GPU_BACKEND_OPENGL; + g_Config.bSoftwareRendering = true; + } } } }