コード例 #1
0
ファイル: Main.cpp プロジェクト: AlexDiede/spring
/**
 * Always run on dedicated GPU
 * @return true when restart is required with new env vars
 */
static bool SetNvOptimusProfile(char* argv[])
{
#ifdef WIN32
	if (SOP_CheckProfile("Spring"))
		return false;

	const std::string exename = FileSystem::GetFilename(argv[0]);
	const int res = SOP_SetProfile("Spring", exename);
	return (res == SOP_RESULT_CHANGE);
#else
	return false;
#endif
}
コード例 #2
0
ファイル: Main.cpp プロジェクト: Liuyangbiao/spring
/**
 * Always run on dedicated GPU
 * @return true when restart is required with new env vars
 */
static bool SetNvOptimusProfile(const std::string& processFileName)
{
#ifdef WIN32
	if (SOP_CheckProfile("Spring"))
		return false;

	const bool profileChanged = (SOP_SetProfile("Spring", processFileName) == SOP_RESULT_CHANGE);

	// on Windows execvp breaks lobbies (new process: new PID)
	return (false && profileChanged);
#endif
	return false;
}