Add check for viewport size change to update camera
This commit is contained in:
parent
eb1e2a0ba8
commit
eff5bb09e9
|
@ -342,8 +342,11 @@ void Scene::DrawGui(GLFWwindow* window) {
|
|||
// Draw FBO to ImGui window
|
||||
ImGui::Begin("Scene Window");
|
||||
ImVec2 windowSize = ImGui::GetContentRegionAvail();
|
||||
window_width = ImGui::GetWindowSize().x;
|
||||
window_height = ImGui::GetWindowSize().y;
|
||||
if (ImGui::GetWindowSize().x != window_width || ImGui::GetWindowSize().y != window_height) {
|
||||
window_width = ImGui::GetWindowSize().x;
|
||||
window_height = ImGui::GetWindowSize().y;
|
||||
UpdateCamera();
|
||||
}
|
||||
ImGui::Image((void*)(intptr_t)lht_fbo_.albedoTexture, ImVec2(window_width, window_height), ImVec2(0, 1), ImVec2(1, 0));
|
||||
ImGui::End();
|
||||
|
||||
|
|
Loading…
Reference in New Issue