From: Jean-Philippe Bruyère Date: Mon, 24 Jan 2022 18:40:52 +0000 (+0000) Subject: make glfw init and vulkan support check fatal failure in any case X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=902da9ce1b01ed8ee0ac787fc7a3bc3258f7e2f4;p=jp%2Fvkvg.git make glfw init and vulkan support check fatal failure in any case --- diff --git a/tests/common/vkengine.c b/tests/common/vkengine.c index bc0deae..deb8fb2 100644 --- a/tests/common/vkengine.c +++ b/tests/common/vkengine.c @@ -111,13 +111,17 @@ bool instance_extension_supported (VkExtensionProperties* instanceExtProps, uint } vk_engine_t* vkengine_create (VkPhysicalDeviceType preferedGPU, VkPresentModeKHR presentMode, uint32_t width, uint32_t height) { - glfwSetErrorCallback(glfw_error_callback); + glfwSetErrorCallback(glfw_error_callback); - int res = 0; - res = glfwInit(); - assert (res==GLFW_TRUE && "glfwInit failed."); - res = glfwVulkanSupported(); - assert (res==GLFW_TRUE && "glfwVulkanSupported return false."); + if (!glfwInit()) { + perror ("glfwInit failed"); + exit(-1); + } + + if (!glfwVulkanSupported()) { + perror ("glfwVulkanSupported return false."); + exit(-1); + } uint32_t enabledExtsCount = 0, phyCount = 0; const char** gflwExts = glfwGetRequiredInstanceExtensions (&enabledExtsCount);