mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
impr: Much more accurate frame rate limiting
Many thanks to @ws909 in https://github.com/glfw/glfw/issues/2737
This commit is contained in:
@@ -56,9 +56,7 @@ namespace hex {
|
||||
|
||||
void drawImGui();
|
||||
void drawWithShader();
|
||||
|
||||
void unlockFrameRate();
|
||||
void forceNewFrame();
|
||||
|
||||
GLFWwindow *m_window = nullptr;
|
||||
ImGuiTestEngine *m_testEngine = nullptr;
|
||||
@@ -76,17 +74,9 @@ namespace hex {
|
||||
|
||||
u32 m_searchBarPosition = 0;
|
||||
bool m_emergencyPopupOpen = false;
|
||||
|
||||
std::jthread m_frameRateThread;
|
||||
std::chrono::duration<double, std::nano> m_remainingUnlockedTime;
|
||||
|
||||
std::mutex m_sleepMutex;
|
||||
std::atomic<bool> m_sleepFlag;
|
||||
std::condition_variable m_sleepCondVar;
|
||||
|
||||
std::mutex m_wakeupMutex;
|
||||
std::atomic<bool> m_wakeupFlag;
|
||||
std::condition_variable m_wakeupCondVar;
|
||||
bool m_shouldUnlockFrameRate = false;
|
||||
double m_fpsUnlockedEndTime = 0.0;
|
||||
bool m_waitEventsBlocked = false;
|
||||
|
||||
gl::Shader m_postProcessingShader;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user