29 lines
1.2 KiB
C++
29 lines
1.2 KiB
C++
#include "Latency_Eager_Plot_p.h"
|
|
namespace renderive {
|
|
Latency_Eager_Plot_Private::Latency_Eager_Plot_Private()
|
|
: Abs_Plot_Private(std::make_unique<Latency_Eager_Refresh_Strategy>()) {
|
|
latency_strategy = static_cast<Latency_Eager_Refresh_Strategy*>(strategy);
|
|
}
|
|
Latency_Eager_Plot::Latency_Eager_Plot()
|
|
: Abs_Plot(new Latency_Eager_Plot_Private()) {}
|
|
double Latency_Eager_Plot::max_render_fps() const {
|
|
auto* data = static_cast<Latency_Eager_Plot_Private*>(d);
|
|
return data->latency_strategy ? data->latency_strategy->max_render_fps() : 0.0;
|
|
}
|
|
void Latency_Eager_Plot::set_max_render_fps(double fps) {
|
|
auto* data = static_cast<Latency_Eager_Plot_Private*>(d);
|
|
if (data->latency_strategy) {
|
|
data->latency_strategy->set_max_render_fps(fps);
|
|
data->core->mark_render_state_dirty();
|
|
}
|
|
}
|
|
Refresh_Control_Snapshot Latency_Eager_Plot::refresh_feedback_snapshot() const {
|
|
auto* data = static_cast<Latency_Eager_Plot_Private*>(d);
|
|
return data->latency_strategy ? data->latency_strategy->feedback_state() : Refresh_Control_Snapshot{};
|
|
}
|
|
void Latency_Eager_Plot::start_render(int max_render_fps) {
|
|
set_max_render_fps(max_render_fps);
|
|
Abs_Plot::start_render();
|
|
}
|
|
} // namespace renderive
|