Results 1 to 4 of 4

Thread: FPS calculation...

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    636

    FPS calculation...

    Hi!

    How can I calculate the FPS in my game
    when I use GetTickCount?

    Thank you,
    Arie.

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Code:
    'General
       'Framecounter
       Global StartTime As Long
       Global FrameCount As Long
       Global FPS As Long
    
    'Game main
    Sub Main()
       Dim Temp As Long
        
       'Main loop
       While Active
          Temp = GetTickCount
    
          'Do game stuff here
    
          'Calculate FPS
          If StartTime < GetTickCount Then
             FPS = FrameCount
             
             'Code to show FPS goes here
             
             FrameCount = 0
             StartTime = GetTickCount + 1000
          End If
          FrameCount = FrameCount + 1
          
          DoEvents
       Wend
    End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Israel
    Posts
    636

    Thank you, Fox.

    Arie.

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    My pleasure, mylady ^_^

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