WM_TIMER probs (FPS Calculations)

This is a discussion on WM_TIMER probs (FPS Calculations) within the C++ Programming forums, part of the General Programming Boards category; im havin probs with this bit of code: Code: case WM_TIMER: { if (wParam == FPS_TIMER) { FPSCount = round(FPSCount ...

  1. #1
    The N00b That Owns You!
    Join Date
    Jul 2005
    Location
    Canada!
    Posts
    178

    WM_TIMER probs (FPS Calculations)

    im havin probs with this bit of code:

    Code:
    case WM_TIMER:
            {
                if (wParam == FPS_TIMER)
                {
                    FPSCount = round(FPSCount * 1000/FPS_INTERVAL);
                    SetWindowText(hWnd, (WND_TITLE + "     [" + IntToString(FPSCount) + " FPS]")); 
                    FPSCount = 0;
                    return 0;
                }
            }
    my IntToString function looks like this:
    Code:
    std::string IntToString(int num) 
    {
        std::ostringstream ITS;
        ITS << num;
        
        return(ITS.str());
    }
    FPSCount starts as a value of 0

    FPS_TIMER has a valuue of 1
    FPS_INTERVAL has a value of 1000

    ive included the following:
    Code:
    #include <math.h>
    #include <windows.h>
    By the way i got these errors all in that function:

    411 C:\Documents and Settings\Admin\Desktop\Programmin\Conversions\temp late1.5\Main.cpp expected primary-expression before '=' token

    413 C:\Documents and Settings\Admin\Desktop\Programmin\Conversions\temp late1.5\Main.cpp expected primary-expression before '=' token

    414 C:\Documents and Settings\Admin\Desktop\Programmin\Conversions\temp late1.5\Main.cpp expected primary-expression before '=' token

    414 C:\Documents and Settings\Admin\Desktop\Programmin\Conversions\temp late1.5\Main.cpp invalid operands of types `const char[43]' and `const char[7]' to binary `operator+' << this has to do with SetWindowText()

    all the other ones have to with all the =' signs

    Thanks!
    Last edited by C+noob; 10-02-2005 at 03:42 AM.
    New Function!!!!

    glAddIdol(C+noob);

    The feeling of rusty spoons against my salad fingers is almost ORGASMIC

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SwapBuffers & fps
    By hannibar in forum Windows Programming
    Replies: 0
    Last Post: 03-13-2006, 05:19 AM
  2. Game update...
    By jdinger in forum Game Programming
    Replies: 14
    Last Post: 11-08-2002, 07:10 AM
  3. FPS Counter Prob in OpenGL
    By brandonp in forum Game Programming
    Replies: 1
    Last Post: 07-16-2002, 03:49 PM
  4. SkyLock graphics demo (scrolling, etc.)
    By jdinger in forum Game Programming
    Replies: 9
    Last Post: 06-30-2002, 09:18 PM
  5. dramatic decrease in fps
    By DavidP in forum Game Programming
    Replies: 4
    Last Post: 06-27-2002, 10:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21