impr: Only re-render frame once during window resize or move operations
This commit is contained in:
parent
a6e5040e8f
commit
90ac96298a
@ -135,6 +135,11 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
|
||||||
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
|
win->fullFrame();
|
||||||
|
});
|
||||||
|
|
||||||
if (themeFollowSystem)
|
if (themeFollowSystem)
|
||||||
EventOSThemeChanged::post();
|
EventOSThemeChanged::post();
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,11 @@ namespace hex {
|
|||||||
});
|
});
|
||||||
|
|
||||||
setupMacosWindowStyle(m_window, ImHexApi::System::isBorderlessWindowModeEnabled());
|
setupMacosWindowStyle(m_window, ImHexApi::System::isBorderlessWindowModeEnabled());
|
||||||
|
|
||||||
|
glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
|
||||||
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
|
win->fullFrame();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::beginNativeWindowFrame() {
|
void Window::beginNativeWindowFrame() {
|
||||||
|
@ -85,6 +85,11 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
|
||||||
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
|
win->fullFrame();
|
||||||
|
});
|
||||||
|
|
||||||
if (themeFollowSystem)
|
if (themeFollowSystem)
|
||||||
EventOSThemeChanged::post();
|
EventOSThemeChanged::post();
|
||||||
}
|
}
|
||||||
|
@ -560,8 +560,12 @@ namespace hex {
|
|||||||
|
|
||||||
glViewport(0, 0, width, height);
|
glViewport(0, 0, width, height);
|
||||||
ImHexApi::System::impl::setMainWindowSize(width, height);
|
ImHexApi::System::impl::setMainWindowSize(width, height);
|
||||||
|
});
|
||||||
|
|
||||||
|
glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
|
||||||
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
win->fullFrame();
|
win->fullFrame();
|
||||||
|
DwmFlush();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -581,8 +585,7 @@ namespace hex {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Window::endNativeWindowFrame() {
|
void Window::endNativeWindowFrame() {
|
||||||
if (!ImHexApi::System::isBorderlessWindowModeEnabled())
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -817,8 +817,6 @@ namespace hex {
|
|||||||
|
|
||||||
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
win->m_unlockFrameRate = true;
|
win->m_unlockFrameRate = true;
|
||||||
|
|
||||||
win->fullFrame();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register window resize callback
|
// Register window resize callback
|
||||||
@ -837,17 +835,9 @@ namespace hex {
|
|||||||
ImGui::GetIO().MousePos = ImVec2();
|
ImGui::GetIO().MousePos = ImVec2();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
win->fullFrame();
|
|
||||||
#endif
|
#endif
|
||||||
});
|
});
|
||||||
|
|
||||||
#if defined(OS_MACOS)
|
|
||||||
glfwSetWindowRefreshCallback(m_window, [](GLFWwindow *window) {
|
|
||||||
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
|
||||||
win->fullFrame();
|
|
||||||
});
|
|
||||||
#endif
|
|
||||||
|
|
||||||
glfwSetCursorPosCallback(m_window, [](GLFWwindow *window, double, double) {
|
glfwSetCursorPosCallback(m_window, [](GLFWwindow *window, double, double) {
|
||||||
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
auto win = static_cast<Window *>(glfwGetWindowUserPointer(window));
|
||||||
win->m_unlockFrameRate = true;
|
win->m_unlockFrameRate = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user