Added resize + fullscreen support

This commit is contained in:
Pasha Bibko
2025-11-16 22:03:14 +00:00
parent edcf13d62a
commit cfce4b3069
5 changed files with 142 additions and 43 deletions

View File

@@ -89,7 +89,7 @@ namespace PB::Renderer
/*
Assembles shaders, fixed function state and creates the render pipeline.
Also checks that the render pass is compatiable.
Also checks that the render pass is compatible.
*/
static bool CreateGraphicsPipeline();
@@ -108,9 +108,11 @@ namespace PB::Renderer
/*
Draws a frame to the screen using the command buffers and sync objects.
*/
static bool RenderPass();
static bool RenderPass(GLFWwindow* window);
private:
// === Vulkan init helpers === //
static bool IsDeviceSuitable(const VkPhysicalDevice& device);
static QueueFamilyIndices FindQueueFamilies(const VkPhysicalDevice& device);
static bool CheckDeviceExtensionSupport(const VkPhysicalDevice& device);
@@ -122,6 +124,15 @@ namespace PB::Renderer
static VkShaderModule CreateShaderModule(const std::string& filename);
// === Vulkan render helpers === //
static VkResult RenderPassInternal();
static void RecreateSwapChain(GLFWwindow* window);
static void CleanupSwapChain();
// === Vulkan resources === //
static VkInstance s_Instance;
static VkSurfaceKHR s_Surface;