Ticket #2882: t2882_limit_fps_wip_v1.patch

File t2882_limit_fps_wip_v1.patch, 627 bytes (added by elexis, 9 years ago)

Limits the FPS to 60 max. (showcase / wip)

  • source/main.cpp

     
    301301    }
    302302
    303303    // TODO: throttling: limit update and render frequency to the minimum.
    304304    // this is mostly relevant for "inactive" state, so that other windows
    305305    // get enough CPU time, but it's always nice for power+thermal management.
     306    SDL_Delay(16.0 - realTimeSinceLastFrame);
    306307
    307308
    308309    // this scans for changed files/directories and reloads them, thus
    309310    // allowing hotloading (changes are immediately assimilated in-game).
    310311    ReloadChangedFiles();