Fix viewport resizing not updating camera aspect ratio
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "Scene/VulkanGeometry.hpp"
|
||||
#include "Scene/VulkanNode.hpp"
|
||||
#include "Scene/VulkanShader.hpp"
|
||||
#include "Base/UI/IVulkanWindow.hpp"
|
||||
#include "Host/PlatformProducer.hpp"
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -62,6 +63,7 @@ namespace openVulkanoCpp::Vulkan
|
||||
void Renderer::Tick()
|
||||
{
|
||||
currentImageId = context.swapChain.AcquireNextImage();
|
||||
scene->GetCamera()->SetSize(context.window->GetWidth(), context.window->GetHeight());
|
||||
Render();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,10 @@ namespace openVulkanoCpp::Vulkan
|
||||
const vk::SurfaceCapabilitiesKHR surfaceCapabilities = device->physicalDevice.getSurfaceCapabilitiesKHR(surface);
|
||||
if(surfaceCapabilities.currentExtent.width != ~static_cast<uint32_t>(0))
|
||||
{ // The surface does provide it's size to the vulkan driver
|
||||
if (surfaceCapabilities.currentExtent != size)
|
||||
{
|
||||
Logger::RENDER->warn("Surface resolution ({}, {}) does not match given render resolution ({}, {}).", size.width, size.height, surfaceCapabilities.currentExtent.width, surfaceCapabilities.currentExtent.height);
|
||||
}
|
||||
size = surfaceCapabilities.currentExtent;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user