r1cky17
30-10-2007 06:06:17
hi, i make racing game.
when i run my program from the program and the program work fine.
but if i run from the exe file, it's like render so fast.
so i can't see the program clearly. and the object like flying around
what's the problem with that?
here is my code in the frameStarted
thx for the help
when i run my program from the program and the program work fine.
but if i run from the exe file, it's like render so fast.
so i can't see the program clearly. and the object like flying around
what's the problem with that?
here is my code in the frameStarted
if (evt.timeSinceLastFrame > 0.8f) { return true; }
m_elapsed += evt.timeSinceLastFrame;
#ifdef _SP_DEBUG_LOG
Ogre::Real elap = m_elapsed;
m_totalelapsed += evt.timeSinceLastFrame;
#endif // _SP_DEBUG_LOG
int count = 0;
if ((m_elapsed > m_update) && (m_elapsed < (0.1f)) )
{
while (m_elapsed > m_update)
{
if (mUpdateNewton)
{
m_World->update( m_update );
}
userControls( m_update );
m_elapsed -= m_update;
count++;
}
}
else
{
if (m_elapsed < (m_update))
{
// not enough time has passed this loop, so ignore for now.
}
else
{
// in this case, too much time has passed to be properly handled, so perform 1 update, and clear the elapsed time.
if (mUpdateNewton)
{
m_World->update( m_update );
}
userControls( m_update );
m_elapsed = 0.0;
count++;
}
}
thx for the help