mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-14 18:19:36 +01:00
45 lines
857 B
C++
45 lines
857 B
C++
#pragma once
|
|
|
|
#include "Common/GPU/thin3d.h"
|
|
|
|
// See big comment in the CPP file.
|
|
|
|
namespace Draw {
|
|
class DrawContext;
|
|
}
|
|
|
|
class FrameTiming {
|
|
public:
|
|
// Some backends won't allow changing this willy nilly.
|
|
Draw::PresentMode presentMode;
|
|
int presentInterval;
|
|
|
|
// The new timing method.
|
|
bool usePresentTiming;
|
|
|
|
double cpuSliceStartTime;
|
|
double cpuTime;
|
|
double timeStep;
|
|
double postSleep;
|
|
|
|
double lastPresentTime;
|
|
double nextPresentTime;
|
|
|
|
void Reset(Draw::DrawContext *draw);
|
|
|
|
void BeforeCPUSlice(const FrameHistoryBuffer &frameHistory);
|
|
void SetTimeStep(float scaledTimeStep);
|
|
void DontUse();
|
|
void AfterCPUSlice();
|
|
void BeforePresent();
|
|
void AfterPresent();
|
|
|
|
private:
|
|
bool setTimestepCalled_ = false;
|
|
double nudge_ = 0.0;
|
|
};
|
|
|
|
extern FrameTiming g_frameTiming;
|
|
|
|
Draw::PresentMode ComputePresentMode(Draw::DrawContext *draw, int *interval);
|