]> O.S.I.I.S - jp/vkvg.git/commitdiff
make glfw init and vulkan support check fatal failure in any case
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 24 Jan 2022 18:40:52 +0000 (18:40 +0000)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 24 Jan 2022 18:40:52 +0000 (18:40 +0000)
tests/common/vkengine.c

index bc0deae116aaa0096717ff624d07d5590bd5f1e5..deb8fb2611f3741a4706075fc7d4c05d78d50f35 100644 (file)
@@ -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);