Hello everybody,
Can someone share code example how to do frame-indipendant timer and implement it in Irrlicht? I'm tired of trying to do this...waiting for any help
Happy New Year,
Isgalvotas.
Again timer...
-
- Posts: 13
- Joined: Mon Oct 31, 2005 8:58 pm
- Location: Lithuania
- Contact:
#include <time.h>
//Timer
time_t TimeStamp;
tm *nun;
int now;
int before;
/////////////TIMER//////////////////////////////////////////////////////////////
TimeStamp = time(0);
nun = localtime(&TimeStamp);
now = nun->tm_sec;
before = nun->tm_sec;
////////////////////////////////////////////////////////////////////////////////
while(true)
{
//Time the timer!!!
if(now >= before+1)
{
before=now;
//Print time
cout<<before<<endl;
///////////////////////End Timer//////////////////////////////////
}
TimeStamp = time(0);
nun = localtime(&TimeStamp);
now = nun->tm_sec;
if(now == 0)
before=0;
}
//Timer
time_t TimeStamp;
tm *nun;
int now;
int before;
/////////////TIMER//////////////////////////////////////////////////////////////
TimeStamp = time(0);
nun = localtime(&TimeStamp);
now = nun->tm_sec;
before = nun->tm_sec;
////////////////////////////////////////////////////////////////////////////////
while(true)
{
//Time the timer!!!
if(now >= before+1)
{
before=now;
//Print time
cout<<before<<endl;
///////////////////////End Timer//////////////////////////////////
}
TimeStamp = time(0);
nun = localtime(&TimeStamp);
now = nun->tm_sec;
if(now == 0)
before=0;
}
We're programmers. Programmers are, in their hearts, architects, and the first thing they want to do when they get to a site is to bulldoze the place flat and build something grand. We're not excited by renovation:tinkering,improving,planting flower beds.
-
- Posts: 13
- Joined: Mon Oct 31, 2005 8:58 pm
- Location: Lithuania
- Contact:
Thanks
Thanx a lot for code! Now I have timer in my game.
Best wishes,
Isgalvotas.
Best wishes,
Isgalvotas.