Created Vulkan Instance (VkInstance)
This commit is contained in:
14
main.cpp
14
main.cpp
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user