snes9x/vulkan/std_chrono_throttle.hpp
BearOso 309f9e650d vulkan: Move throttle out of swapchain.
Make the swapchain wrapper more flexible, allowing deferring the
swap from the end_frame function.
2023-03-07 14:01:29 -06:00

17 lines
451 B
C++

#pragma once
#include <chrono>
struct Throttle
{
void set_frame_rate(double frame_rate);
void advance();
void reset();
void wait_for_frame();
void wait_for_frame_and_rebase_time();
std::chrono::microseconds remaining();
double max_frame_rate = 0.0;
double frame_duration = 0.0;
std::chrono::microseconds frame_duration_us;
std::chrono::time_point<std::chrono::steady_clock, std::chrono::microseconds> then;
};