What variable can I use to check the fps?

Posted By: thegamedesigner

What variable can I use to check the fps? - 09/13/09 17:27

Hello, I've looked in the manual, and used the search function. I can't find my answer, so I'm asking here.

I want to check what the FPS is in my code, like this:

if(fps > 50)
{

}
else
{

}

But I don't know the variable name, and like I said, I can't find it in the manual or the forums (forums are just hard to search for this term, it's mentioned so much).

- Michael.
Posted By: rvL_eXile

Re: What variable can I use to check the fps? - 09/13/09 17:37

I have written this Function, this FPS Pnael, shows the Framrate in different colors (green = Great / orange=ok / Red = Bad) and the visible entitys / visible Polycount.

Code:
text info_txt 
{
		 Font=arial_font2;
       layer = 20; 
       pos_x = 797;
       pos_y = 0;
       string = "FPS";
       string = "Polygone";
       string = "Entitys";
       flags = visible;

}

panel framerate_pan 
{

       pos_x = 700; //820
       pos_y = 0; //740
       layer = 20;
       digits = 150, 0,7,arial_font2,1, fpsec;  //FPS 
       digits = 150,15,7,arial_font2,1,num_visentpolys ; //POLYS
       digits = 150,33,7,arial_font2,1,num_visents ; //ENTITYS    
       flags = overlay, refresh, visible;
} 

 

starter set_fpsmax()
{

       while (1)
       {
               
               init_frames = total_frames;
               sleep (1);
               fpsec = total_frames - init_frames;
               
               If(fpsec<=400 && fpsec>=51)
               {
               framerate_pan.red=60;
               framerate_pan.green=200;
               framerate_pan.blue=60;	
					}               
               
               If(fpsec>=31 && fpsec<=50)
               {
               framerate_pan.red=255;
               framerate_pan.green=190;
               framerate_pan.blue=80;	
					}
					
               If(fpsec<30)
               {
               framerate_pan.red=255;
               framerate_pan.green=0;
               framerate_pan.blue=0;	
					}
               
               wait (1);

       }

}



cYa Sebastian
Posted By: thegamedesigner

Re: What variable can I use to check the fps? - 09/13/09 18:39

Thanks. I'll use your system there.
© 2024 lite-C Forums