diff --git a/src/main.cpp b/src/main.cpp index 17e2850..3887491 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,8 @@ #include #include -#include "src/util/types.h" +#include "util/magic_enum.hpp" +#include "util/types.h" const uint32_t WIDTH = 800; const uint32_t HEIGHT = 600; @@ -183,8 +184,11 @@ class Application { } fn createSurface() -> void { - if (glfwCreateWindowSurface(mInstance, mWindow, nullptr, &mSurface) != VK_SUCCESS) - throw std::runtime_error("failed to create window surface!"); + if (VkResult result = glfwCreateWindowSurface(mInstance, mWindow, nullptr, &mSurface); + result != VK_SUCCESS) + throw std::runtime_error( + "Failed to create window surface! Error: " + string(magic_enum::enum_name(result)) + ); } fn pickPhysicalDevice() -> void {