[SOLVED] problem with execution

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

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

Lioric

30-10-2007 15:04:34

What do you mean with "run program from the program"?

r1cky17

30-10-2007 15:12:10

sorry
i mean i run the program from C++. and it's done well.
but if i run from the EXE file, it's render so fast

Lioric

31-10-2007 15:08:59

When executing the program from the IDE, the most notable difference is that unitialized variables can be set to a different value, review if you dont have any unitialized variable that might be affecting the program execution (as m_update)

r1cky17

11-11-2007 19:28:31

thx Lioric,
i forgot to init my camera mode :D