diff --git a/openVulkanoCpp/Vulkan/Renderer.cpp b/openVulkanoCpp/Vulkan/Renderer.cpp index a6f4a7b..30390b8 100644 --- a/openVulkanoCpp/Vulkan/Renderer.cpp +++ b/openVulkanoCpp/Vulkan/Renderer.cpp @@ -74,6 +74,7 @@ namespace OpenVulkano::Vulkan void Renderer::Tick() { + if (!scene) [[unlikely]] return; currentImageId = context.swapChain.AcquireNextImage(); scene->GetCamera()->SetSize(context.window->GetWidth(), context.window->GetHeight()); scene->GetCamera()->SetContentScaleFactor(context.window->GetContentScale()); diff --git a/openVulkanoCpp/Vulkan/Resources/ManagedBuffer.hpp b/openVulkanoCpp/Vulkan/Resources/ManagedBuffer.hpp index a7c78c7..b7d920c 100644 --- a/openVulkanoCpp/Vulkan/Resources/ManagedBuffer.hpp +++ b/openVulkanoCpp/Vulkan/Resources/ManagedBuffer.hpp @@ -48,6 +48,9 @@ namespace OpenVulkano::Vulkan [[nodiscard]] void* GetMappedMemory() const { return mapped; } + template + [[nodiscard]] T* GetMappedMemory() const { return static_cast(mapped); } + /** * \brief Maps the buffer into the memory of the host. * \tparam T The type of the buffers data.