Revert "fit for linux"

This reverts commit f640e25b33.
master
ink-soul 2024-04-01 15:10:54 +08:00
parent f640e25b33
commit ff372a4b4b
3 changed files with 7 additions and 25 deletions

View File

@ -9,7 +9,7 @@ if (POLICY CMP0141)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>: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)

View File

@ -15,10 +15,6 @@ const std::vector<const char*> swapchainExtensions = {
VK_KHR_SWAPCHAIN_EXTENSION_NAME
};
const std::vector<const char*> instanceExtensions = {
"VK_EXT_headless_surface"
};
#ifdef NDEBUG
const bool enableValidationLayers = false;
#else
@ -217,9 +213,8 @@ std::vector<const char*> 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<char> 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<char> buffer(fileSize);
file.seekg(0);

View File

@ -4,23 +4,21 @@
#pragma once
#define GLM_FORCE_RADIANS
#include <gtc/matrix_transform.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#define GLFW_INCLUDE_VULKAN
#include<GLFW/glfw3.h>
#include<vulkan/vulkan.h>
#include <cstdlib>
#include <stdlib.h>
#include <glm.hpp>
#include<glm/glm.hpp>
#include <iostream>
#include <optional>
#include <stdexcept>
#include <functional>
#include <cstdlib>
#include <set>
#include <cstring>
#include <cstdint>
#include <limits>
#include <algorithm>