kolibrios-fun/programs/develop/ktcc/trunk/samples/tinygl/fps.c
superturbocat2001 e3dcd433b3 - Added TinyGL for ktcc
- Added TinyGL example "gears"

git-svn-id: svn://kolibrios.org@8405 a494cfbc-eb01-0410-851d-a64ba20cac60
2020-12-14 14:38:38 +00:00

34 lines
449 B
C

#include <kos32sys1.h>
int time1=0;
int time2=0;
int fps1=0;
int timerend=0;
int Fps()
{
int tr;
time1=get_tick_count();
if (timerend==0)
{
time2=time1;
timerend=time1;
}
tr = time1 - timerend;
if ((time1 - time2) < 100)
{
fps1++;
}
else
{
draw_bar(330,8, 50,10,0xFFFFFF);
draw_number_sys(fps1,330,8,10,0x0);
fps1=0;
time2=time1;
}
timerend=time1;
return tr;
}