コード例 #1
0
void UGameUserSettings::ApplyNonResolutionSettings()
{
	ValidateSettings();

	bool bIsDirty = IsDirty();
	EWindowMode::Type NewWindowMode = GetFullscreenMode();

	{
		IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.FullScreenMode")); 
		CVar->Set(NewWindowMode);
	}

	// Update vsync cvar
	{
		auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.VSync")); 
		CVar->Set(IsVSyncEnabled());
	}

	// in init those are loaded earlier, after that we apply consolevariables.ini
	if(GEngine->IsInitialized())
	{
		Scalability::SetQualityLevels(ScalabilityQuality);
	}

	IConsoleManager::Get().CallAllConsoleVariableSinks();
}
コード例 #2
0
void UGameUserSettings::ApplyNonResolutionSettings()
{
	ValidateSettings();

	bool bIsDirty = IsDirty();
	EWindowMode::Type NewWindowMode = GetFullscreenMode();

	// Update vsync cvar
	{
		FString ConfigSection = TEXT("SystemSettings");
#if WITH_EDITOR
		if (GIsEditor)
		{
			ConfigSection = TEXT("SystemSettingsEditor");
		}
#endif
		int32 VSyncValue = 0;
		if (GConfig->GetInt(*ConfigSection, TEXT("r.Vsync"), VSyncValue, GEngineIni))
		{
			// VSync was already set by system settings. We are capable of setting it here.
		}
		else
		{
			static auto CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.VSync"));
			CVar->Set(IsVSyncEnabled(), ECVF_SetByGameSetting);
		}
	}

	if (!IsRunningDedicatedServer())
	{
		// Update MaxFPS cvar
		static IConsoleVariable* MaxFPSCVar = IConsoleManager::Get().FindConsoleVariable(TEXT("t.MaxFPS"));
		if (ensure(MaxFPSCVar) && (FrameRateLimit >= 0.0f))
		{
			MaxFPSCVar->Set(FrameRateLimit, ECVF_SetByGameSetting);
		}
	}

	// in init those are loaded earlier, after that we apply consolevariables.ini
	if(GEngine->IsInitialized())
	{
		Scalability::SetQualityLevels(ScalabilityQuality);
	}

	IConsoleManager::Get().CallAllConsoleVariableSinks();
}
コード例 #3
0
int main (int argc, char** argv)
{
glutInit(&argc, argv); 
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STEREO);	   //Display mode must have GLUT_STEREO,it is the key to resolve flash on the screen
glutInitWindowSize(800, 600);
glutInitWindowPosition(100, 100);
glutCreateWindow(argv[0]);

glutReshapeFunc(reshape);
glutDisplayFunc(display);
glutIdleFunc(display);
glutKeyboardFunc(keyboard);
glutMouseFunc(mouse);
glutMotionFunc(onMouseMove);

init();

//glEnable(GL_STEREO);
GLboolean isStereo = GL_FALSE;
glGetBooleanv(GL_STEREO,&isStereo);
if(!isStereo)
	printf("FAIL! GPU don't support stereo\n");
else
	printf("SUCCESS! GPU support stereo\n");


InitVSync();
bool isOk = IsVSyncEnabled(); 
if (isOk) 
{
	printf("返回标志位为1\n");
	SetVSyncState(false);
}
else
{	printf("返回标志位为0\n");
	SetVSyncState(false);
}

glutMainLoop();
return 0;
}