Tell me how to display fps using SDL 2? Maybe there is some tutorial?

I read http://lazyfoo.net/SDL_tutorials/lesson07/index.php.

Problem: I do not have the function SDL_Flip.

I deduce through SDL_RenderCopy and SDL_RenderPresent .

You can of course cram the surface with text into the texture, but I need to output fps. Is it possible to constantly shove it into texture?

    2 answers 2

    I myself have not long been looking for an answer to the same question, and I found it

    http://lazyfoo.net/tutorials/SDL/24_calculating_frame_rate/index.php

    Then I found the port of their tutorov in SDL2 here

      You need to load into the texture 1 time per second, only, and display 60 times per second.