From 938e57f071c426acdb954d6dd96aa974c44743db Mon Sep 17 00:00:00 2001 From: arby Date: Thu, 17 Feb 2022 19:42:50 +0100 Subject: [PATCH 1/3] Fixed some build errors. --- CMakeLists.txt | 2 +- includes/learnopengl/animator.h | 2 +- src/8.guest/2021/1.scene/1.scene_graph/scene_graph.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a6c812..fdbf1f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_policy(VERSION 3.0) project (LearnOpenGL) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON) diff --git a/includes/learnopengl/animator.h b/includes/learnopengl/animator.h index 6364f41..b0b1b27 100644 --- a/includes/learnopengl/animator.h +++ b/includes/learnopengl/animator.h @@ -11,7 +11,7 @@ class Animator { public: - Animator::Animator(Animation* animation) + Animator(Animation* animation) { m_CurrentTime = 0.0; m_CurrentAnimation = animation; diff --git a/src/8.guest/2021/1.scene/1.scene_graph/scene_graph.cpp b/src/8.guest/2021/1.scene/1.scene_graph/scene_graph.cpp index 313d70e..5d4405d 100644 --- a/src/8.guest/2021/1.scene/1.scene_graph/scene_graph.cpp +++ b/src/8.guest/2021/1.scene/1.scene_graph/scene_graph.cpp @@ -98,7 +98,7 @@ int main() // load entities // ----------- - Entity ourEntity(FileSystem::getPath("resources/objects/planet/planet.obj")); + Entity ourEntity(Model(FileSystem::getPath("resources/objects/planet/planet.obj"))); ourEntity.transform.setLocalPosition({ 10, 0, 0 }); const float scale = 0.75; ourEntity.transform.setLocalScale({ scale, scale, scale }); @@ -108,7 +108,7 @@ int main() for (unsigned int i = 0; i < 10; ++i) { - lastEntity->addChild(FileSystem::getPath("resources/objects/planet/planet.obj")); + lastEntity->addChild(Model(FileSystem::getPath("resources/objects/planet/planet.obj"))); lastEntity = lastEntity->children.back().get(); //Set tranform values @@ -154,7 +154,7 @@ int main() while (lastEntity->children.size()) { ourShader.setMat4("model", lastEntity->transform.getModelMatrix()); - lastEntity->Draw(ourShader); + lastEntity->pModel->Draw(ourShader); lastEntity = lastEntity->children.back().get(); } From 3ba3abdae618d2ba2c50180e3a06e69439f15788 Mon Sep 17 00:00:00 2001 From: arby Date: Fri, 18 Feb 2022 16:56:43 +0100 Subject: [PATCH 2/3] Updated MSVC target compile options to C++17 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdbf1f5..42643e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,7 +212,7 @@ function(create_project_from_sources chapter demo) add_executable(${NAME} ${SOURCE}) target_link_libraries(${NAME} ${LIBS}) if(MSVC) - target_compile_options(${NAME} PRIVATE /std:c++latest /MP) + target_compile_options(${NAME} PRIVATE /std:c++17 /MP) target_link_options(${NAME} PUBLIC /ignore:4099) endif(MSVC) if(WIN32) From 74dd442b7d086b73a767fe9c00509d038dafeb98 Mon Sep 17 00:00:00 2001 From: arby Date: Fri, 18 Feb 2022 16:59:51 +0100 Subject: [PATCH 3/3] Added an extra comment to the CMake file --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 42643e1..403a6e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_policy(VERSION 3.0) project (LearnOpenGL) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 17) # this does nothing for MSVC, use target_compile_options below set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS ON)