PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Getting Exact Tick Count

Hello there. I'm in the process of porting all the code I'm working on for my game to use the GApi. What I'm wondering is if there's a way to get the EXACT number of millisecond ticks between calls to ProcessNextFrame(). I've noticed that within the GDTIMER struct that CGapiTimer uses there is a filed called dwTickCount. However as the GDTIMER m_timer is private I can't get to any of those values (and I don't want to change the GAPI stuff if I don't have to). The reason I need access to this is all my old animations, movement, etc was based on that tickCount. IE for movement:
Code:

void update( int tickDiff)
{
double distx=VelX*(double)tickDiff;
double disty=VelY*(double)tickDiff;
}

For animations
Code:

void animate( int tickDiff )
{
this.CurFrameTime += tickDiff;
if( this.CurFrameTime > this.FrameTime )
{
// update frame
this.CurFrameTime = this.CurFrameTime-this.FrameTime;
}
}


So I need to know if there's a way to get access to that of if there's something within what GApi provides that I should be using (perhaps something with GDAPP_FRAMETIMEOVERFLOW? I'm new to it so forgive my noobness).
Thank you
Mike
BTW forgot to mention I'm using the Gapi 3.6 developing for a Smartphone.

I also noticed mentions of a WaitForNextFrame() which i can't seem to find anywhere. Was that removed from the latest version?
In ProcessNextFrame()

Code:

static DWORD iLastFrameMs = GetTickCount();
DWORD iFrameMs = GetTickCount() - iLastFrameMs;
iLastFrameMs += iFrameMs;

// Execute the frame.


iFrameMs is the milliseconds elapsed since the last frame. Originally 0 on the first frame (though this is not guaranteed).