diff --git a/Folder.DotSettings.user b/Folder.DotSettings.user
new file mode 100644
index 0000000..1758e89
--- /dev/null
+++ b/Folder.DotSettings.user
@@ -0,0 +1,5 @@
+
+ True
+ (Doc Ln 10 Col 4)
+ DB94C55F-6B9A-4AAE-80D7-29FD8153E6B5/d:aster/f:window.h
+ NumberedBookmarkManager
\ No newline at end of file
diff --git a/aster/CMakeLists.txt b/aster/CMakeLists.txt
index 9e95315..0e952f6 100644
--- a/aster/CMakeLists.txt
+++ b/aster/CMakeLists.txt
@@ -22,7 +22,7 @@ set(HEADER_FILES
swapchain.h
pipeline.h
queue_allocation.h
- buffer.h)
+ buffer.h "surface.h" "size.h")
set(SOURCE_FILES
logger.cpp
@@ -35,7 +35,7 @@ set(SOURCE_FILES
pipeline.cpp
buffer.cpp
image.cpp
- image.h)
+ image.h "surface.cpp")
add_library(aster_core STATIC ${SOURCE_FILES} ${HEADER_FILES})
set_property(TARGET aster_core PROPERTY CXX_STANDARD 20)
diff --git a/aster/context.cpp b/aster/context.cpp
index 212ca52..d17e85a 100644
--- a/aster/context.cpp
+++ b/aster/context.cpp
@@ -42,14 +42,6 @@ Context::Context(const cstr appName, const Version version, bool enableValidatio
{
INFO_IF(enableValidation, "Validation Layers enabled");
- if (!glfwInit())
- {
- const char *error = nullptr;
- const auto code = glfwGetError(&error);
- ERROR("GLFW Init failed. Cause: ({}) {}", code, error)
- THEN_ABORT(code);
- }
-
// TODO Get/Check API Version
// Creating Instance
@@ -119,8 +111,6 @@ Context::~Context()
}
m_Instance.destroy(nullptr);
DEBUG("Instance destroyed");
-
- glfwTerminate();
}
Context::Context(Context &&other) noexcept
diff --git a/aster/physical_device.cpp b/aster/physical_device.cpp
index 1c25af3..8b4606b 100644
--- a/aster/physical_device.cpp
+++ b/aster/physical_device.cpp
@@ -6,6 +6,7 @@
#include "physical_device.h"
#include "context.h"
+#include "surface.h"
#include "window.h"
[[nodiscard]] vk::SurfaceCapabilitiesKHR
@@ -154,12 +155,11 @@ EnumeratePhysicalDevices(const vk::Instance instance)
return physicalDevices;
}
-PhysicalDevices::PhysicalDevices(const Window *window, const Context *context)
+PhysicalDevices::PhysicalDevices(const Surface *surface, const Context *context)
{
- auto surface = window->m_Surface;
auto physicalDevices = EnumeratePhysicalDevices(context->m_Instance);
for (auto physicalDevice : physicalDevices)
{
- this->emplace_back(surface, physicalDevice);
+ this->emplace_back(surface->m_Surface, physicalDevice);
}
}
diff --git a/aster/physical_device.h b/aster/physical_device.h
index 5f8e828..8f66cf9 100644
--- a/aster/physical_device.h
+++ b/aster/physical_device.h
@@ -6,6 +6,8 @@
#pragma once
#include "global.h"
+#include "surface.h"
+
#include
struct Window;
@@ -52,5 +54,5 @@ struct PhysicalDevice final
class PhysicalDevices : public eastl::fixed_vector
{
public:
- PhysicalDevices(const Window *window, const Context *context);
+ PhysicalDevices(const Surface *surface, const Context *context);
};
\ No newline at end of file
diff --git a/aster/size.h b/aster/size.h
new file mode 100644
index 0000000..ad8b660
--- /dev/null
+++ b/aster/size.h
@@ -0,0 +1,20 @@
+// =============================================
+// Aster: size.h
+// Copyright (c) 2020-2024 Anish Bhobe
+// =============================================
+
+#pragma once
+
+#include "global.h"
+
+struct Size2D
+{
+ u32 m_Width;
+ u32 m_Height;
+
+ explicit
+ operator vk::Extent2D() const
+ {
+ return {m_Width, m_Height};
+ }
+};
diff --git a/aster/surface.cpp b/aster/surface.cpp
new file mode 100644
index 0000000..55e8a83
--- /dev/null
+++ b/aster/surface.cpp
@@ -0,0 +1,51 @@
+// =============================================
+// Aster: surface.cpp
+// Copyright (c) 2020-2024 Anish Bhobe
+// =============================================
+
+#include "surface.h"
+
+#include "context.h"
+#include "window.h"
+
+Surface::Surface(Context *context, const Window *window, cstr name)
+ : m_Context(context)
+{
+ VkSurfaceKHR surface;
+ auto result = Cast(
+ glfwCreateWindowSurface(Cast(m_Context->m_Instance), window->m_Window, nullptr, &surface));
+ ERROR_IF(Failed(result), "Failed to create Surface with {}", result)
+ THEN_ABORT(result)
+ ELSE_DEBUG("Surface {} Created", m_Name);
+ m_Surface = vk::SurfaceKHR(surface);
+}
+
+Surface::~Surface()
+{
+ if (m_Context && m_Surface)
+ {
+ m_Context->m_Instance.destroy(m_Surface, nullptr);
+ DEBUG("Surface Destroyed");
+
+ m_Surface = nullptr;
+ m_Context = nullptr;
+ }
+}
+
+Surface::Surface(Surface &&other) noexcept
+ : m_Context(Take(other.m_Context))
+ , m_Surface(Take(other.m_Surface))
+ , m_Name(std::move(other.m_Name))
+{
+}
+
+Surface &
+Surface::operator=(Surface &&other) noexcept
+{
+ if (this == &other)
+ return *this;
+ m_Context = Take(other.m_Context);
+ m_Surface = Take(other.m_Surface);
+ m_Name = std::move(other.m_Name);
+ return *this;
+}
\ No newline at end of file
diff --git a/aster/surface.h b/aster/surface.h
new file mode 100644
index 0000000..0d8499d
--- /dev/null
+++ b/aster/surface.h
@@ -0,0 +1,28 @@
+// =============================================
+// Aster: surface.h
+// Copyright (c) 2020-2024 Anish Bhobe
+// =============================================
+
+#pragma once
+
+#include "global.h"
+
+struct Context;
+struct Window;
+
+struct Surface
+{
+ Context *m_Context;
+ vk::SurfaceKHR m_Surface;
+ NameString m_Name;
+
+ // Ctor Dtor
+ Surface(Context *context, const Window *window, cstr name);
+ ~Surface();
+
+ // Move
+ Surface(Surface &&other) noexcept;
+ Surface &operator=(Surface &&other) noexcept;
+
+ DISALLOW_COPY_AND_ASSIGN(Surface);
+};
\ No newline at end of file
diff --git a/aster/swapchain.cpp b/aster/swapchain.cpp
index 57ff233..a03ba9e 100644
--- a/aster/swapchain.cpp
+++ b/aster/swapchain.cpp
@@ -7,16 +7,17 @@
#include "device.h"
#include "physical_device.h"
+#include "surface.h"
#include "window.h"
-[[nodiscard]] vk::Extent2D GetExtent(const Window *window, vk::SurfaceCapabilitiesKHR *surfaceCapabilities);
+[[nodiscard]] vk::Extent2D GetExtent(Size2D size, vk::SurfaceCapabilitiesKHR *surfaceCapabilities);
-Swapchain::Swapchain(const Window *window, const Device *device, NameString &&name)
+Swapchain::Swapchain(const Surface *surface, const Device *device, Size2D size, NameString &&name)
: m_Device(device)
, m_Name(std::move(name))
, m_Format(vk::Format::eUndefined)
{
- this->Create(window);
+ this->Create(surface, size);
}
Swapchain::~Swapchain()
@@ -51,20 +52,20 @@ Swapchain::operator=(Swapchain &&other) noexcept
}
void
-Swapchain::Create(const Window *window)
+Swapchain::Create(const Surface *surface, Size2D size)
{
- auto surfaceCapabilities = GetSurfaceCapabilities(m_Device->m_PhysicalDevice, window->m_Surface);
- m_Extent = GetExtent(window, &surfaceCapabilities);
+ auto surfaceCapabilities = GetSurfaceCapabilities(m_Device->m_PhysicalDevice, surface->m_Surface);
+ m_Extent = GetExtent(size, &surfaceCapabilities);
while (m_Extent.width == 0 || m_Extent.height == 0)
{
glfwWaitEvents();
- surfaceCapabilities = GetSurfaceCapabilities(m_Device->m_PhysicalDevice, window->m_Surface);
- m_Extent = GetExtent(window, &surfaceCapabilities);
+ surfaceCapabilities = GetSurfaceCapabilities(m_Device->m_PhysicalDevice, surface->m_Surface);
+ m_Extent = GetExtent(size, &surfaceCapabilities);
}
- auto surfaceFormats = GetSurfaceFormats(m_Device->m_PhysicalDevice, window->m_Surface);
- auto presentModes = GetSurfacePresentModes(m_Device->m_PhysicalDevice, window->m_Surface);
+ auto surfaceFormats = GetSurfaceFormats(m_Device->m_PhysicalDevice, surface->m_Surface);
+ auto presentModes = GetSurfacePresentModes(m_Device->m_PhysicalDevice, surface->m_Surface);
m_Format = vk::Format::eUndefined;
vk::ColorSpaceKHR swapchainColorSpace = vk::ColorSpaceKHR::eSrgbNonlinear;
@@ -104,7 +105,7 @@ Swapchain::Create(const Window *window)
// TODO: Note that different queues might need the images to be shared.
const vk::SwapchainCreateInfoKHR swapchainCreateInfo = {
- .surface = window->m_Surface,
+ .surface = surface->m_Surface,
.minImageCount = swapchainImageCount,
.imageFormat = m_Format,
.imageColorSpace = swapchainColorSpace,
@@ -206,14 +207,14 @@ Swapchain::Cleanup()
}
vk::Extent2D
-GetExtent(const Window *window, vk::SurfaceCapabilitiesKHR *surfaceCapabilities)
+GetExtent(Size2D size, vk::SurfaceCapabilitiesKHR *surfaceCapabilities)
{
if (surfaceCapabilities->currentExtent.width != MaxValue)
{
return surfaceCapabilities->currentExtent;
}
- auto [width, height] = window->GetSize();
+ auto [width, height] = size;
auto [minWidth, minHeight] = surfaceCapabilities->minImageExtent;
auto [maxWidth, maxHeight] = surfaceCapabilities->maxImageExtent;
diff --git a/aster/swapchain.h b/aster/swapchain.h
index 9ed2137..376333e 100644
--- a/aster/swapchain.h
+++ b/aster/swapchain.h
@@ -7,10 +7,12 @@
#include "global.h"
+#include "size.h"
+
#include
struct PhysicalDevice;
-struct Window;
+struct Surface;
struct Device;
struct Swapchain final
@@ -27,11 +29,11 @@ struct Swapchain final
eastl::vector m_ResizeCallbacks;
- void Create(const Window *window);
+ void Create(const Surface *window, Size2D size);
void RegisterResizeCallback(FnResizeCallback &&callback);
// Ctor/Dtor
- Swapchain(const Window *window, const Device *device, NameString &&name);
+ Swapchain(const Surface *window, const Device *device, Size2D size, NameString &&name);
~Swapchain();
// Move
diff --git a/aster/window.cpp b/aster/window.cpp
index 3198b5c..11ae077 100644
--- a/aster/window.cpp
+++ b/aster/window.cpp
@@ -8,6 +8,9 @@
#include "context.h"
#include "logger.h"
+std::atomic_uint64_t Window::m_WindowCount = 0;
+std::atomic_bool Window::m_IsGlfwInit = false;
+
void
Window::RequestExit() const noexcept
{
@@ -26,7 +29,7 @@ Window::SetWindowSize(const u32 width, const u32 height) const noexcept
glfwSetWindowSize(m_Window, Cast(width), Cast(height));
}
-vk::Extent2D
+Size2D
Window::GetSize() const
{
int width;
@@ -35,11 +38,23 @@ Window::GetSize() const
return {Cast(width), Cast(height)};
}
-Window::Window(const cstr title, Context *context, vk::Extent2D extent, const b8 isFullScreen)
+Window::Window(const cstr title, Size2D extent, const b8 isFullScreen)
{
- m_Context = context;
m_Name = title;
+ if (!m_IsGlfwInit)
+ {
+ if (!glfwInit())
+ {
+ const char *error = nullptr;
+ const auto code = glfwGetError(&error);
+ ERROR("GLFW Init failed. Cause: ({}) {}", code, error)
+ THEN_ABORT(code);
+ }
+ m_WindowCount = 0;
+ m_IsGlfwInit = true;
+ }
+
GLFWmonitor *monitor = glfwGetPrimaryMonitor();
ERROR_IF(!monitor, "No monitor found");
@@ -49,10 +64,10 @@ Window::Window(const cstr title, Context *context, vk::Extent2D extent, const b8
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_CENTER_CURSOR, GLFW_TRUE);
- m_Window = glfwCreateWindow(Cast(extent.width), Cast(extent.height), m_Name.c_str(),
+ m_Window = glfwCreateWindow(Cast(extent.m_Width), Cast(extent.m_Height), m_Name.c_str(),
isFullScreen ? monitor : nullptr, nullptr);
ERROR_IF(m_Window == nullptr, "Window creation failed")
- ELSE_DEBUG("Window '{}' created with resolution '{}x{}'", m_Name, extent.width, extent.height);
+ ELSE_DEBUG("Window '{}' created with resolution '{}x{}'", m_Name, extent.m_Width, extent.m_Height);
if (m_Window == nullptr)
{
const char *error = nullptr;
@@ -63,41 +78,35 @@ Window::Window(const cstr title, Context *context, vk::Extent2D extent, const b8
if (isFullScreen == false)
{
- glfwSetWindowPos(m_Window, Cast(windowWidth - extent.width) / 2,
- Cast(windowHeight - extent.height) / 2);
+ glfwSetWindowPos(m_Window, Cast(windowWidth - extent.m_Width) / 2,
+ Cast(windowHeight - extent.m_Height) / 2);
}
glfwSetInputMode(m_Window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
- VkSurfaceKHR surface;
- auto result =
- Cast(glfwCreateWindowSurface(Cast(m_Context->m_Instance), m_Window, nullptr, &surface));
- ERROR_IF(Failed(result), "Failed to create Surface with {}", result)
- THEN_ABORT(result)
- ELSE_DEBUG("Surface {} Created", m_Name);
- m_Surface = vk::SurfaceKHR(surface);
+ ++m_WindowCount;
}
Window::~Window()
{
- if (m_Context && m_Surface)
- {
- m_Context->m_Instance.destroy(m_Surface, nullptr);
- DEBUG("Surface Destroyed");
- }
-
if (m_Window)
{
glfwDestroyWindow(m_Window);
m_Window = nullptr;
+
+ --m_WindowCount;
+ }
+
+ if (m_WindowCount== 0 && m_IsGlfwInit)
+ {
+ glfwTerminate();
+ m_IsGlfwInit = false;
}
DEBUG("Window '{}' Destroyed", m_Name);
}
Window::Window(Window &&other) noexcept
- : m_Context(other.m_Context)
- , m_Window(Take(other.m_Window))
- , m_Surface(Take(other.m_Surface))
+ : m_Window(Take(other.m_Window))
, m_Name(Take(other.m_Name))
{
}
@@ -107,9 +116,7 @@ Window::operator=(Window &&other) noexcept
{
if (this == &other)
return *this;
- m_Context = other.m_Context;
m_Window = Take(other.m_Window);
- m_Surface = Take(other.m_Surface);
m_Name = Take(other.m_Name);
return *this;
}
diff --git a/aster/window.h b/aster/window.h
index 565b6d7..7800017 100644
--- a/aster/window.h
+++ b/aster/window.h
@@ -6,18 +6,19 @@
#pragma once
#include "global.h"
-#include
-struct Context;
+#include "size.h"
+
+#include
struct Window final
{
// fields
- Context *m_Context{};
-
GLFWwindow *m_Window = nullptr;
- vk::SurfaceKHR m_Surface;
- eastl::fixed_string m_Name;
+ NameString m_Name;
+
+ static std::atomic_uint64_t m_WindowCount;
+ static std::atomic_bool m_IsGlfwInit;
// Methods
[[nodiscard]] bool
@@ -31,10 +32,10 @@ struct Window final
void SetWindowSize(const vk::Extent2D &extent) const noexcept;
void SetWindowSize(u32 width, u32 height) const noexcept;
/// Actual size of the framebuffer being used for the window render.
- [[nodiscard]] vk::Extent2D GetSize() const;
+ [[nodiscard]] Size2D GetSize() const;
// Ctor/Dtor
- Window(cstr title, Context *context, vk::Extent2D extent, b8 isFullScreen = false);
+ Window(cstr title, Size2D extent, b8 isFullScreen = false);
~Window();
// Move
diff --git a/samples/00_util/frame.cpp b/samples/00_util/frame.cpp
index 48326c6..8fb12e3 100644
--- a/samples/00_util/frame.cpp
+++ b/samples/00_util/frame.cpp
@@ -52,7 +52,7 @@ Frame::Frame(const Device *device, const u32 queueFamilyIndex, const u32 frameCo
}
void
-Frame::Present(const vk::Queue commandQueue, Swapchain *swapchain, const Window *window)
+Frame::Present(const vk::Queue commandQueue, Swapchain *swapchain, const Surface *surface, Size2D size)
{
vk::PresentInfoKHR presentInfo = {
@@ -70,7 +70,7 @@ Frame::Present(const vk::Queue commandQueue, Swapchain *swapchain, const Window
case vk::Result::eErrorOutOfDateKHR:
case vk::Result::eSuboptimalKHR:
DEBUG("Recreating Swapchain. Cause: {}", result);
- swapchain->Create(window);
+ swapchain->Create(surface, size);
break; // Present failed. We do nothing. Frame is skipped.
default:
AbortIfFailedM(result, "Swapchain Present failed.");
@@ -128,7 +128,7 @@ FrameManager::FrameManager(const Device *device, u32 queueFamilyIndex, u32 frame
}
Frame *
-FrameManager::GetNextFrame(Swapchain *swapchain, const Window *window)
+FrameManager::GetNextFrame(Swapchain *swapchain, const Surface *surface, Size2D size)
{
Frame *currentFrame = &m_Frames[m_CurrentFrameIdx];
@@ -153,7 +153,7 @@ FrameManager::GetNextFrame(Swapchain *swapchain, const Window *window)
break; // Image acquired. Break out of loop.
case vk::Result::eErrorOutOfDateKHR:
DEBUG("Recreating Swapchain. Cause: {}", result);
- swapchain->Create(window);
+ swapchain->Create(surface, size);
break; // Image acquire has failed. We move to the next frame.
default:
AbortIfFailedMV(result, "Waiting for swapchain image {} failed.", frameIndex);
diff --git a/samples/00_util/frame.h b/samples/00_util/frame.h
index 5dc3704..38e47c4 100644
--- a/samples/00_util/frame.h
+++ b/samples/00_util/frame.h
@@ -8,11 +8,14 @@
#include "global.h"
#include "helpers.h"
+#include "size.h"
+
#include
struct Device;
struct Window;
struct Swapchain;
+struct Surface;
struct Frame
{
@@ -28,7 +31,7 @@ struct Frame
// Transient
u32 m_ImageIdx;
- void Present(vk::Queue commandQueue, Swapchain *swapchain, const Window *window);
+ void Present(const vk::Queue commandQueue, Swapchain* swapchain, const Surface* surface, Size2D size);
Frame(const Device *device, u32 queueFamilyIndex, u32 frameCount);
~Frame();
@@ -48,5 +51,5 @@ struct FrameManager
FrameManager(const Device *device, u32 queueFamilyIndex, u32 framesInFlight);
- Frame *GetNextFrame(Swapchain *swapchain, const Window *window);
+ Frame *GetNextFrame(Swapchain *swapchain, const Surface *surface, Size2D size);
};
diff --git a/samples/02_box/box.cpp b/samples/02_box/box.cpp
index 1951dc5..93e1d1e 100644
--- a/samples/02_box/box.cpp
+++ b/samples/02_box/box.cpp
@@ -528,7 +528,7 @@ main(int, char **)
};
AbortIfFailed(commandQueue.submit(1, &submitInfo, currentFrame->m_FrameAvailableFence));
- currentFrame->Present(commandQueue, &swapchain, &window);
+ currentFrame->Present(commandQueue, &swapchain, TODO, TODO);
}
device.WaitIdle();
diff --git a/samples/03_model_render/model_render.cpp b/samples/03_model_render/model_render.cpp
index 60830d8..206f6ea 100644
--- a/samples/03_model_render/model_render.cpp
+++ b/samples/03_model_render/model_render.cpp
@@ -134,9 +134,10 @@ main(int, char **)
MIN_LOG_LEVEL(Logger::LogType::eInfo);
Context context = {"ModelRender", VERSION};
- Window window = {"ModelRender (Aster)", &context, {INIT_WIDTH, INIT_HEIGHT}};
+ Window window = {"ModelRender (Aster)", {INIT_WIDTH, INIT_HEIGHT}};
+ Surface surface = {&context, &window, "Primary Surface"};
- PhysicalDevices physicalDevices = {&window, &context};
+ PhysicalDevices physicalDevices = {&surface, &context};
PhysicalDevice deviceToUse = FindSuitableDevice(physicalDevices);
usize physicalDeviceOffsetAlignment = deviceToUse.m_DeviceProperties.limits.minUniformBufferOffsetAlignment;
@@ -173,7 +174,7 @@ main(int, char **)
Device device = {&context, &deviceToUse, &enabledDeviceFeatures,
{queueAllocation}, pipelineCacheData, "Primary Device"};
vk::Queue graphicsQueue = device.GetQueue(queueAllocation.m_Family, 0);
- Swapchain swapchain = {&window, &device, "Primary Chain"};
+ Swapchain swapchain = {&surface, &device, window.GetSize(), "Primary Chain"};
GpuResourceManager resourceManager = {&device, 1000};
AssetLoader assetLoader = {&resourceManager, graphicsQueue, queueAllocation.m_Family, queueAllocation.m_Family};
@@ -513,7 +514,7 @@ main(int, char **)
cameraController.m_Camera.CalculateInverses();
ubo.Write(&device, 0, sizeof cameraController.m_Camera, &cameraController.m_Camera);
- Frame *currentFrame = frameManager.GetNextFrame(&swapchain, &window);
+ Frame *currentFrame = frameManager.GetNextFrame(&swapchain, &surface, window.GetSize());
u32 imageIndex = currentFrame->m_ImageIdx;
vk::Image currentSwapchainImage = swapchain.m_Images[imageIndex];
@@ -686,7 +687,7 @@ main(int, char **)
};
AbortIfFailed(graphicsQueue.submit(1, &submitInfo, currentFrame->m_FrameAvailableFence));
- currentFrame->Present(graphicsQueue, &swapchain, &window);
+ currentFrame->Present(graphicsQueue, &swapchain, &surface, window.GetSize());
}
device.WaitIdle();
diff --git a/samples/04_scenes/main.cpp b/samples/04_scenes/main.cpp
index 38cdc03..7be38a9 100644
--- a/samples/04_scenes/main.cpp
+++ b/samples/04_scenes/main.cpp
@@ -37,10 +37,11 @@ main(int, char *[])
{
MIN_LOG_LEVEL(Logger::LogType::eInfo);
+ Window window = {"Scene Render [WIP] (Aster)", {INIT_WIDTH, INIT_HEIGHT}};
Context context = {"Scene Render [WIP]", VERSION};
- Window window = {"Scene Render [WIP] (Aster)", &context, {INIT_WIDTH, INIT_HEIGHT}};
+ Surface surface = {&context, &window, "Primary Surface"};
- PhysicalDevices physicalDevices = {&window, &context};
+ PhysicalDevices physicalDevices = {&surface, &context};
PhysicalDevice deviceToUse = FindSuitableDevice(physicalDevices);
vk::Extent2D internalResolution = {1920, 1080};
@@ -91,7 +92,7 @@ main(int, char *[])
Device device = {&context, &deviceToUse, &enabledDeviceFeatures,
{queueAllocation}, pipelineCacheData, "Primary Device"};
vk::Queue graphicsQueue = device.GetQueue(queueAllocation.m_Family, 0);
- Swapchain swapchain = {&window, &device, "Primary Chain"};
+ Swapchain swapchain = {&surface, &device, window.GetSize(),"Primary Chain"};
RenderResourceManager resourceManager = {&device, 1024};
EcsRegistry registry;
@@ -355,7 +356,7 @@ main(int, char *[])
// glm::rotate(dynTrans.m_Rotation, Cast(30_deg * (++index) * Time::m_Delta), vec3{0.0f, 1.0f, 0.0f});
//}
- Frame *currentFrame = frameManager.GetNextFrame(&swapchain, &window);
+ Frame *currentFrame = frameManager.GetNextFrame(&swapchain, &surface, window.GetSize());
u32 imageIndex = currentFrame->m_ImageIdx;
vk::Image currentSwapchainImage = swapchain.m_Images[imageIndex];
@@ -552,7 +553,7 @@ main(int, char *[])
};
AbortIfFailed(graphicsQueue.submit(1, &submitInfo, currentFrame->m_FrameAvailableFence));
- currentFrame->Present(graphicsQueue, &swapchain, &window);
+ currentFrame->Present(graphicsQueue, &swapchain, &surface, window.GetSize());
}
device.WaitIdle();