Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMedo3337

Posted 29 November 2012 - 04:11 AM

Thanks for your quick response, but the problem I'm having is that I could call the method move() from any place in the program other than calling it from render(), so I don't know what is the value of 'deltaTimeInSeconds'.

Take a look at the following:
void render()
{
  long long currentTicks = ReadClockTickCounter();
  long long deltaTicks = currentTicks - previousTicks;
  previousTicks = currentTicks;
  float deltaTimeInSeconds = (float)( (double)deltaTicks / (double)ClockTicksPerSecond() );
  // I don't need to move it while rendering, it will be moving when move() is called from other methods (move() will not be called from render())
  //move( deltaTimeInSeconds );
}

void work() // This method has nothing to do with render() and it's not called from render()
{
       move(???); // Since work() has nothing to do with render(), I don't know what is the value of deltaTimeInSeconds
}

#2Medo3337

Posted 29 November 2012 - 04:11 AM

Thanks for your quick response, but the problem I'm having is that I could call the method move() from any place in the program other than calling it from render(), so I don't know what is the value of 'deltaTimeInSeconds'.

Take a look at the following:
void render()
{
  long long currentTicks = ReadClockTickCounter();
  long long deltaTicks = currentTicks - previousTicks;
  previousTicks = currentTicks;
  float deltaTimeInSeconds = (float)( (double)deltaTicks / (double)ClockTicksPerSecond() );
  // I don't need to move it while rendering, it will be moving when move() is called from other methods (move() will not be called from render())
  //move( deltaTimeInSeconds );
}

void work() // This method has nothing to do with render() and it's not called from render()
{
       move(...); // Since work() has nothing to do with render(), I don't know what is the value of deltaTimeInSeconds
}

#1Medo3337

Posted 29 November 2012 - 04:10 AM

Thanks for your quick response, but the problem I'm having is that I could call the method move() from any place in the program other than calling it from render(), so I don't know what is the value of 'deltaTimeInSeconds'.

Take a look at the following:
void render()
{
  long long currentTicks = ReadClockTickCounter();
  long long deltaTicks = currentTicks - previousTicks;
  previousTicks = currentTicks;
  float deltaTimeInSeconds = (float)( (double)deltaTicks / (double)ClockTicksPerSecond() );
  // I don't need to move it while rendering, it will be moving when move() is called from other methods (move() will not be called from render())
  //move( deltaTimeInSeconds );
}

void work() // This method has nothing to do with render() and it's not called from render()
{
       move(...); // Since work has nothing to do with render(), I don't know what is the value of deltaTimeInSeconds
}

PARTNERS