Skip to content
Snippets Groups Projects
Commit 71363ee5 authored by Vanessa Karolek's avatar Vanessa Karolek
Browse files

[#60][Fix] fix camera being update in unfocused or minimized window

parent dd2b67c1
Branches
Tags
1 merge request!65Resolve "Kamera - Steuerung mittels Controller"
...@@ -33,8 +33,10 @@ namespace vkcv::camera { ...@@ -33,8 +33,10 @@ namespace vkcv::camera {
} }
void CameraManager::resizeCallback(int width, int height) { void CameraManager::resizeCallback(int width, int height) {
for (size_t i = 0; i < m_cameras.size(); i++) { if (glfwGetWindowAttrib(m_window.getWindow(), GLFW_ICONIFIED) == GLFW_FALSE) {
getCamera(i).setRatio(static_cast<float>(width) / static_cast<float>(height));; for (size_t i = 0; i < m_cameras.size(); i++) {
getCamera(i).setRatio(static_cast<float>(width) / static_cast<float>(height));;
}
} }
} }
...@@ -182,7 +184,9 @@ namespace vkcv::camera { ...@@ -182,7 +184,9 @@ namespace vkcv::camera {
} }
void CameraManager::update(double deltaTime) { void CameraManager::update(double deltaTime) {
getActiveController().updateCamera(deltaTime, getActiveCamera()); if (glfwGetWindowAttrib(m_window.getWindow(), GLFW_FOCUSED) == GLFW_TRUE) {
getActiveController().updateCamera(deltaTime, getActiveCamera());
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment