fix: Buggy window detachment
This commit is contained in:
parent
f7b431902d
commit
dc1a5a860c
@ -165,10 +165,9 @@ namespace hex {
|
|||||||
bool shouldLongSleep = !m_unlockFrameRate;
|
bool shouldLongSleep = !m_unlockFrameRate;
|
||||||
|
|
||||||
// Wait 5 frames before actually enabling the long sleep mode to make animations not stutter
|
// Wait 5 frames before actually enabling the long sleep mode to make animations not stutter
|
||||||
constexpr static auto LongSleepTimeout = 5;
|
|
||||||
static i32 lockTimeout = 0;
|
static i32 lockTimeout = 0;
|
||||||
if (!shouldLongSleep) {
|
if (!shouldLongSleep) {
|
||||||
lockTimeout = LongSleepTimeout;
|
lockTimeout = m_lastFrameTime * 10'000;
|
||||||
} else if (lockTimeout > 0) {
|
} else if (lockTimeout > 0) {
|
||||||
lockTimeout -= 1;
|
lockTimeout -= 1;
|
||||||
}
|
}
|
||||||
@ -610,13 +609,12 @@ namespace hex {
|
|||||||
previousVtxDataSize = vtxDataSize;
|
previousVtxDataSize = vtxDataSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::UpdatePlatformWindows();
|
|
||||||
|
|
||||||
if (shouldRender) {
|
|
||||||
GLFWwindow *backupContext = glfwGetCurrentContext();
|
GLFWwindow *backupContext = glfwGetCurrentContext();
|
||||||
|
ImGui::UpdatePlatformWindows();
|
||||||
ImGui::RenderPlatformWindowsDefault();
|
ImGui::RenderPlatformWindowsDefault();
|
||||||
glfwMakeContextCurrent(backupContext);
|
glfwMakeContextCurrent(backupContext);
|
||||||
|
|
||||||
|
if (shouldRender) {
|
||||||
int displayWidth, displayHeight;
|
int displayWidth, displayHeight;
|
||||||
glfwGetFramebufferSize(m_window, &displayWidth, &displayHeight);
|
glfwGetFramebufferSize(m_window, &displayWidth, &displayHeight);
|
||||||
glViewport(0, 0, displayWidth, displayHeight);
|
glViewport(0, 0, displayWidth, displayHeight);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user