Results 1 to 5 of 5

Thread: Framerate

  1. #1
    Junior Member Newbie
    Join Date
    May 2000
    Location
    Mexico, D.F.
    Posts
    2

    Framerate

    How can i get current framerate of OpenGL program in SGI computer?...

  2. #2
    Member Contributor
    Join Date
    May 2000
    Location
    Ottawa, Ontario, Canada
    Posts
    75

    Re: Framerate

    Here is the code I use.

    // Updates frame rate every 5 seconds
    case WM_TIMER:
    {
    int nFrames;
    char cOutBuffer[32];
    LARGE_INTEGER currentTime; float fps;
    // Get the frame count
    EnterCriticalSection(&csThreadSafe);
    nFrames = rsRenderData.uiFrames;
    LeaveCriticalSection(&csThreadSafe);

    // Get the current Time
    QueryPerformanceCounter(&currentTime);

    fps = (float)(nFrames - nLastFrames)/((float)(currentTime.QuadPart - startTime.QuadPart)/
    (float)timerFrequency.QuadPart);
    sprintf(cOutBuffer,"fps %0.1f ",fps);

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Framerate

    The above code is for Win32 platforms, and will most certainly not work on SGI computers. But the way to calculate it is still the same. Either calculate the time for any number of frame, or count the number of frames in any given time. fps=<number of frames>/<time in seconds> in both cases.

    Can't post any code since I'm no UNIX programmer.

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    Re: Framerate

    Check out the thread:
    http://www.opengl.org/discussion_boa...ML/000472.html

    it tells you what man pages to look at to get timing info. (If you need more help, let me know...)

    cheers,
    John

  5. #5
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    Re: Framerate

    You can get nanosecond resolution on SGI's with (I beleive) clock_gettime(SGI_REALTIME_CLOCK).

    I am not 100% sure this is the name, but it is close.

Similar Threads

  1. Low framerate during first seconds.
    By Crashy in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 09-10-2017, 11:06 PM
  2. GLSL and framerate
    By PascalM123 in forum OpenGL: GLSL
    Replies: 2
    Last Post: 09-21-2010, 11:31 AM
  3. Framerate
    By in forum OpenGL: User Software
    Replies: 1
    Last Post: 06-21-2004, 11:46 PM
  4. Framerate ?
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-02-2001, 04:43 AM
  5. is this a decent framerate?
    By Chiron in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 04-25-2001, 02:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean