Created Vulkan Instance (VkInstance)

This commit is contained in:
Pasha Bibko
2025-11-15 17:59:22 +00:00
parent e133929166
commit 2c6446aca9
8 changed files with 104 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
#include "src/GLFWManager.h"
#include "src/managers/GLFWManager.h"
#include "src/managers/VulkanManager.h"
int main()
{
@@ -12,13 +13,20 @@ int main()
if (!window)
return -1;
/* Creates the Vulkan instance */
if (std::optional<VkInstance> instance = VulkanManager::Init(); !instance)
{
GLFWManager::Cleanup();
return -1;
}
/* Polls window events whilst it is still open */
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
/* Cleans up GLFW */
if (!GLFWManager::Cleanup())
/* Cleans up GLFW and Vulkan */
if (!GLFWManager::Cleanup() || !VulkanManager::Cleanup())
return -1;
}