From 29f8505ba273a5fb356abcc97b16e26cb1aa7bfa Mon Sep 17 00:00:00 2001 From: Tobias Frisch <tfrisch@uni-koblenz.de> Date: Tue, 18 May 2021 14:30:21 +0200 Subject: [PATCH] [#18] Made GLFWwindow opaque and added error dump for GCC below 9 Signed-off-by: Tobias Frisch <tfrisch@uni-koblenz.de> --- CMakeLists.txt | 4 ++++ include/vkcv/Window.hpp | 5 ++++- src/vkcv/Core.cpp | 2 ++ src/vkcv/Window.cpp | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d05e8367..569efcf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,10 @@ endif() message("-- Language: [ C++ " ${CMAKE_CXX_STANDARD} " ]") message("-- Compiler: [ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER_VERSION} " ]") +if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.0.0")) + message(FATAL_ERROR "Upgrade your compiler! GCC 9.0+ is required!") +endif() + # setting up different paths set(vkcv_config ${PROJECT_SOURCE_DIR}/config) set(vkcv_config_ext ${vkcv_config}/ext) diff --git a/include/vkcv/Window.hpp b/include/vkcv/Window.hpp index ef5e35cc..87c98a92 100644 --- a/include/vkcv/Window.hpp +++ b/include/vkcv/Window.hpp @@ -4,12 +4,14 @@ * @file src/vkcv/Window.hpp * @brief Window class to handle a basic rendering surface and input */ -#include <GLFW/glfw3.h> #define NOMINMAX #include <algorithm> +struct GLFWwindow; + namespace vkcv { + class Window final { private: GLFWwindow *m_window; @@ -88,4 +90,5 @@ namespace vkcv { */ virtual ~Window(); }; + } \ No newline at end of file diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp index dffe0a9f..75893552 100644 --- a/src/vkcv/Core.cpp +++ b/src/vkcv/Core.cpp @@ -4,6 +4,8 @@ * @brief Handling of global states regarding dependencies */ +#include <GLFW/glfw3.h> + #include "vkcv/Core.hpp" #include "PassManager.hpp" #include "PipelineManager.hpp" diff --git a/src/vkcv/Window.cpp b/src/vkcv/Window.cpp index ce05d67c..376f363a 100644 --- a/src/vkcv/Window.cpp +++ b/src/vkcv/Window.cpp @@ -4,8 +4,9 @@ * @brief Window class to handle a basic rendering surface and input */ -#include "vkcv/Window.hpp" +#include <GLFW/glfw3.h> +#include "vkcv/Window.hpp" namespace vkcv { -- GitLab