Вопрос

I have a C++ program using openGL and it calculates the fps of my animation. However, I'm getting an average fps of 800 (which seems a little high). This is the code I'm putting in my display() function

int frames = 0;
int counter = 1;

display()
{
    //animation!

    //calculate fps
    if(TIME >= counter)
    {
            std::cout << "Frames at Second " << counter <<": " << frames << std::endl;
            frames = 0;
            counter++;
    }
    frames++;

}

Is my average of 800 fps okay, or is there a problem with my code?

Это было полезно?

Решение

nope, its correct. You are rendering as fast as possible. If you want the typical 60 fps try putting on vsync

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top