Beispiel #1
0
void EdenEngine::Run()
{
	bool shouldExit = false;
    float cpuTimer = 0.0f;

	while (!shouldExit)
	{
		mGameTimer->Frame();
		volatile int32 FPS = mGameTimer->GetFPS();
		
		if (mEngineWindow->DidScreenChange())
		{
			OnScreenChanged();
		}

        cpuTimer += mGameTimer->GetTimeMilliseconds();
        float delta = cpuTimer / 1000.0f;

        if (cpuTimer > CPU_FRAME_UPDATE_TIME)
        {
            shouldExit = !Update(delta);
            cpuTimer = 0;
        }

		shouldExit |= mEngineWindow->ShouldQuit() || !Render(delta) || mInputManager->IsKeyboardKeyPressed(KeyboardKey_Escape);
	}
}
Beispiel #2
0
void EdenEngine::Run()
{
	bool shouldExit = false;
	while (!shouldExit)
	{
		mGameTimer->Frame();
		float frameTime = mGameTimer->GetTime();
		int FPS = mGameTimer->GetFPS();

		if (mEngineWindow->DidScreenChange())
		{
			OnScreenChanged();
		}

		//TDA: Use timer for update time
		shouldExit = mEngineWindow->ShouldQuit() || !Update(0.0167f) || !Render() || mInputManager->IsKeyboardKeyPressed(KeyboardKey_Escape);
	}
}