Win32: Add a command-line argument to pick the GPU backend.

This commit is contained in:
The Dax committed 2014-09-12 16:16:37 -04:00
1 parent c288a52975
commit 5fa929bbba
1 file changed
+12
+12
View File
@@ -435,6 +435,8 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
bool debugLogLevel = false;
const std::wstring gpuBackend = L"--gfx=";
// The rest is handled in NativeInit().
for (size_t i = 1; i < wideArgs.size(); ++i)
{
@@ -461,6 +463,16 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin
if (wideArgs[i] == L"--windowed")
g_Config.bFullScreen = false;
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")
g_Config.iGPUBackend = GPU_BACKEND_DIRECT3D9;
else if (restOfOption == L"ogl")
g_Config.iGPUBackend = GPU_BACKEND_OPENGL;
}
}
}
#ifdef _DEBUG