forked from KolibriOS/kolibrios
- Added TinyGL for ktcc
- Added TinyGL example "gears" git-svn-id: svn://kolibrios.org@8405 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
33
programs/develop/ktcc/trunk/samples/tinygl/fps.c
Normal file
33
programs/develop/ktcc/trunk/samples/tinygl/fps.c
Normal file
@@ -0,0 +1,33 @@
|
||||
#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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user