fallout2-ce/src/fps_limiter.h

22 lines
312 B
C
Raw Normal View History

2022-05-23 01:13:28 -07:00
#ifndef FPS_LIMITER_H
#define FPS_LIMITER_H
2022-05-28 02:48:26 -07:00
#include <cstddef>
2022-09-23 05:43:44 -07:00
namespace fallout {
2022-05-23 01:13:28 -07:00
class FpsLimiter {
public:
2022-05-28 02:48:26 -07:00
FpsLimiter(std::size_t fps = 60);
2022-05-23 01:13:28 -07:00
void mark();
void throttle() const;
private:
2022-05-28 02:48:26 -07:00
const std::size_t _fps;
std::size_t _ticks;
2022-05-23 01:13:28 -07:00
};
2022-09-23 05:43:44 -07:00
} // namespace fallout
2022-05-23 01:13:28 -07:00
#endif /* FPS_LIMITER_H */