Results 1 to 4 of 4

Thread: Fps??

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    448

    Fps??

    is there a way to show your fps?

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    You can try the following code that also shows fps:
    http://www.exhedra.com/DirectX4VB/Tu...R_Lesson01.asp
    Baaaaaaaaah

  3. #3
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553
    If you want to measure FPS in a game, you could do like this:
    You need the GetTickCount API for this

    VB Code:
    1. public sub checkFPS()
    2.  
    3. dim lastCheck as long
    4. dim FPS as long
    5. dim tmpFPS as long
    6.  
    7. lastCheck = getTickCount
    8.  
    9. do
    10. tmpFPS = tmpFPS + 1
    11.  
    12. if gettickcount - lastcheck > 1000 then
    13. lastcheck = gettickcount
    14. fps = tmpFPS
    15. end if
    16.  
    17. doevents
    18. loop

    this is untested code, if it don't work, try to mix it a bit with a mixer
    ICQ: 128716725

  4. #4
    Addicted Member Janus's Avatar
    Join Date
    Aug 2001
    Location
    California
    Posts
    221
    Each time you redraw, increment a variable:

    Code:
    CurrentFPS=CurrentFPS + 1
    Then, every second, swap that to another variable:

    Code:
    If Int(Timer) <> Int(LastTimer) Then
       DisplayFPS = CurrentFPS
       CurrentFPS = 0
    End If
    LastTimer = Timer
    That method works pretty well, though it's easy enough to improve.
    "1 4m 4 1337 #4xz0r!'
    Janus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width