Here's my "game loop":
while(isRunning)
{
int errorCode = this->window->UpdateMessages();
this->timer->Frame();
double frameTime = this->timer->GetFrameTime();
static double frame = frameTime;
if(errorCode == 0)
{
if(frameTime >= (1000 / 60))
{
double deltaTime = frameTime / 1000.0; // delta frame time in seconds
// Update Input
if(this->engineDesc.cameraDesc.type != Static)
{
this->directInput->DetectInput((FreeCamera*)this->GetCamera(), this->profiler, deltaTime);
}
else
{
this->directInput->DetectInput(NULL, this->profiler, deltaTime);
}
// Call scene's Update()
this->scene->Update(deltaTime);
// Call renderer's Update()
this->renderer->Update(deltaTime);
// Call profiler's Update()
this->profiler->Update(frameTime);
}
// Call our Render function()
this->Render();
}
else if(errorCode == 2)
{
this->Stop();
}
}
And here the timer functions:
void Timer::Initialize()
{
QueryPerformanceFrequency((LARGE_INTEGER*)&this->frequency);
this->ticksPerMs = (double)(this->frequency / 1000);
QueryPerformanceCounter((LARGE_INTEGER*)&this->startTime);
return;
}
void Timer::Frame()
{
INT64 currentTime;
double timeDifference;
QueryPerformanceCounter((LARGE_INTEGER*)¤tTime);
timeDifference = (double)(currentTime - this->startTime);
this->frameTime = timeDifference / this->ticksPerMs;
this->startTime = currentTime;
}
double Timer::GetFrameTime()
{
return this->frameTime;
}
No matter what I try the picture is either black, white, or just still without any input or movement working.
Any ideas what I'm doing wrong ?







