diff --git a/CMakeLists.txt b/CMakeLists.txt index 19fe767..b297780 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ if (POLICY CMP0141) set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$,$>,$<$:EditAndContinue>,$<$:ProgramDatabase>>") endif() -set(CMAKE_CXX_STANDARD 17) + project ("VulkanTutorial") @@ -22,7 +22,6 @@ set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # glm -include_directories(libs/glm-1.0.0) SET(GLM_TEST_ENABLE OFF CACHE BOOL "GLM Build unit tests") add_subdirectory(libs/glm-1.0.0 EXCLUDE_FROM_ALL) diff --git a/VulkanTutorial.cpp b/VulkanTutorial.cpp index 1708080..8e90ffb 100644 --- a/VulkanTutorial.cpp +++ b/VulkanTutorial.cpp @@ -15,10 +15,6 @@ const std::vector swapchainExtensions = { VK_KHR_SWAPCHAIN_EXTENSION_NAME }; -const std::vector instanceExtensions = { - "VK_EXT_headless_surface" -}; - #ifdef NDEBUG const bool enableValidationLayers = false; #else @@ -217,10 +213,9 @@ std::vector HelloTriangleApplication::getRequiredExtensions() { if (enableValidationLayers) { extensions.push_back(VK_EXT_DEBUG_UTILS_EXTENSION_NAME); - extensions.push_back("VK_EXT_headless_surface"); + } - return extensions; } @@ -285,19 +280,9 @@ void HelloTriangleApplication::populateDebugMessengerCreateInfo(VkDebugUtilsMess void HelloTriangleApplication::createSurface() { - /* if (glfwCreateWindowSurface(instance,window,nullptr,&surface) != VK_SUCCESS) { throw std::runtime_error("failed to create window surface in createSurface()"); - }*/ - VkHeadlessSurfaceCreateInfoEXT headlessSurfaceCreateInfo = {}; - headlessSurfaceCreateInfo.sType = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT; - headlessSurfaceCreateInfo.pNext = NULL; - headlessSurfaceCreateInfo.flags = 0; - - if (vkCreateHeadlessSurfaceEXT(instance, &headlessSurfaceCreateInfo, nullptr, &surface) != VK_SUCCESS) - { - throw std::runtime_error("failed to create window surface in createheadlessSurface"); } } @@ -674,7 +659,7 @@ std::vector HelloTriangleApplication::readFile(const std::string& filename throw std::runtime_error("failed to open file!"); } - ssize_t fileSize = (ssize_t)file.tellg(); + rsize_t fileSize = (rsize_t)file.tellg(); std::vector buffer(fileSize); file.seekg(0); diff --git a/VulkanTutorial.h b/VulkanTutorial.h index 1c4eab5..f0050c5 100644 --- a/VulkanTutorial.h +++ b/VulkanTutorial.h @@ -4,23 +4,21 @@ #pragma once #define GLM_FORCE_RADIANS - -#include +#include +#include #define GLFW_INCLUDE_VULKAN #include #include -#include -#include -#include +#include #include #include #include #include #include #include -#include + #include #include #include