What are the SDL equivalents of the following 2 Windows Timer functions…
bool Init()
{
if (!QueryPerformanceFrequency(&m_ticksPerSecond))
{
// system doesn’t support hi-res timer
return false;
}
else
{
QueryPerformanceCounter(&m_startTime);
return true;
}
} // end Init()
float GetElapsedSeconds(unsigned long elapsedFrames = 1)
{
static LARGE_INTEGER s_lastTime = m_startTime;
LARGE_INTEGER currentTime;
QueryPerformanceCounter(¤tTime);
float seconds = ((float)currentTime.QuadPart -
(float)s_lastTime.QuadPart) / (float)m_ticksPerSecond.QuadPart;
// reset the timer
s_lastTime = currentTime;
return seconds;
} // end GetElapsedSeconds()–
Dominique
http://www.DelphiGamer.com := go on, write a game instead;