Draw FPS ( Frame Per Second )

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts Page 1 of 1
Contributors
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

Draw FPS ( Frame Per Second )
NecroPhis
MY First Tutorial Since I Came Back clapper; cooll; goofy;

here is a simple tutorial that shows Frame Per Second :)
i released this code b4 for some other sites

so if u c it on another page don't say leeched and sth like that :)

Credits :aku ( my friend )

First add a module And Module Code :
Code: Select all
  Public Declare Function GetTickCount Lib "kernel32" () As Long 


    Public LastFPS As Long 


    Public CountFPS As Long 


    Public CurFPS As Integer 


    Public HighestFPS As Integer  
Add a timer on forum ( Interval Max : 25 / Min : 1 Enabled = true )

And timer's Code :
Code: Select all
If GetTickCount() - LastFPS >= 1000 Then 
            CurFPS = CountFPS 
            CountFPS = 0  set the counter 
            LastFPS = GetTickCount() 

         
            If CurFPS > HighestFPS Then 
                HighestFPS = CurFPS 
            End If 
        End If 

        CountFPS = CountFPS + 1 
      
        Me.Text = CurFPS  
with this code , Current FPS will appear in Form's text :)
u can add it to label , textbox or another thing :)

Have a good day
Last edited by NecroPhis on Sat Jul 30, 2011 2:19 am, edited 1 time in total.
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: Draw FPS ( Frame Per Second )
mandai
Since when does GetTickCount relate to the video frames that are drawn on screen?
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

Re: Draw FPS ( Frame Per Second )
NecroPhis
hmm i want to answer your question my english is bad i couldnt understandvery well
but as i can understand , yes its something like that :)
Image
User avatar
Axel
Coding God
Coding God
Posts: 1928
Joined: Sun Jun 27, 2010 9:15 pm

Re: Draw FPS ( Frame Per Second )
Axel
How is the time the computer is running related to the fps?
if you want a real fps thing then you should calculate it by the form_paint event or so
http://vagex.com/?ref=25000
User avatar
zachman61
VIP - Donator
VIP - Donator
Posts: 1891
Joined: Wed Dec 16, 2009 9:56 pm

Re: Draw FPS ( Frame Per Second )
zachman61
NecroPhis wrote:
hmm i want to answer your question my english is bad i couldnt understandvery well
but as i can understand , yes its something like that :)
I've seen this tutorial alot of times.
I doubt your english is bad you just copied/pasted.
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that :)
User avatar
NecroPhis
VIP - Donator
VIP - Donator
Posts: 345
Joined: Sun Aug 08, 2010 1:14 pm

Re: Draw FPS ( Frame Per Second )
NecroPhis
nah myfriend gave me the codes :O
and i released it on some sites
he told me he made it
Image
6 posts Page 1 of 1
Return to “Tutorials”