コード例 #1
0
ファイル: SpringApp.cpp プロジェクト: FriedRice/spring
/**
 * @return return code of activecontroller draw function
 *
 * Draw function repeatedly called, it calls all the
 * other draw functions
 */
int SpringApp::Update()
{
	if (globalRendering->FSAA)
		glEnable(GL_MULTISAMPLE_ARB);

	int ret = 1;
	if (activeController) {
		Watchdog::ClearTimer(WDT_MAIN);

		if (!GML::SimThreadRunning()) {
			ret = activeController->Update();
		}

		if (ret) {
			ScopedTimer cputimer("GameController::Draw");
			ret = activeController->Draw();
			GML::PumpAux();
		}
	}

	VSync.Delay();
	SDL_GL_SwapBuffers();

	if (globalRendering->FSAA)
		glDisable(GL_MULTISAMPLE_ARB);

	return ret;
}
コード例 #2
0
ファイル: SpringApp.cpp プロジェクト: amitamitamitamit/spring
/**
 * @return return code of activecontroller draw function
 *
 * Draw function repeatedly called, it calls all the
 * other draw functions
 */
int SpringApp::Update()
{
	if (globalRendering->FSAA)
		glEnable(GL_MULTISAMPLE_ARB);

	int ret = 1;

	if (activeController != NULL) {
		ret = activeController->Update();

		if (ret) {
			ScopedTimer cputimer("GameController::Draw");
			ret = activeController->Draw();
		}
	}

	ScopedTimer cputimer("SwapBuffers");
	spring_time pre = spring_now();
	VSync.Delay();
	SDL_GL_SwapWindow(window);
	eventHandler.DbgTimingInfo(TIMING_SWAP, pre, spring_now());
	return ret;
}