How to calculate FPS in OpenGL?

后端 未结 3 672
暗喜
暗喜 2021-02-15 13:06
void CalculateFrameRate()
{    
    static float framesPerSecond    = 0.0f;       // This will store our fps
    static float lastTime   = 0.0f;       // This will hold          


        
3条回答
  •  野的像风
    2021-02-15 13:24

    You should put it in the display loop. Here's an article that explains some intricacies of game loops that you should read.

提交回复
热议问题