kolibrios/programs/develop/ktcc/trunk/samples/tinygl/fps.c
turbocat e08c6968ef ktcc: rollback to r9529
git-svn-id: svn://kolibrios.org@9558 a494cfbc-eb01-0410-851d-a64ba20cac60
2022-01-02 12:16:17 +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;
}