| 116 | } |
| 117 | |
| 118 | void cleanup() { |
| 119 | for (auto imageView : swapChainImageViews) { |
| 120 | vkDestroyImageView(device, imageView, nullptr); |
| 121 | } |
| 122 | |
| 123 | vkDestroySwapchainKHR(device, swapChain, nullptr); |
| 124 | vkDestroyDevice(device, nullptr); |
| 125 | |
| 126 | if (enableValidationLayers) { |
| 127 | DestroyDebugUtilsMessengerEXT(instance, debugMessenger, nullptr); |
| 128 | } |
| 129 | |
| 130 | vkDestroySurfaceKHR(instance, surface, nullptr); |
| 131 | vkDestroyInstance(instance, nullptr); |
| 132 | |
| 133 | glfwDestroyWindow(window); |
| 134 | |
| 135 | glfwTerminate(); |
| 136 | } |
| 137 | |
| 138 | void createInstance() { |
| 139 | if (enableValidationLayers && !checkValidationLayerSupport()) { |
nothing calls this directly
no test coverage detected