diff --git a/project/CMakeLists.txt b/project/CMakeLists.txt index 141fa58..76a527b 100644 --- a/project/CMakeLists.txt +++ b/project/CMakeLists.txt @@ -1,26 +1,32 @@ # Source files set(SOURCES "src/main.cpp" - "src/Matrix.cpp" "src/pch.cpp" "src/Renderer.cpp" "src/Timer.cpp" - "src/Vector2.cpp" - "src/Vector3.cpp" - "src/Vector4.cpp" - "src/Effect.cpp" "src/Mesh.cpp" "src/Camera.cpp" "src/Texture.cpp" "src/GamePadController.cpp" "src/Utils.cpp" - "src/BaseEffect.cpp" - "src/FireEffect.cpp" "src/Material.cpp" + "src/Math/Vector2.cpp" + "src/Math/Vector3.cpp" + "src/Math/Vector4.cpp" + "src/Math/Matrix.cpp" + "src/Effects/Effect.cpp" + "src/Effects/BaseEffect.cpp" + "src/Effects/FireEffect.cpp" +) + +SET(INCLUDE_DIRS + "src" + "src/Math" + "src/Effects" ) # Create the executable -add_executable(${PROJECT_NAME} ${SOURCES}) +add_executable(${PROJECT_NAME} ${SOURCES} ${INCLUDE_DIRS}) include(../LinkTinyObjLoader.cmake) LinkTinyObjLoader(${PROJECT_NAME} PUBLIC) diff --git a/project/src/Camera.cpp b/project/src/Camera.cpp index 719e9c2..e4bc667 100644 --- a/project/src/Camera.cpp +++ b/project/src/Camera.cpp @@ -181,7 +181,7 @@ void dae::Camera::Update(const dae::Timer *pTimer) { //Update Matrices CalculateViewMatrix(); - CalculateProjectionMatrix(); //Try to optimize this - should only be called once or when fov/aspectRatio changes + CalculateProjectionMatrix(); } diff --git a/project/src/Camera.h b/project/src/Camera.h index 75f73ac..9fd0b52 100644 --- a/project/src/Camera.h +++ b/project/src/Camera.h @@ -6,9 +6,9 @@ #include #include "Timer.h" -#include "Vector3.h" -#include "MathHelpers.h" -#include "Matrix.h" +#include "Math/Vector3.h" +#include "Math/MathHelpers.h" +#include "Math/Matrix.h" namespace dae { class Camera { diff --git a/project/src/ColorRGB.h b/project/src/ColorRGB.h index 2692b95..455ba34 100644 --- a/project/src/ColorRGB.h +++ b/project/src/ColorRGB.h @@ -1,5 +1,5 @@ #pragma once -#include "MathHelpers.h" +#include "Math/MathHelpers.h" namespace dae { diff --git a/project/src/BaseEffect.cpp b/project/src/Effects/BaseEffect.cpp similarity index 100% rename from project/src/BaseEffect.cpp rename to project/src/Effects/BaseEffect.cpp diff --git a/project/src/BaseEffect.h b/project/src/Effects/BaseEffect.h similarity index 95% rename from project/src/BaseEffect.h rename to project/src/Effects/BaseEffect.h index 1fb3616..1906d72 100644 --- a/project/src/BaseEffect.h +++ b/project/src/Effects/BaseEffect.h @@ -8,8 +8,8 @@ #include #include -#include "Material.h" -#include "Matrix.h" +#include "../Material.h" +#include "../Math/Matrix.h" class BaseEffect { public: diff --git a/project/src/Effect.cpp b/project/src/Effects/Effect.cpp similarity index 99% rename from project/src/Effect.cpp rename to project/src/Effects/Effect.cpp index 243d938..5ccbfca 100644 --- a/project/src/Effect.cpp +++ b/project/src/Effects/Effect.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "../pch.h" #include "Effect.h" #include diff --git a/project/src/Effect.h b/project/src/Effects/Effect.h similarity index 100% rename from project/src/Effect.h rename to project/src/Effects/Effect.h diff --git a/project/src/FireEffect.cpp b/project/src/Effects/FireEffect.cpp similarity index 100% rename from project/src/FireEffect.cpp rename to project/src/Effects/FireEffect.cpp diff --git a/project/src/FireEffect.h b/project/src/Effects/FireEffect.h similarity index 100% rename from project/src/FireEffect.h rename to project/src/Effects/FireEffect.h diff --git a/project/src/Math.h b/project/src/Math.h index d227415..b5f320a 100644 --- a/project/src/Math.h +++ b/project/src/Math.h @@ -1,7 +1,7 @@ #pragma once #include "ColorRGB.h" -#include "Vector2.h" -#include "Vector3.h" -#include "Vector4.h" -#include "Matrix.h" -#include "MathHelpers.h" \ No newline at end of file +#include "Math/Vector2.h" +#include "Math/Vector3.h" +#include "Math/Vector4.h" +#include "Math/Matrix.h" +#include "Math/MathHelpers.h" \ No newline at end of file diff --git a/project/src/MathHelpers.h b/project/src/Math/MathHelpers.h similarity index 100% rename from project/src/MathHelpers.h rename to project/src/Math/MathHelpers.h diff --git a/project/src/Matrix.cpp b/project/src/Math/Matrix.cpp similarity index 99% rename from project/src/Matrix.cpp rename to project/src/Math/Matrix.cpp index 9b1e898..eda83bf 100644 --- a/project/src/Matrix.cpp +++ b/project/src/Math/Matrix.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "../pch.h" #include "Matrix.h" diff --git a/project/src/Matrix.h b/project/src/Math/Matrix.h similarity index 100% rename from project/src/Matrix.h rename to project/src/Math/Matrix.h diff --git a/project/src/Vector2.cpp b/project/src/Math/Vector2.cpp similarity index 99% rename from project/src/Vector2.cpp rename to project/src/Math/Vector2.cpp index 3bed1aa..712ca69 100644 --- a/project/src/Vector2.cpp +++ b/project/src/Math/Vector2.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "../pch.h" #include "Vector2.h" #include diff --git a/project/src/Vector2.h b/project/src/Math/Vector2.h similarity index 100% rename from project/src/Vector2.h rename to project/src/Math/Vector2.h diff --git a/project/src/Vector3.cpp b/project/src/Math/Vector3.cpp similarity index 99% rename from project/src/Vector3.cpp rename to project/src/Math/Vector3.cpp index 9ec9de0..0b1da08 100644 --- a/project/src/Vector3.cpp +++ b/project/src/Math/Vector3.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "../pch.h" #include "Vector3.h" diff --git a/project/src/Vector3.h b/project/src/Math/Vector3.h similarity index 100% rename from project/src/Vector3.h rename to project/src/Math/Vector3.h diff --git a/project/src/Vector4.cpp b/project/src/Math/Vector4.cpp similarity index 98% rename from project/src/Vector4.cpp rename to project/src/Math/Vector4.cpp index 74111da..2a2ec07 100644 --- a/project/src/Vector4.cpp +++ b/project/src/Math/Vector4.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "../pch.h" #include "Vector4.h" diff --git a/project/src/Vector4.h b/project/src/Math/Vector4.h similarity index 100% rename from project/src/Vector4.h rename to project/src/Math/Vector4.h diff --git a/project/src/Mesh.cpp b/project/src/Mesh.cpp index 4b91413..0fe6233 100644 --- a/project/src/Mesh.cpp +++ b/project/src/Mesh.cpp @@ -3,7 +3,7 @@ #include "pch.h" #include "Mesh.h" -#include "Effect.h" +#include "Effects/Effect.h" Mesh::Mesh(ID3D11Device *devicePtr, const std::vector &verticesIn, const std::vector &indices, std::shared_ptr material, BaseEffect* effectPtr) : m_EffectPtr(effectPtr), diff --git a/project/src/Mesh.h b/project/src/Mesh.h index ed23ae6..037b466 100644 --- a/project/src/Mesh.h +++ b/project/src/Mesh.h @@ -1,7 +1,7 @@ #pragma once #include "Texture.h" -#include "BaseEffect.h" +#include "Effects/BaseEffect.h" #include #include diff --git a/project/src/Renderer.cpp b/project/src/Renderer.cpp index f7d1704..0d8501d 100644 --- a/project/src/Renderer.cpp +++ b/project/src/Renderer.cpp @@ -3,8 +3,8 @@ #include "Mesh.h" #include "Utils.h" #include "Texture.h" -#include "Effect.h" -#include "FireEffect.h" +#include "Effects/Effect.h" +#include "Effects/FireEffect.h" namespace dae {