diff --git a/Yasno/Graphics/Techniques/RaytracingPass.cpp b/Yasno/Graphics/Techniques/RaytracingPass.cpp index 497d3ad..b9b877b 100644 --- a/Yasno/Graphics/Techniques/RaytracingPass.cpp +++ b/Yasno/Graphics/Techniques/RaytracingPass.cpp @@ -1,5 +1,7 @@ #include "RaytracingPass.hpp" +import Camera; + #include #include @@ -9,7 +11,6 @@ #include #include #include -#include namespace ysn { diff --git a/Yasno/Main.cpp b/Yasno/Main.cxx similarity index 96% rename from Yasno/Main.cpp rename to Yasno/Main.cxx index 5289063..230b6e1 100644 --- a/Yasno/Main.cpp +++ b/Yasno/Main.cxx @@ -1,6 +1,8 @@ #include #include +import YasnoSettings; + int WINAPI wWinMain(_In_ HINSTANCE hinstance, _In_opt_ HINSTANCE, _In_ LPWSTR, _In_ int) { ysn::Application::Create(hinstance); diff --git a/Yasno/Yasno.vcxproj b/Yasno/Yasno.vcxproj index 29988d0..c0e0fb5 100644 --- a/Yasno/Yasno.vcxproj +++ b/Yasno/Yasno.vcxproj @@ -103,14 +103,17 @@ $(SolutionDir)\Build\$(Platform)\$(Configuration)\ $(SolutionDir)\Build\Intermediate\$(Platform)\$(Configuration)\ + true $(SolutionDir)\Build\$(Platform)\$(Configuration)\ $(SolutionDir)\Build\Intermediate\$(Platform)\$(Configuration)\ + true $(SolutionDir)\Build\$(Platform)\$(Configuration)\ $(SolutionDir)\Build\Intermediate\$(Platform)\$(Configuration)\ + true true @@ -187,10 +190,15 @@ stdcpplatest $(MSBuildProjectDirectory);%(AdditionalIncludeDirectories) MultiThreadedDebugDLL - Use + NotUsing $(ProjectDir)System\stdafx.h;%(ForcedIncludeFiles) $(ProjectDir)System\stdafx.h true + stdclatest + true + true + OldStyle + true Windows @@ -209,12 +217,16 @@ stdcpplatest $(MSBuildProjectDirectory);%(AdditionalIncludeDirectories) MultiThreadedDLL - Default - Use + stdclatest + NotUsing $(ProjectDir)System\stdafx.h;%(ForcedIncludeFiles) $(ProjectDir)System\stdafx.h true true + true + true + OldStyle + true Windows @@ -235,10 +247,15 @@ stdcpplatest $(MSBuildProjectDirectory);%(AdditionalIncludeDirectories) MultiThreadedDLL - Use + NotUsing $(ProjectDir)System\stdafx.h;%(ForcedIncludeFiles) $(ProjectDir)System\stdafx.h true + stdclatest + true + true + OldStyle + true Windows @@ -262,7 +279,7 @@ - + @@ -302,11 +319,9 @@ - - @@ -368,11 +383,15 @@ - + + Document + - + + Document + diff --git a/Yasno/Yasno.vcxproj.filters b/Yasno/Yasno.vcxproj.filters index 8c3a008..a6d955a 100644 --- a/Yasno/Yasno.vcxproj.filters +++ b/Yasno/Yasno.vcxproj.filters @@ -37,9 +37,6 @@ - - Source\Yasno - Source\Yasno @@ -124,7 +121,7 @@ Source\Yasno - + Source\System @@ -134,9 +131,6 @@ Source\System - - Source\Yasno - Source\Graphics @@ -188,11 +182,14 @@ Source\Renderer + + Source\Yasno + + + Source\Yasno + - - Source\Yasno - Source\Yasno @@ -313,9 +310,6 @@ Source\System - - Source\Yasno - Source\Graphics diff --git a/Yasno/Yasno/Camera.hpp b/Yasno/Yasno/Camera.hpp deleted file mode 100644 index dd6297d..0000000 --- a/Yasno/Yasno/Camera.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once - -#include - -namespace ysn -{ - struct Camera - { - Camera(); - - DirectX::XMMATRIX GetViewMatrix() const; - DirectX::XMMATRIX GetProjectionMatrix() const; - - void Update(); - void SetAspectRatio(float AspectRatio); - - float GetFov() const; - void SetFov(float Fov); - - DirectX::XMFLOAT3 GetPosition() const; - void SetPosition(DirectX::XMFLOAT3 Position); - void Move(DirectX::XMFLOAT3 Position); - - // Right handed coodrinate space - DirectX::XMFLOAT3 GetForwardVector() const; // Z forward - DirectX::XMFLOAT3 GetRightVector() const; // -X left - DirectX::XMFLOAT3 GetUpVector() const; // Y up - - void SetYaw(float Yaw); - void SetPitch(float Pitch); - - // NOTE: Turns falls after Update() called! - bool IsMoved(); - - float fov = 45.0f; - private: - float m_AspectRatio = 1.0f; - float m_NearPlane = 0.1f; - float m_FarPlane = 10000.f; - - float m_Pitch = 0.0f; // Vertical rotation - float m_Yaw = 0.0f; // Horizontal rotation - - DirectX::XMFLOAT3 m_Position; - - DirectX::XMFLOAT3 m_ForwardVector; - DirectX::XMFLOAT3 m_RightVector; - - DirectX::XMMATRIX m_ViewMatrix; - DirectX::XMMATRIX m_ProjectionMatrix; - - float m_MouseSensitivity = 1.0f; - - bool m_is_moved = false; - }; -} diff --git a/Yasno/Yasno/Camera.cpp b/Yasno/Yasno/Camera.ixx similarity index 64% rename from Yasno/Yasno/Camera.cpp rename to Yasno/Yasno/Camera.ixx index 477fe6b..eefa92a 100644 --- a/Yasno/Yasno/Camera.cpp +++ b/Yasno/Yasno/Camera.ixx @@ -1,14 +1,66 @@ -#include "Camera.hpp" +module; +#include #include - #include -namespace ysn +export module Camera; + +export namespace ysn { using namespace DirectX; using namespace DirectX::SimpleMath; + struct Camera + { + Camera(); + + DirectX::XMMATRIX GetViewMatrix() const; + DirectX::XMMATRIX GetProjectionMatrix() const; + + void Update(); + void SetAspectRatio(float AspectRatio); + + float GetFov() const; + void SetFov(float Fov); + + DirectX::XMFLOAT3 GetPosition() const; + void SetPosition(DirectX::XMFLOAT3 Position); + void Move(DirectX::XMFLOAT3 Position); + + // Right handed coodrinate space + DirectX::XMFLOAT3 GetForwardVector() const; // Z forward + DirectX::XMFLOAT3 GetRightVector() const; // -X left + DirectX::XMFLOAT3 GetUpVector() const; // Y up + + void SetYaw(float Yaw); + void SetPitch(float Pitch); + + // NOTE: Turns falls after Update() called! + bool IsMoved(); + + float fov = 45.0f; + private: + float m_AspectRatio = 1.0f; + float m_NearPlane = 0.1f; + float m_FarPlane = 10000.f; + + float m_Pitch = 0.0f; // Vertical rotation + float m_Yaw = 0.0f; // Horizontal rotation + + DirectX::XMFLOAT3 m_Position; + + DirectX::XMFLOAT3 m_ForwardVector; + DirectX::XMFLOAT3 m_RightVector; + + DirectX::XMMATRIX m_ViewMatrix; + DirectX::XMMATRIX m_ProjectionMatrix; + + float m_MouseSensitivity = 1.0f; + + bool m_is_moved = false; + }; + Camera::Camera() { m_ProjectionMatrix = XMMatrixIdentity(); diff --git a/Yasno/Yasno/CameraController.hpp b/Yasno/Yasno/CameraController.hpp index c3a7dd1..a299f91 100644 --- a/Yasno/Yasno/CameraController.hpp +++ b/Yasno/Yasno/CameraController.hpp @@ -1,8 +1,8 @@ #pragma once -#include "Camera.hpp" +import Camera; -#include +import ; namespace ysn { diff --git a/Yasno/Yasno/YasnoSettings.cpp b/Yasno/Yasno/YasnoSettings.cpp deleted file mode 100644 index 89e29d7..0000000 --- a/Yasno/Yasno/YasnoSettings.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "YasnoSettings.hpp" - -namespace ysn -{ -} \ No newline at end of file diff --git a/Yasno/Yasno/YasnoSettings.hpp b/Yasno/Yasno/YasnoSettings.ixx similarity index 70% rename from Yasno/Yasno/YasnoSettings.hpp rename to Yasno/Yasno/YasnoSettings.ixx index b5fe744..c0a2c8d 100644 --- a/Yasno/Yasno/YasnoSettings.hpp +++ b/Yasno/Yasno/YasnoSettings.ixx @@ -1,15 +1,15 @@ -#pragma once +export module YasnoSettings; namespace ysn { - struct GraphicsSettings + export struct GraphicsSettings { bool is_vsync_enabled = false; bool is_full_screen = false; bool is_raster_mode = true; }; - class YasnoSettings + export class YasnoSettings { GraphicsSettings graphics; public: