Files
VulkanRenderer/main.cpp
2025-11-15 17:59:22 +00:00

33 lines
796 B
C++

#include "src/managers/GLFWManager.h"
#include "src/managers/VulkanManager.h"
int main()
{
using namespace PB::Renderer; // Project namespace
/* Initializes GLFW and creates window */
if (!GLFWManager::Init())
return -1;
GLFWwindow* window = GLFWManager::CreateWindow(800, 600, "Vulkan window");
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 and Vulkan */
if (!GLFWManager::Cleanup() || !VulkanManager::Cleanup())
return -1;
}