Thread: C++ - win32: how calculate the Frame Per Second on GameLoop?

  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    451

    C++ - win32: how calculate the Frame Per Second on GameLoop?

    how can i calculate the FPS on GameLoop?
    Code:
    int Frame=0;
    void GameLoop()
    {
         //GetInput();
         //UpdateMovements();
         //DrawFrameThings();
         //Frame++;
         //GetTimeSomething();
         //if the time is a second then
         //FPS = Frame;
         //Frame=0;
    }
    i did a bad pseucode... but i don't know how get the time and test if is 1 second.

    PS: i need a correction: before draw the frame(a memory frame), on screen, do i need, 1st, clear the screen(draw a fill black rectangle)?
    Last edited by joaquim; 10-05-2022 at 09:23 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Win32 API, can it inFile and outFile, like Win32 console?
    By neutral87 in forum Windows Programming
    Replies: 6
    Last Post: 05-04-2013, 07:19 AM
  2. Win32 Console Application event handlers, or Win32 Project?
    By Joewbarber in forum C++ Programming
    Replies: 1
    Last Post: 03-29-2013, 07:02 AM
  3. Replies: 3
    Last Post: 09-17-2006, 08:13 AM
  4. MMO Theory, How to make Gameloop & Sockets both work?
    By Zeusbwr in forum Game Programming
    Replies: 3
    Last Post: 08-01-2005, 12:29 PM
  5. Text based frame in win32 console
    By GaPe in forum C Programming
    Replies: 8
    Last Post: 04-16-2002, 07:01 AM

Tags for this Thread