diff --git a/Binaries/Debug/LightPixelShader.cso b/Binaries/Debug/LightPixelShader.cso index 6e1f025..0ebdad7 100644 Binary files a/Binaries/Debug/LightPixelShader.cso and b/Binaries/Debug/LightPixelShader.cso differ diff --git a/Binaries/Debug/LightVertexShader.cso b/Binaries/Debug/LightVertexShader.cso index 6869217..54d8426 100644 Binary files a/Binaries/Debug/LightVertexShader.cso and b/Binaries/Debug/LightVertexShader.cso differ diff --git a/Binaries/Debug/MyD3DFramework.exe b/Binaries/Debug/MyD3DFramework.exe index 70bbadb..6c15d97 100644 Binary files a/Binaries/Debug/MyD3DFramework.exe and b/Binaries/Debug/MyD3DFramework.exe differ diff --git a/Binaries/Debug/SimplePixelShader.cso b/Binaries/Debug/SimplePixelShader.cso index 7e2dfb9..e5146c6 100644 Binary files a/Binaries/Debug/SimplePixelShader.cso and b/Binaries/Debug/SimplePixelShader.cso differ diff --git a/Binaries/Debug/SimpleVertexShader.cso b/Binaries/Debug/SimpleVertexShader.cso index 0d49b0e..0c9414f 100644 Binary files a/Binaries/Debug/SimpleVertexShader.cso and b/Binaries/Debug/SimpleVertexShader.cso differ diff --git a/MyD3DFramework/Array.cpp b/MyD3DFramework/Array.cpp new file mode 100644 index 0000000..eeb336e --- /dev/null +++ b/MyD3DFramework/Array.cpp @@ -0,0 +1,2 @@ +#include "pch.h" +#include "Array.h" diff --git a/MyD3DFramework/Array.h b/MyD3DFramework/Array.h new file mode 100644 index 0000000..36a98d9 --- /dev/null +++ b/MyD3DFramework/Array.h @@ -0,0 +1,210 @@ +#pragma once +#include +#include + +namespace CM +{ + template + class Array + { + public: + Array() : mSize(0) {} + + void PushBack(const Ty& value) + { + assert(mSize < N && "Array capacity exceeded"); + mDatas[mSize++] = value; + } + + void PopBack() + { + assert(mSize > 0 && "Array is empty"); + --mSize; + } + + Ty& operator[](std::size_t index) + { + assert(index < mSize && "Index out of bounds"); + return mDatas[index]; + } + + const Ty& operator[](std::size_t index) const + { + assert(index < mSize && "Index out of bounds"); + return mDatas[index]; + } + + std::size_t Size() const noexcept + { + return mSize; + } + + constexpr std::size_t Capacity() const noexcept + { + return N; + } + + Ty* begin() noexcept { return mDatas; } + const Ty* begin() const noexcept { return mDatas; } + + Ty* end() noexcept { return mDatas + mSize; } + const Ty* end() const noexcept { return mDatas + mSize; } + + + Ty* Find(const Ty& value) noexcept + { + for (std::size_t i = 0; i < mSize; ++i) + { + if (mDatas[i] == value) + { + return &mDatas[i]; + } + } + return end(); + } + + const Ty* Find(const Ty& value) const noexcept + { + for (std::size_t i = 0; i < mSize; ++i) + { + if (mDatas[i] == value) + { + return &mDatas[i]; + } + } + return end(); + } + + void Erase(std::size_t index) + { + assert(index < mSize && "Index out of bounds"); + for (std::size_t i = index; i < mSize - 1; ++i) + { + mDatas[i] = mDatas[i + 1]; + } + --mSize; + } + + private: + Ty mDatas[N]; + std::size_t mSize; + }; +} + +namespace CM +{ + template + class Array + { + public: + Array() : mSize(0) + { + for (std::size_t i = 0; i < N; ++i) + { + mDatas[i] = nullptr; + } + } + + void PushBack(Ty* value) + { + assert(mSize < N && "Array capacity exceeded"); + mDatas[mSize++] = value; + } + + void PopBack() + { + assert(mSize > 0 && "Array is empty"); + --mSize; + mDatas[mSize] = nullptr; + } + + Ty*& operator[](std::size_t index) + { + assert(index < mSize && "Index out of bounds"); + return mDatas[index]; + } + + const Ty* const& operator[](std::size_t index) const + { + assert(index < mSize && "Index out of bounds"); + return mDatas[index]; + } + + std::size_t Size() const noexcept + { + return mSize; + } + + constexpr std::size_t Capacity() const noexcept + { + return N; + } + + Ty** begin() noexcept { return mDatas; } + Ty* const* begin() const noexcept { return mDatas; } + + Ty** end() noexcept { return mDatas + mSize; } + Ty* const* end() const noexcept { return mDatas + mSize; } + + Ty** Find(Ty* value) noexcept + { + for (std::size_t i = 0; i < mSize; ++i) + { + if (mDatas[i] == value) + { + return &mDatas[i]; + } + } + return end(); + } + + Ty* const* Find(Ty* value) const noexcept + { + for (std::size_t i = 0; i < mSize; ++i) + { + if (mDatas[i] == value) + { + return &mDatas[i]; + } + } + return end(); + } + + void Erase(Ty* value) + { + size_t idx = 0; + for (; idx < mSize; ++idx) + { + if (value == mDatas[idx]) + { + break; + } + } + + if (idx != mSize) + { + for (std::size_t i = idx; i < mSize - 1; ++i) + { + mDatas[i] = mDatas[i + 1]; + } + --mSize; + mDatas[mSize] = nullptr; + } + } + + void Erase(std::size_t index) + { + assert(index < mSize && "Index out of bounds"); + for (std::size_t i = index; i < mSize - 1; ++i) + { + mDatas[i] = mDatas[i + 1]; + } + --mSize; + mDatas[mSize] = nullptr; + } + + private: + Ty* mDatas[N]; + std::size_t mSize; + }; +} \ No newline at end of file diff --git a/MyD3DFramework/CCamera.h b/MyD3DFramework/CCamera.h index 279286a..ce2b4c7 100644 --- a/MyD3DFramework/CCamera.h +++ b/MyD3DFramework/CCamera.h @@ -1,7 +1,6 @@ #pragma once #include "CAttribute.h" #include "CTransform.h" -#include "WindowsApp.h" #include "Renderer.h" class CCamera : public CAttribute @@ -28,10 +27,12 @@ class CCamera : public CAttribute void SetFarPlane(float inFarPlane); Matrix GetViewMatrix(const Vector3& inUp = Vector3::Up) const; - Matrix GetPerspectiveMatrix() const; + Matrix GetPerspectiveMatrix(float inAspectRatio) const; void RegisterToMainCamera(); + Vector3 GetPosition() { return m_offsetPosition + m_ownerTrans->GetPosition(); } + private: const CTransform* m_ownerTrans = nullptr; @@ -99,9 +100,9 @@ Matrix CCamera::GetViewMatrix(const Vector3& inUp) const return ::XMMatrixLookToLH(m_ownerTrans->GetPosition() + m_offsetPosition, lookVec, inUp); } -Matrix CCamera::GetPerspectiveMatrix() const +inline Matrix CCamera::GetPerspectiveMatrix(float inAspectRatio) const { - return ::XMMatrixPerspectiveFovLH(m_fov, WindowsApp::GetInst().GetAspectRatio(), m_nearPlane, m_farPlane); + return ::XMMatrixPerspectiveFovLH(m_fov, inAspectRatio, m_nearPlane, m_farPlane); } void CCamera::SetNearPlane(float inNearPlane) diff --git a/MyD3DFramework/CDirectionalLight.cpp b/MyD3DFramework/CDirectionalLight.cpp deleted file mode 100644 index 90178a1..0000000 --- a/MyD3DFramework/CDirectionalLight.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "pch.h" -#include "CDirectionalLight.h" diff --git a/MyD3DFramework/CDirectionalLight.h b/MyD3DFramework/CDirectionalLight.h deleted file mode 100644 index 517f314..0000000 --- a/MyD3DFramework/CDirectionalLight.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once -#include "CLight.h" - -class CDirectionalLight : public CLight -{ -public: - CDirectionalLight() = default; - virtual ~CDirectionalLight() = default; - - inline void SetDirection(const Vector3& inDirection); - - inline Vector3 GetDirection() const { return m_direction; } - -private: - Vector3 m_direction = {}; -}; - -inline void CDirectionalLight::SetDirection(const Vector3& inDirection) -{ - m_direction = inDirection; -} diff --git a/MyD3DFramework/CKeyInput.cpp b/MyD3DFramework/CKeyInput.cpp new file mode 100644 index 0000000..5a676da --- /dev/null +++ b/MyD3DFramework/CKeyInput.cpp @@ -0,0 +1,14 @@ +#include "pch.h" +#include "CKeyInput.h" + +void CKeyInput::Update() +{ + for (auto& action : m_actionVector) + { + const ActionKey& key = action->Key; + if (CheckKeyState(key.KeyState, key.KeyCode)) + { + action->Action(); + } + } +} diff --git a/MyD3DFramework/CKeyInput.h b/MyD3DFramework/CKeyInput.h new file mode 100644 index 0000000..cf36d82 --- /dev/null +++ b/MyD3DFramework/CKeyInput.h @@ -0,0 +1,126 @@ +#pragma once +#include "CBehavior.h" + +class CKeyInput : public CBehavior +{ +private: + struct ActionKey + { + ActionKey() = default; + ActionKey(const eKeyCode& inKeyCode, const eKeyState& inKeyState) + : KeyCode(inKeyCode), KeyState(inKeyState) {} + + bool operator==(const ActionKey& other) const + { + return (KeyCode == other.KeyCode) && (KeyState == other.KeyState); + } + + eKeyCode KeyCode; + eKeyState KeyState; + }; + + struct ActionValue + { + std::function Action; + size_t Index; + ActionKey Key; + }; + + struct ActionKeyHash + { + std::size_t operator()(const ActionKey& key) const + { + return std::hash()(static_cast(key.KeyCode)) ^ std::hash()(static_cast(key.KeyState) << 1); + } + }; + +public: + CKeyInput(); + ~CKeyInput() = default; + + template + void BindAction( + eKeyCode inKeyCode, + eKeyState inKeyState, + ObjType* inObj, + Func inFunc); + + bool UnBindAction(eKeyCode inKeyCode, eKeyState inKeyState); + + void Update(); + +private: + bool CheckKeyState(eKeyState state, eKeyCode code); + void RegisterAction(ActionKey inKey, const std::function& inAction); + +private: + std::unordered_map m_actionRepo; + std::vector m_actionVector; + size_t m_validActionCount = 0; + constexpr static size_t sReserveCapacity = 16; +}; + +CKeyInput::CKeyInput() +{ + m_actionRepo.reserve(sReserveCapacity); + m_actionVector.reserve(sReserveCapacity); +} + +inline bool CKeyInput::UnBindAction(eKeyCode inKeyCode, eKeyState inKeyState) +{ + ActionKey key{ inKeyCode, inKeyState }; + auto iter = m_actionRepo.find(key); + + if (iter == m_actionRepo.end()) + { + return false; + } + + size_t index = iter->second.Index; + m_actionVector[index] = m_actionVector[m_validActionCount - 1]; + m_actionRepo[m_actionVector[index]->Key].Index = index; + m_actionVector.pop_back(); + --m_validActionCount; + + m_actionRepo.erase(iter); + + return true; +} + +inline bool CKeyInput::CheckKeyState(eKeyState state, eKeyCode code) +{ + switch (state) + { + case eKeyState::Press: return InputManager::GetInst().GetKeyPress(code); + case eKeyState::Hold: return InputManager::GetInst().GetKeyHold(code); + case eKeyState::Release: return InputManager::GetInst().GetKeyRelease(code); + case eKeyState::Away: return InputManager::GetInst().GetKeyAway(code); + default: assert(false); return false; + } +} + +inline void CKeyInput::RegisterAction(ActionKey inKey, const std::function& inAction) +{ + auto iter = m_actionRepo.find(inKey); + if (iter == m_actionRepo.end()) + { + ActionValue value{ inAction, m_validActionCount, inKey }; + const auto& [it, result] = m_actionRepo.emplace(inKey, value); + + m_actionVector.push_back(&it->second); + ++m_validActionCount; + } + else + { + iter->second.Action = inAction; + m_actionVector[iter->second.Index] = &iter->second; + } +} + +template +inline void CKeyInput::BindAction(eKeyCode inKeyCode, eKeyState inKeyState, ObjType* inObj, Func inFunc) +{ + static_assert(std::is_base_of::value); + static_assert(std::is_member_function_pointer::value); + RegisterAction(ActionKey{ inKeyCode, inKeyState }, [inObj, inFunc]() { (inObj->*inFunc)(); }); +} diff --git a/MyD3DFramework/CLight.cpp b/MyD3DFramework/CLight.cpp index 911df2c..487d694 100644 --- a/MyD3DFramework/CLight.cpp +++ b/MyD3DFramework/CLight.cpp @@ -1,2 +1,15 @@ #include "pch.h" #include "CLight.h" +#include "Renderer.h" + +CLight::CLight(eLightType inType, const CTransform* inOwnerTrans) + : m_type(inType) + , m_ownerTrans(inOwnerTrans) +{ + Renderer::GetInst().RegisterCLight(this); +} + +CLight::~CLight() +{ + Renderer::GetInst().RegisterCLight(this); +} diff --git a/MyD3DFramework/CLight.h b/MyD3DFramework/CLight.h index 029ad05..f20e998 100644 --- a/MyD3DFramework/CLight.h +++ b/MyD3DFramework/CLight.h @@ -1,26 +1,46 @@ #pragma once -#include "CAttribute.h" +#include "CTransform.h" class CLight : public CAttribute { public: - virtual ~CLight() = default; + CLight(eLightType inType, const CTransform* inOwnerTrans); + virtual ~CLight();; -protected: - CLight() = default; +public: + inline void SetAmbient(const Color& inColor) { m_ambient = inColor; ColorClamp(m_ambient); } + inline void SetDiffuse(const Color& inColor) { m_diffuse = inColor; ColorClamp(m_diffuse); } + inline void SetSpecualer(const Color& inColor) { m_specular = inColor; ColorClamp(m_specular); } + inline void AddAmbient(const Color& inColor) { m_ambient += inColor; ColorClamp(m_ambient); } + inline void AddDiffuse(const Color& inColor) { m_diffuse += inColor; ColorClamp(m_diffuse); } + inline void AddSpecualer(const Color& inColor) { m_specular += inColor; ColorClamp(m_specular); } - inline void SetAmbient(Color inColor) { m_ambient = inColor; ColorClamp(m_ambient); } - inline void SetDiffuse(Color inColor) { m_diffuse = inColor; ColorClamp(m_diffuse); } - inline void SetSpecualer(Color inColor) { m_specular = inColor; ColorClamp(m_specular); } - inline void SetIntencity(float inIntencity) { m_intencity = inIntencity; Clamp(m_intencity); } - inline void AddIntencity(float inIntencity) { m_intencity += inIntencity; Clamp(m_intencity); } + inline void SetIntensity(float inIntencity) { m_intensity = inIntencity; Clamp(m_intensity); } + inline void AddIntensity(float inIntencity) { m_intensity += inIntencity; Clamp(m_intensity); } inline Color GetAmbient() const { return m_ambient; } inline Color GetDiffuse() const { return m_diffuse; } inline Color GetSpecular() const { return m_specular; } - inline float GetIntencity() const { return m_intencity; } + inline float GetIntensity() const { return m_intensity; } -public: + inline void SetOffsetDirection(const Vector3& inDirection); + inline Vector3 GetDirection() const; + + inline void SetOffsetPosition(const Vector3& inVector); + inline Vector3 GetPosition() const; + + inline void SetAttenuation(const Vector3& inVector); + inline Vector3 GetAttenuation() const; + + inline void SetRange(float inRange); + inline float GetRange() const; + + inline eLightType GetLightType() const; + + inline void SetExponent(float inExponent); + inline float GetExpoent(); + +private: inline void ColorClamp(Color& inLightColor) { Clamp(inLightColor.x); @@ -35,11 +55,82 @@ class CLight : public CAttribute } private: + eLightType m_type; + Color m_ambient = {}; Color m_diffuse = {}; Color m_specular = {}; + const CTransform* m_ownerTrans = nullptr; + + Vector3 m_offsetDirection = Vector3{ 0.f,0.f,1.f }; + Vector3 m_offsetPosition = Vector3::Zero; + + // + Vector3 m_attenuation = { 0.f,1.f,0.f }; + + //ִ Ÿ + float m_range = 100.f; + + //Ʈ + float m_exponent = 16.f; + // - float m_intencity = 1.f; + float m_intensity = 1.f; }; +inline void CLight::SetOffsetDirection(const Vector3& inDirection) +{ + m_offsetDirection = inDirection; + m_offsetDirection.Normalize(); +} + +inline Vector3 CLight::GetDirection() const +{ + return ::XMVector3Rotate(m_offsetDirection, m_ownerTrans->GetRotate()); +} + +inline void CLight::SetOffsetPosition(const Vector3& inVector) +{ + m_offsetPosition = inVector; +} + +inline Vector3 CLight::GetPosition() const +{ + return m_ownerTrans->GetPosition() + m_offsetPosition; +} + +inline void CLight::SetAttenuation(const Vector3& inVector) +{ + m_attenuation = inVector; +} + +inline Vector3 CLight::GetAttenuation() const +{ + return m_attenuation; +} + +inline void CLight::SetRange(float inRange) +{ + m_range = inRange; +} + +inline float CLight::GetRange() const +{ + return m_range; +} + +inline eLightType CLight::GetLightType() const +{ + return m_type; +} + +inline void CLight::SetExponent(float inExponent) +{ + m_exponent = inExponent; +} + +inline float CLight::GetExpoent() +{ + return m_exponent; +} diff --git a/MyD3DFramework/CMeshRenderer.h b/MyD3DFramework/CMeshRenderer.h index 6c2eb3f..e168756 100644 --- a/MyD3DFramework/CMeshRenderer.h +++ b/MyD3DFramework/CMeshRenderer.h @@ -17,9 +17,9 @@ class CMeshRenderer : public CAttribute void SetMesh(const std::string& inMeshKey); void SetMaterial(const std::string& inMaterialKey); - const Mesh* GetMesh() const; + Mesh* GetMesh() const; + Material* GetMaterial() const; const CTransform* GetTransform() const; - const Material* GetMaterial() const; private: void SetIndex(uint64 inIdx); @@ -33,7 +33,7 @@ class CMeshRenderer : public CAttribute const CTransform* m_ownerTrans = nullptr; }; -const Mesh* CMeshRenderer::GetMesh() const + Mesh* CMeshRenderer::GetMesh() const { ASSERT(m_mesh, "޽ð ."); return m_mesh; @@ -44,7 +44,7 @@ const CTransform* CMeshRenderer::GetTransform() const return m_ownerTrans; } -const Material* CMeshRenderer::GetMaterial() const + Material* CMeshRenderer::GetMaterial() const { ASSERT(m_material, "׸ "); return m_material; diff --git a/MyD3DFramework/CPointLight.cpp b/MyD3DFramework/CPointLight.cpp deleted file mode 100644 index 4dbf9c6..0000000 --- a/MyD3DFramework/CPointLight.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "pch.h" -#include "CPointLight.h" diff --git a/MyD3DFramework/CPointLight.h b/MyD3DFramework/CPointLight.h deleted file mode 100644 index 73a6d18..0000000 --- a/MyD3DFramework/CPointLight.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include "CLight.h" - -class CPointLight : public CLight -{ -public: - CPointLight() = default; - virtual ~CPointLight() = default; - - inline void SetPosition(const Vector3& inPosition); - inline void SetAttenuation(const Vector3& inAttenuation); - inline void SetRange(float inRange); - - inline Vector3 GetPosition() const { return m_position; } - inline Vector3 GetAttenuation() const { return m_attenuation; } - inline float GetRange() const { return m_range; } - -private: - Vector3 m_position = {}; - Vector3 m_attenuation = {}; - float m_range = 100.f; -}; - -inline void CPointLight::SetPosition(const Vector3& inPosition) -{ - m_position = inPosition; -} - -inline void CPointLight::SetAttenuation(const Vector3& inAttenuation) -{ - m_attenuation = inAttenuation; -} - -inline void CPointLight::SetRange(float inDist) -{ - m_range = inDist; -} diff --git a/MyD3DFramework/CSpotLight.cpp b/MyD3DFramework/CSpotLight.cpp deleted file mode 100644 index 28237cc..0000000 --- a/MyD3DFramework/CSpotLight.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "pch.h" -#include "CSpotLight.h" - diff --git a/MyD3DFramework/CSpotLight.h b/MyD3DFramework/CSpotLight.h deleted file mode 100644 index 1998f02..0000000 --- a/MyD3DFramework/CSpotLight.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once -#include "CLight.h" - -class CSpotLight : public CLight -{ -public: - CSpotLight() = default; - virtual ~CSpotLight() = default; - - inline void SetPosition(const Vector3& inPosition); - inline void SetDirection(const Vector3& inDirection); - inline void SetAttenuation(const Vector3& inAttenuation); - inline void SetRange(float inRange); - - inline Vector3 GetPosition() const { return m_position; } - inline Vector3 GetDirection() const { return m_direction; } - inline Vector3 GetAttenuation() const { return m_attenuation; } - inline float GetRange() const { return m_range; } - -private: - Vector3 m_position = {}; - Vector3 m_direction = {}; - - Vector3 m_attenuation = {}; - float m_range = 100.f; -}; - -inline void CSpotLight::SetPosition(const Vector3& inPosition) -{ - m_position = inPosition; -} - -inline void CSpotLight::SetDirection(const Vector3& inDirection) -{ - m_direction = inDirection; -} - -inline void CSpotLight::SetAttenuation(const Vector3& inAttenuation) -{ - m_attenuation = inAttenuation; -} - -inline void CSpotLight::SetRange(float inDist) -{ - m_range = inDist; -} diff --git a/MyD3DFramework/CTransform.h b/MyD3DFramework/CTransform.h index 47ce169..faae15d 100644 --- a/MyD3DFramework/CTransform.h +++ b/MyD3DFramework/CTransform.h @@ -9,9 +9,9 @@ class CTransform : public CAttribute void SetPosition(const Vector3& inVector); void SetRotateDegree(float inYaw, float inPitch, float inRoll); - void SetRotateDegree(const Vector3& inVector); + void SetRotateDegree(const Vector3& inYawPitchRoll); void SetRotate(float inYaw, float inPitch, float inRoll); - void SetRotate(const Vector3& inVector); + void SetRotate(const Vector3& inYawPitchRoll); void SetScale(const Vector3& inScale); void AddPosition(const Vector3& inVector); @@ -22,7 +22,12 @@ class CTransform : public CAttribute Vector3 GetPosition() const { return m_translate; } Quaternion GetRotate() const { return m_rotator; } Vector3 GetScale() const { return m_scaling; } - Vector3 GetLookVector() const { return ::XMVector3Rotate(Vector3{ 0.f,0.f,1.f }, m_rotator); } + Vector3 GetForwardVector() const { return ::XMVector3Rotate(Vector3{ 0.f,0.f,1.f }, m_rotator); } + Vector3 GetBackwardVector() const { return ::XMVector3Rotate(Vector3{ 0.f,0.f,-1.f }, m_rotator); } + Vector3 GetRightVector() const { return ::XMVector3Rotate(Vector3{ 1.f,0.f,0.f }, m_rotator); } + Vector3 GetLeftVector() const { return ::XMVector3Rotate(Vector3{ -1.f,0.f,0.f }, m_rotator); } + Vector3 GetUpVector() const { return ::XMVector3Rotate(Vector3{ 0.f,1.f,0.f }, m_rotator); } + Vector3 GetDownVector() const { return ::XMVector3Rotate(Vector3{ 0.f,-1.f,0.f }, m_rotator); } Matrix GetWorldMatrix() const; Matrix GetWorldMatrixInverse() const; @@ -38,11 +43,6 @@ void CTransform::SetPosition(const Vector3& inVector) m_translate = inVector; } -inline void CTransform::SetRotate(const Vector3& inVector) -{ - m_rotator = Quaternion::CreateFromYawPitchRoll(inVector); -} - inline void CTransform::SetRotateDegree(float inYaw, float inPitch, float inRoll) { inYaw = ::XMConvertToRadians(inYaw); @@ -51,12 +51,12 @@ inline void CTransform::SetRotateDegree(float inYaw, float inPitch, float inRoll m_rotator = Quaternion::CreateFromYawPitchRoll(inYaw, inPitch, inRoll); } -inline void CTransform::SetRotateDegree(const Vector3& inVector) +inline void CTransform::SetRotateDegree(const Vector3& inYawPitchRoll) { m_rotator = Quaternion::CreateFromYawPitchRoll( - ::XMConvertToRadians(inVector.x), - ::XMConvertToRadians(inVector.y), - ::XMConvertToRadians(inVector.z) + ::XMConvertToRadians(inYawPitchRoll.x), + ::XMConvertToRadians(inYawPitchRoll.y), + ::XMConvertToRadians(inYawPitchRoll.z) ); } @@ -65,6 +65,11 @@ void CTransform::SetRotate(float inYaw, float inPitch, float inRoll) m_rotator = Quaternion::CreateFromYawPitchRoll(inYaw, inPitch, inRoll); } +inline void CTransform::SetRotate(const Vector3& inYawPitchRoll) +{ + m_rotator = Quaternion::CreateFromYawPitchRoll(inYawPitchRoll); +} + void CTransform::SetScale(const Vector3& inScale) { m_scaling = inScale; diff --git a/MyD3DFramework/CameraObject.cpp b/MyD3DFramework/CameraObject.cpp index c1b7baf..d8fe483 100644 --- a/MyD3DFramework/CameraObject.cpp +++ b/MyD3DFramework/CameraObject.cpp @@ -2,11 +2,26 @@ #include "CameraObject.h" #include "CCamera.h" #include "CTransform.h" +#include "CKeyInput.h" CameraObject::CameraObject() { m_trans = CreateComponent(); m_camera = CreateComponent(45.f, 0.5f, 100.f, m_trans); + m_input = CreateComponent(); + + /* Dz */ + m_input->BindAction(eKeyCode::Left, eKeyState::Hold, this, &CameraObject::MoveLeft); + m_input->BindAction(eKeyCode::Right, eKeyState::Hold, this, &CameraObject::MoveRight); + m_input->BindAction(eKeyCode::Up, eKeyState::Hold, this, &CameraObject::MoveForward); + m_input->BindAction(eKeyCode::Down, eKeyState::Hold, this, &CameraObject::MoveBackward); + m_input->BindAction(eKeyCode::Space, eKeyState::Hold, this, &CameraObject::MoveUp); + m_input->BindAction(eKeyCode::L_Shift, eKeyState::Hold, this, &CameraObject::MoveDown); + m_input->BindAction(eKeyCode::A, eKeyState::Hold, this, &CameraObject::TurnLeft); + m_input->BindAction(eKeyCode::D, eKeyState::Hold, this, &CameraObject::TurnRight); + m_input->BindAction(eKeyCode::W, eKeyState::Hold, this, &CameraObject::TurnUp); + m_input->BindAction(eKeyCode::S , eKeyState::Hold, this, &CameraObject::TurnDown); + } void CameraObject::Initialize() @@ -16,7 +31,57 @@ void CameraObject::Initialize() m_trans->SetRotate(Vector3::One); } -void CameraObject::Update(float inDeltaTime) +void CameraObject::Update() +{ +} + +void CameraObject::MoveLeft() +{ + m_trans->AddPosition(m_trans->GetLeftVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::MoveRight() +{ + m_trans->AddPosition(m_trans->GetRightVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::MoveForward() +{ + m_trans->AddPosition(m_trans->GetForwardVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::MoveBackward() +{ + m_trans->AddPosition(m_trans->GetBackwardVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::MoveUp() +{ + m_trans->AddPosition(m_trans->GetUpVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::MoveDown() +{ + m_trans->AddPosition(m_trans->GetDownVector() * sMoveSpeed * DELTA_TIME); +} + +void CameraObject::TurnLeft() +{ + m_trans->AddRotateDegree(-sTurnSpeed * DELTA_TIME, 0, 0); +} + +void CameraObject::TurnRight() +{ + m_trans->AddRotateDegree(sTurnSpeed * DELTA_TIME, 0, 0); +} + +void CameraObject::TurnDown() +{ + m_trans->AddRotateDegree(0, -sTurnSpeed * DELTA_TIME, 0); +} + +void CameraObject::TurnUp() { + m_trans->AddRotateDegree(0, sTurnSpeed * DELTA_TIME, 0); } diff --git a/MyD3DFramework/CameraObject.h b/MyD3DFramework/CameraObject.h index 3af4169..07acb57 100644 --- a/MyD3DFramework/CameraObject.h +++ b/MyD3DFramework/CameraObject.h @@ -3,6 +3,7 @@ class CTransform; class CCamera; +class CKeyInput; class CameraObject : public GameObject { @@ -11,9 +12,26 @@ class CameraObject : public GameObject virtual ~CameraObject() = default; void Initialize() override; - void Update(float inDeltaTime) override; + void Update() override; + +private: + void MoveLeft(); + void MoveRight(); + void MoveForward(); + void MoveBackward(); + void MoveUp(); + void MoveDown(); + + void TurnLeft(); + void TurnRight(); + void TurnDown(); + void TurnUp(); private: CTransform* m_trans = {}; CCamera* m_camera = {}; + CKeyInput* m_input = {}; + + constexpr inline static float sTurnSpeed = 45.f; + constexpr inline static float sMoveSpeed = 1.f; }; diff --git a/MyD3DFramework/Component.h b/MyD3DFramework/Component.h index a850406..d3ea87e 100644 --- a/MyD3DFramework/Component.h +++ b/MyD3DFramework/Component.h @@ -19,6 +19,9 @@ class Component const CM::Name GetName() const { return m_name; } + template + CompType* CastOrNull(); + protected: Component() = default; @@ -63,6 +66,19 @@ size_t Component::GetIndex() const return m_index; } +template +inline CompType* Component::CastOrNull() +{ + static_assert(std::is_base_of::value); + + if (m_typeID == CM::TypeTrait::ID()) + { + return static_cast(this); + } + + return nullptr; +} + template inline void Component::SetupComponent(GameObject* inOwner, const CM::TypeID& inTypeID, std::string_view inName) { diff --git a/MyD3DFramework/DevScene.cpp b/MyD3DFramework/DevScene.cpp index 8b4a45a..15590d0 100644 --- a/MyD3DFramework/DevScene.cpp +++ b/MyD3DFramework/DevScene.cpp @@ -1,14 +1,25 @@ #include "pch.h" #include "DevScene.h" +#include "CameraObject.h" +#include "CCamera.h" void DevScene::EnterScene() { + CameraObject* cmrObj = CreateGameObject(); + + /* ī޶ */ + CCamera* cmr = cmrObj->GetComponentOrNull(); + if (cmr) + { + cmr->RegisterToMainCamera(); + } } -void DevScene::UpdateScene(float inDeltaTime) +void DevScene::UpdateScene() { } void DevScene::ExitScene() { + ClearRepogitory(); } diff --git a/MyD3DFramework/DevScene.h b/MyD3DFramework/DevScene.h index ba08d52..fe8de29 100644 --- a/MyD3DFramework/DevScene.h +++ b/MyD3DFramework/DevScene.h @@ -4,10 +4,10 @@ class DevScene : public Scene { public: - DevScene() {} + DevScene() { /* ڿ ü */ } virtual ~DevScene() {} void EnterScene() override; - void UpdateScene(float inDeltaTime) override; + void UpdateScene() override; void ExitScene() override; }; diff --git a/MyD3DFramework/Effect.h b/MyD3DFramework/Effect.h index 417ece4..42ab6f4 100644 --- a/MyD3DFramework/Effect.h +++ b/MyD3DFramework/Effect.h @@ -109,16 +109,14 @@ class Effect { ComPtr constantBuffer = m_cbRepo[key].ConstantBuffer; - // Ʈ D3D11_BUFFER_DESC desc = {}; constantBuffer->GetDesc(&desc); uint32 bufferSize = desc.ByteWidth; - // ¡ - desc.Usage = D3D11_USAGE_STAGING; // ¡ ۷ - desc.BindFlags = 0; // ¡ ۴ BindFlags ʿ - desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; // CPU б + desc.Usage = D3D11_USAGE_STAGING; + desc.BindFlags = 0; + desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; desc.MiscFlags = 0; ComPtr stagingBuffer; @@ -129,15 +127,12 @@ class Effect return; } - // ¡ ۷ Ʈ context->CopyResource(stagingBuffer.Get(), constantBuffer.Get()); - // ¡ (б ) D3D11_MAPPED_SUBRESOURCE mappedResource; hr = context->Map(stagingBuffer.Get(), 0, D3D11_MAP_READ, 0, &mappedResource); if (SUCCEEDED(hr)) { - // ͸ оͼ () std::byte* bufferData = static_cast(mappedResource.pData); for (size_t i = 0; i < bufferSize; ++i) { @@ -146,7 +141,6 @@ class Effect WinUtile::OutputLog(b.c_str()); } - // context->Unmap(stagingBuffer.Get(), 0); } else @@ -158,9 +152,9 @@ class Effect private: struct ConstantBufferInfo { - ComPtr ConstantBuffer; - uint32 Flags; - uint32 Slot; + ComPtr ConstantBuffer = nullptr; + uint32 Flags = 0; + uint32 Slot = 0; }; private: diff --git a/MyD3DFramework/Engine.cpp b/MyD3DFramework/Engine.cpp index cfac857..bae7b05 100644 --- a/MyD3DFramework/Engine.cpp +++ b/MyD3DFramework/Engine.cpp @@ -65,7 +65,7 @@ void Engine::Update() //DebugHandler(); // //Scene Ʈ - SceneManager::GetInst().GetCurrentScene()->UpdateSceneCore(timer.GetDeltaTime()); + SceneManager::GetInst().GetCurrentScene()->UpdateSceneCore(); } void Engine::Render() diff --git a/MyD3DFramework/Enums.h b/MyD3DFramework/Enums.h index 785d836..4c603eb 100644 --- a/MyD3DFramework/Enums.h +++ b/MyD3DFramework/Enums.h @@ -27,3 +27,12 @@ enum class eFont Count }; + +enum class eLightType +{ + Directional_Light, + Point_Light, + Spot_Light, + + Count +}; diff --git a/MyD3DFramework/FastCompVector.h b/MyD3DFramework/FastCompVector.h index 8d5b66f..74e0ec2 100644 --- a/MyD3DFramework/FastCompVector.h +++ b/MyD3DFramework/FastCompVector.h @@ -90,6 +90,11 @@ namespace CM return m_hashRepo.contains(inItem->GetComponentID()); } + inline size_t Size() + { + return m_validSize; + } + private: using Pair = std::pair; diff --git a/MyD3DFramework/GameObject.cpp b/MyD3DFramework/GameObject.cpp index 1707805..08cd75c 100644 --- a/MyD3DFramework/GameObject.cpp +++ b/MyD3DFramework/GameObject.cpp @@ -7,7 +7,7 @@ void GameObject::InitalizeCore() Initialize(); } -void GameObject::UpdateCore(float inDeltaTime) +void GameObject::UpdateCore( ) { for (size_t i = 0; i < m_validCompSizeInVector; ++i) { @@ -15,10 +15,10 @@ void GameObject::UpdateCore(float inDeltaTime) if (cmp->IsEnable()) { - UpdateCore(inDeltaTime); + cmp->Update(); } } - Update(inDeltaTime); + Update(); } diff --git a/MyD3DFramework/GameObject.h b/MyD3DFramework/GameObject.h index ce7a504..23bf9b1 100644 --- a/MyD3DFramework/GameObject.h +++ b/MyD3DFramework/GameObject.h @@ -8,7 +8,7 @@ class GameObject virtual ~GameObject() = default; virtual void InitalizeCore(); - virtual void UpdateCore(float inDeltaTime); + virtual void UpdateCore(); const CM::Name GetName() const { return m_name; } @@ -59,7 +59,7 @@ class GameObject void SetupObject(std::string_view inNameOrEmpty, bool isExplitName); virtual void Initialize() = 0; - virtual void Update(float inDeltaTime) = 0; + virtual void Update() = 0; private: inline static uint64 sObjectIDCounter = 0; @@ -79,7 +79,6 @@ GameObject::GameObject() } - // Ʈ Լ inline void GameObject::AddComponentToRepo(const CM::TypeID& inTypeID, std::unique_ptr inCmp) { @@ -197,7 +196,7 @@ CompType* GameObject::GetComponentOrNull() return nullptr; } - return iter->second[0].get(); + return static_cast(iter->second[0].get()); } template diff --git a/MyD3DFramework/GameTimer.h b/MyD3DFramework/GameTimer.h index 20f3325..79c912b 100644 --- a/MyD3DFramework/GameTimer.h +++ b/MyD3DFramework/GameTimer.h @@ -36,7 +36,7 @@ class GameTimer bool m_bStop = false; //Ÿ̸ ߴ ÷ }; -GameTimer::GameTimer() +inline GameTimer::GameTimer() { //ֱ ʱȭ LARGE_INTEGER freq = {}; @@ -47,10 +47,8 @@ GameTimer::GameTimer() } -void GameTimer::Update() +inline void GameTimer::Update() { - //Ÿ̸ Ʈ - //Ÿ̸ Ͻ ó if (m_bStop) { @@ -74,24 +72,24 @@ void GameTimer::Update() } } -void GameTimer::Reset() +inline void GameTimer::Reset() { //Ÿ̸ LARGE_INTEGER curCount = {}; ::QueryPerformanceCounter(&curCount); - m_prevCount = curCount.QuadPart; - m_baseTime = curCount.QuadPart; + m_prevCount = curCount.QuadPart; + m_baseTime = curCount.QuadPart; - m_stopTime = 0; - m_pauseTime = 0; + m_stopTime = 0; + m_pauseTime = 0; - m_deltaTime = 0.f; + m_deltaTime = 0.f; - m_bStop = false; + m_bStop = false; } -void GameTimer::TimerStop() +inline void GameTimer::TimerStop() { //Ÿ̸ Լ if (!m_bStop) @@ -105,7 +103,7 @@ void GameTimer::TimerStop() } } -void GameTimer::TimerStart() +inline void GameTimer::TimerStart() { // Ÿ̸ 簳 Լ if (m_bStop) @@ -120,12 +118,12 @@ void GameTimer::TimerStart() } } -float GameTimer::GetDeltaTime() const +inline float GameTimer::GetDeltaTime() const { return m_deltaTime; } -float GameTimer::GetTotalTime() const +inline float GameTimer::GetTotalTime() const { if (m_bStop) { @@ -140,7 +138,7 @@ float GameTimer::GetTotalTime() const } } -uint64 GameTimer::GetFPS() const +inline uint64 GameTimer::GetFPS() const { return m_fps; } diff --git a/MyD3DFramework/InputManager.h b/MyD3DFramework/InputManager.h index 31a8d14..4489ab3 100644 --- a/MyD3DFramework/InputManager.h +++ b/MyD3DFramework/InputManager.h @@ -93,13 +93,15 @@ class InputManager bool GetKeyRelease(eKeyCode key) { return m_stateList[static_cast(key)] == eKeyState::Release; } bool GetKeyAway(eKeyCode key) { return m_stateList[static_cast(key)] == eKeyState::Away; } + bool GetKeyDown(eKeyCode key) { return GetKeyHold(key) && GetKeyPress(key); } + bool GetKeyUp(eKeyCode key) { return GetKeyRelease(key) && GetKeyAway(key); } + POINT GetMousePos()const { return m_mousePos; } POINT GetDeltaMousePos() const { return POINT{ m_mousePos.x - m_prevMousePos.x, m_mousePos.y - m_prevMousePos.y }; } private: std::array m_stateList = {}; - POINT m_mousePos = {}; - POINT m_prevMousePos = {}; + POINT m_mousePos = {}; POINT m_prevMousePos = {}; HWND m_hwnd = NULL; }; diff --git a/MyD3DFramework/Macro.h b/MyD3DFramework/Macro.h index 4f0ed60..d4d64ba 100644 --- a/MyD3DFramework/Macro.h +++ b/MyD3DFramework/Macro.h @@ -39,10 +39,13 @@ inline static classname& GetInst() \ #define KEY_RELEASE(keycode) InputManager::GetInst().GetKeyRelease(keycode) #define KEY_PRESS(keycode) InputManager::GetInst().GetKeyPress(keycode) #define KEY_AWAY(keycode) InputManager::GetInst().GetKeyAway(keycode) +#define KEY_DOWN(keycode) InputManager::GetInst().GetKeyDown(keycode) +#define KEY_UP(keycode) InputManager::GetInst().GetKeyUp(keycode) #define NODISCARD [[nodiscard]] #define USING_SUPER(classname) using Super = classname +#define DELTA_TIME GameTimer::GetInst().GetDeltaTime() #ifdef _DEBUG && (true) #define TODO(msg) static_assert(false, msg) diff --git a/MyD3DFramework/Mesh.h b/MyD3DFramework/Mesh.h index 4e4999a..35cd2da 100644 --- a/MyD3DFramework/Mesh.h +++ b/MyD3DFramework/Mesh.h @@ -1,4 +1,5 @@ #pragma once +#include "Renderer.h" class Mesh { diff --git a/MyD3DFramework/MyD3DFramework.vcxproj b/MyD3DFramework/MyD3DFramework.vcxproj index 933aaf2..fda4fe2 100644 --- a/MyD3DFramework/MyD3DFramework.vcxproj +++ b/MyD3DFramework/MyD3DFramework.vcxproj @@ -118,6 +118,7 @@ stdc17 $(SolutionDir)\DirectXTK\inc;$(SolutionDir)\MyD3DFramework;%(AdditionalIncludeDirectories) Fast + 5 Windows @@ -149,17 +150,16 @@ + - + - - @@ -200,17 +200,16 @@ + - + - - diff --git a/MyD3DFramework/MyD3DFramework.vcxproj.filters b/MyD3DFramework/MyD3DFramework.vcxproj.filters index d443b5b..77017fa 100644 --- a/MyD3DFramework/MyD3DFramework.vcxproj.filters +++ b/MyD3DFramework/MyD3DFramework.vcxproj.filters @@ -109,15 +109,6 @@ 99.Headers\Utility - - 06.GameModules\Attribute\Light - - - 06.GameModules\Attribute\Light - - - 06.GameModules\Attribute\Light - 03.System @@ -148,6 +139,12 @@ 99.Headers\ID + + 06.GameModules\Behavior + + + 99.Headers\Utility\Container + @@ -331,15 +328,6 @@ 99.Headers\Utility - - 06.GameModules\Attribute\Light - - - 06.GameModules\Attribute\Light - - - 06.GameModules\Attribute\Light - 03.System @@ -370,6 +358,12 @@ 99.Headers\ID + + 06.GameModules\Behavior + + + 99.Headers\Utility\Container + diff --git a/MyD3DFramework/Name.h b/MyD3DFramework/Name.h index 6d2aaaa..1874033 100644 --- a/MyD3DFramework/Name.h +++ b/MyD3DFramework/Name.h @@ -12,6 +12,8 @@ namespace CM Name() = default; Name(std::string_view inString, size_t inNumber); + static Name GetUniqueName(std::string_view inString) { return Name{ inString, UNIQUE_KEY }; } + bool operator==(const Name& inOther) const; std::string_view ToString() const; @@ -25,7 +27,7 @@ namespace CM private: std::string_view m_stringView; - size_t m_nameID; + size_t m_nameID = NULL; size_t m_extraIndex = UNIQUE_KEY; }; } diff --git a/MyD3DFramework/Renderer.cpp b/MyD3DFramework/Renderer.cpp index 0673a0b..ab57943 100644 --- a/MyD3DFramework/Renderer.cpp +++ b/MyD3DFramework/Renderer.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Renderer.h" #include "WindowsApp.h" +#include "CCamera.h" #include "Engine.h" #include "CTransform.h" #include "CMeshRenderer.h" @@ -252,75 +253,97 @@ void Renderer::InitializeRenderResoucre() CONSTANT_BUFFER_APPLY_PIXEL_SHADER ); - // ʱȭ - //const static Vector3 s_cmrLookAt{ 0.f, 0.f, 5.f }; - //m_viewMat = ::XMMatrixLookAtLH(m_cmrPosition, s_cmrLookAt, m_worldUpAxis); - //m_cmrLook = s_cmrLookAt - m_cmrPosition; - //m_cmrLook.Normalize(); - // - //m_projMat = ::XMMatrixPerspectiveFovLH( - // m_fov, - // WindowsApp::GetInst().GetAspectRatio(), - // m_nearPlane, - // m_farPlane); - // - //// ʱȭ - //m_dirLight.Ambient = Color(0.2f, 0.2f, 0.2f, 1.f); - //m_dirLight.Diffuse = Color(1.0f, 0.95f, 0.8f, 1.f); - //m_dirLight.Specular = Color(1.0f, 1.0f, 1.0f, 1.f); - //m_dirLight.Direction = Vector3(2.f, -1.f, 2.f); - //m_dirLight.Direction.Normalize(); - - //׸ - Material* material = CreateMaterial(BasicMaterialKey); - material->Ambient = Color(0.4f, 0.4f, 0.4f, 1.f); - material->Diffuse = Color(0.5f, 0.5f, 0.5f, 1.f); - material->Specular = Color(0.8f, 0.8f, 0.8f, 16.f); - SetCurrentEffect(BasicEffectKey); SetCurrentRenderState(BasicRenderStateKey); } void Renderer::Render() { - ////Constant Buffer Per Frame - //{ - // cbPerFrame cb = {}; - // //cb.DirLight = m_dirLight; - // //cb.PointLight = m_pointLight; - // //cb.SpotLight = m_spotLight; - // - // cb.EyePosW = ToVector4(m_cmrPosition, true); - // - // m_curEffect->UpdateConstantBuffer(m_deviceContext.Get(), CbPerFrameKey, cb); - //} - // - ////Constant Buffer Per Object - //for (const auto* mesh : m_cMashRendererRepo) - //{ - // if (mesh == nullptr) - // { - // //mesh ʰ, ߿ - // // DZ nullptr · - // continue; - // } - // - // const Mesh* m = mesh->GetMesh(); - // const CTransform* t = mesh->GetTransform(); - // - // // - // Matrix wMat = t->GetWorldMatrix(); - // - // cbPerObject cb = {}; - // cb.Material = *mesh->GetMaterial(); - // cb.World = ::XMMatrixTranspose(t->GetWorldMatrix()); - // cb.WorldInvTranspose = t->GetWorldMatrixInverse(); - // - // m_curEffect->UpdateConstantBuffer(m_deviceContext.Get(), CbPerObjectKey, cb); - // - // m->BindBuffers(m_deviceContext.Get()); - // RenderIndices(m->GetIndexBufferSize()); - //} + /* ī޶ */ + { + cbPerFrame cb = {}; + + /* ⼺ */ + for (int i = 0; i < m_dirLightRepo.Size(); ++i) + { + cbStructDirLight desc = {}; + desc.Ambient = m_dirLightRepo[i]->GetAmbient(); + desc.Diffuse = m_dirLightRepo[i]->GetDiffuse(); + desc.Specular = m_dirLightRepo[i]->GetSpecular(); + desc.Direction = m_dirLightRepo[i]->GetDirection(); + + cb.DirLight[i] = desc; + } + + /* */ + for (int i = 0; i < m_pointLightRepo.Size(); ++i) + { + cbStructPointLight desc = {}; + desc.Ambient = m_pointLightRepo[i]->GetAmbient(); + desc.Diffuse = m_pointLightRepo[i]->GetDiffuse(); + desc.Specular = m_pointLightRepo[i]->GetSpecular(); + desc.Position = m_pointLightRepo[i]->GetPosition(); + desc.Attenuation = m_pointLightRepo[i]->GetAttenuation(); + desc.Range = m_pointLightRepo[i]->GetRange(); + + cb.PointLight[i] = desc; + } + + /* Ʈ */ + for (int i = 0; i < m_spotLightRepo.Size(); ++i) + { + cbStructSpotLight desc = {}; + desc.Ambient = m_spotLightRepo[i]->GetAmbient(); + desc.Diffuse = m_spotLightRepo[i]->GetDiffuse(); + desc.Specular = m_spotLightRepo[i]->GetSpecular(); + desc.Position = m_spotLightRepo[i]->GetPosition(); + desc.Attenuation = m_spotLightRepo[i]->GetAttenuation(); + desc.Range = m_spotLightRepo[i]->GetRange(); + desc.Exponent = m_spotLightRepo[i]->GetExpoent(); + desc.SpotDirection = m_spotLightRepo[i]->GetDirection(); + + cb.SpotLight[i] = desc; + } + + /* */ + cb.DirLightCount = m_dirLightRepo.Size(); + cb.PointLightCount= m_pointLightRepo.Size(); + cb.SpotLightCount = m_spotLightRepo.Size(); + + cb.EyePosW = ToVector4(m_camera->GetPosition()); + cb.ViewProj = m_camera->GetPerspectiveMatrix(WindowsApp::GetInst().GetAspectRatio()); + + m_curEffect->UpdateConstantBuffer(m_deviceContext.Get(), CbPerFrameKey, cb); + } + + /* Ʈ */ + const auto& repo = m_cMeshRendererRepo.GetVector(); + for (int i = 0; i < repo.size(); ++i) + { + const CMeshRenderer* meshCmp = repo[i]; + if (meshCmp->IsEnable()) + { + cbPerObject cb = {}; + + cb.Material = *meshCmp->GetMaterial(); + + cb.World = meshCmp->GetTransform()->GetWorldMatrix(); + cb.WorldInvTranspose = meshCmp->GetTransform()->GetWorldMatrixInverse(); + + m_curEffect->UpdateConstantBuffer(m_deviceContext.Get(), CbPerObjectKey, cb); + + /* ¦ ȵ */ + Mesh* m = meshCmp->GetMesh(); + if (m != m_curMesh) + { + m->BindBuffers(m_deviceContext.Get()); + BindMesh(m); + } + + RenderIndices(m->GetIndexBufferSize()); + } + } + //// ʱȭ ұ ?? //m_curEffect->Apply(m_deviceContext.Get()); @@ -374,21 +397,8 @@ void Renderer::Render() //Ʈ - - for (const CMeshRenderer* meshComp : m_cMeshRendererRepo.GetVector()) - { - if (meshComp == nullptr) - { - break; - } - if (!meshComp->IsEnable()) - { - continue; - } - /* */ - } } //======================================== diff --git a/MyD3DFramework/Renderer.h b/MyD3DFramework/Renderer.h index 97ed5fb..11b4f2c 100644 --- a/MyD3DFramework/Renderer.h +++ b/MyD3DFramework/Renderer.h @@ -1,11 +1,12 @@ #pragma once #include #include "CMeshRenderer.h" +#include "CLight.h" #include "FastCompVector.h" -class CMeshRenderer; class CCamera; -class CLight; +class Effect; +class RenderState; class Renderer { @@ -59,6 +60,9 @@ class Renderer void SetCurrentEffect(const std::string& inKey); void SetCurrentRenderState(const std::string& inKey); + void BindMesh(Mesh* inMesh) { m_curMesh = inMesh; } + Mesh* GetBindedMesh() const { return m_curMesh; } + // ī޶ ڵ void RegisterCamera(CCamera* inCamera); void ReleaseCamera() { m_camera = nullptr; } @@ -80,6 +84,9 @@ class Renderer void RegisterCMeshRenderer(CMeshRenderer* inMesh); void UnRegisterCMeshRenderer(CMeshRenderer* inMesh); + void RegisterCLight(CLight* inLight); + void UnRegisterCLight(CLight* inLight); + public: // Static const static std::string BasicEffectKey; @@ -127,9 +134,15 @@ class Renderer //Constant Buffer Struct cbPerObject m_cbPerObject = {}; cbPerFrame m_cbPerFrame = {}; - + //3D ޽ - CM::FastCompVector m_cMeshRendererRepo{ 1024 }; + CM::FastCompVector m_cMeshRendererRepo; + Mesh* m_curMesh = nullptr; + + // + CM::Array m_dirLightRepo = {}; + CM::Array m_pointLightRepo = {}; + CM::Array m_spotLightRepo = {}; //ī޶ CCamera* m_camera = nullptr; @@ -256,8 +269,31 @@ void Renderer::UnRegisterCMeshRenderer(CMeshRenderer* inMesh) m_cMeshRendererRepo.Remove(inMesh); } +inline void Renderer::RegisterCLight(CLight* inLight) +{ + switch (inLight->GetLightType()) + { + case eLightType::Directional_Light: m_dirLightRepo.PushBack(inLight); break; + case eLightType::Point_Light: m_pointLightRepo.PushBack(inLight); break; + case eLightType::Spot_Light: m_spotLightRepo.PushBack(inLight); break; + default: assert(false); + } +} + +inline void Renderer::UnRegisterCLight(CLight* inLight) +{ + switch (inLight->GetLightType()) + { + case eLightType::Directional_Light: m_dirLightRepo.Erase(inLight); break; + case eLightType::Point_Light: m_pointLightRepo.Erase(inLight); break; + case eLightType::Spot_Light: m_spotLightRepo.Erase(inLight); break; + default: assert(false); + } +} + Renderer::Renderer() { + m_cMeshRendererRepo.Reserve(1024); } Mesh* Renderer::GetMesh(const std::string& inKey) diff --git a/MyD3DFramework/ResourceManager.cpp b/MyD3DFramework/ResourceManager.cpp index 39293fa..85dcffc 100644 --- a/MyD3DFramework/ResourceManager.cpp +++ b/MyD3DFramework/ResourceManager.cpp @@ -20,7 +20,7 @@ void ResourceManager::LoadFont() std::wstring fontResourcePath = m_resourcePath + L"Font\\"; ID3D11Device5* device = Renderer::GetInst().GetDeivce(); - auto CreateSpriteFont = [&](const std::wstring& fileName) + static const auto CreateSpriteFont = [&](const std::wstring& fileName) { return std::make_unique(device, (fontResourcePath + fileName).c_str()); }; diff --git a/MyD3DFramework/Scene.cpp b/MyD3DFramework/Scene.cpp index e51b588..020feb5 100644 --- a/MyD3DFramework/Scene.cpp +++ b/MyD3DFramework/Scene.cpp @@ -7,16 +7,16 @@ void Scene::EnterSceneCore() EnterScene(); } -void Scene::UpdateSceneCore(float inDeltaTime) +void Scene::UpdateSceneCore() { for (size_t i = 0; i < m_validObjSizeinVector; ++i) { GameObject* obj = m_updateObjRepo[i]; - obj->Update(inDeltaTime); + obj->Update(); } - UpdateScene(inDeltaTime); + UpdateScene(); } void Scene::ExitSceneCore() diff --git a/MyD3DFramework/Scene.h b/MyD3DFramework/Scene.h index 93d3e4e..41c75e2 100644 --- a/MyD3DFramework/Scene.h +++ b/MyD3DFramework/Scene.h @@ -10,15 +10,15 @@ class Scene // Լ void EnterSceneCore(); - void UpdateSceneCore(float inDeltaTime); + void UpdateSceneCore(); void ExitSceneCore(); /* Ʈ */ template - GameObject* CreateGameObject(Args&&...args); + ObjType* CreateGameObject(Args&&...args); template - GameObject* CreateNamedGameObject(std::string_view inObjectName, Args&&...args); + ObjType* CreateNamedGameObject(std::string_view inObjectName, Args&&...args); /* Ž */ GameObject* GetGameObjectOrNull(const CM::Name& inObjName); @@ -32,16 +32,17 @@ class Scene /* ÷ */ void CleanGarbge(); + void ClearRepogitory(); protected: Scene(); virtual void EnterScene() = 0; - virtual void UpdateScene(float inDeltaTime) = 0; + virtual void UpdateScene() = 0; virtual void ExitScene() = 0; private: - void AddObjectToRepositories(std::unique_ptr& inObject); + void AddObjectToRepositories(std::unique_ptr inObject); private: constexpr static size_t sReserveCapacity = 1024; @@ -51,7 +52,6 @@ class Scene size_t m_validObjSizeinVector = 0; }; - /* Ž */ inline GameObject* Scene::GetGameObjectOrNull(const CM::Name& inObjName) { @@ -127,6 +127,12 @@ void Scene::CleanGarbge() } } +inline void Scene::ClearRepogitory() +{ + m_gameObjRepo.clear(); + m_updateObjRepo.clear(); + m_validObjSizeinVector = 0; +} Scene::Scene() { @@ -134,7 +140,7 @@ Scene::Scene() m_updateObjRepo.reserve(sReserveCapacity); } -inline void Scene::AddObjectToRepositories(std::unique_ptr& inObject) +inline void Scene::AddObjectToRepositories(std::unique_ptr inObject) { //迭 Ʈ size_t backIndex = m_updateObjRepo.size(); @@ -152,26 +158,33 @@ inline void Scene::AddObjectToRepositories(std::unique_ptr& inObject } //ؽ Ʈ - ASSERT(!m_gameObjRepo.contains(inObject->GetName()), " ID Ʈ ̹ մϴ."); - m_gameObjRepo[inObject->GetName()] = std::make_pair(m_validObjSizeinVector - 1, std::move(inObject)); + const CM::Name& name = inObject->GetName(); + ASSERT(!m_gameObjRepo.contains(name), " ID Ʈ ̹ մϴ."); + m_gameObjRepo[name] = std::make_pair(m_validObjSizeinVector - 1, std::move(inObject)); } template -inline GameObject* Scene::CreateGameObject(Args && ...args) +inline ObjType* Scene::CreateGameObject(Args && ...args) { static_assert(std::is_base_of::value, "ObjType is not derivation of GameObject"); - std::unique_ptr obj = std::make_unique(std::forward(args)...); + std::unique_ptr obj = std::make_unique(std::forward(args)...); obj->SetupObject(CM::GetTypeName(), false); + obj->InitalizeCore(); + ObjType* ptr = obj.get(); + AddObjectToRepositories(std::move(obj)); - return AddObjectToRepositories(obj); + return ptr; } template -inline GameObject* Scene::CreateNamedGameObject(std::string_view inObjectName, Args && ...args) +inline ObjType* Scene::CreateNamedGameObject(std::string_view inObjectName, Args && ...args) { static_assert(std::is_base_of::value, "ObjType is not derivation of GameObject"); - std::unique_ptr obj = std::make_unique(std::forward(args)...); + std::unique_ptr obj = std::make_unique(std::forward(args)...); obj->SetupObject(inObjectName, true); + obj->InitalizeCore(); + ObjType* ptr = obj.get(); + AddObjectToRepositories(std::move(obj)); - return AddObjectToRepositories(obj);; + return ptr; } diff --git a/MyD3DFramework/SceneManager.h b/MyD3DFramework/SceneManager.h index 72455d4..d0c8e3a 100644 --- a/MyD3DFramework/SceneManager.h +++ b/MyD3DFramework/SceneManager.h @@ -62,7 +62,10 @@ void SceneManager::SwitchScene() assert(iter != m_sceneRepo.end()); // Scene ó - m_curScene->ExitSceneCore(); + if (m_curScene) + { + m_curScene->ExitSceneCore(); + } //Scene Scene* sceneToSwitch = iter->second.get(); diff --git a/MyD3DFramework/pch.h b/MyD3DFramework/pch.h index 41c1c09..fda2cd6 100644 --- a/MyD3DFramework/pch.h +++ b/MyD3DFramework/pch.h @@ -46,6 +46,7 @@ using namespace DirectX::SimpleMath; #include #include #include +#include //STL #include @@ -64,10 +65,12 @@ using namespace DirectX::SimpleMath; #include "SimpleMathAdv.h" #include "TypeTrait.h" #include "Name.h" +#include "GameTimer.h" //MyContainer #include "SortedVector.h" #include "CircularArray.h" +#include "Array.h" //About Rendering #include "Mesh.h" diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.exe.recipe b/MyD3DFramework/x64/Debug/MyD3DFramework.exe.recipe index d164bd9..d611f68 100644 --- a/MyD3DFramework/x64/Debug/MyD3DFramework.exe.recipe +++ b/MyD3DFramework/x64/Debug/MyD3DFramework.exe.recipe @@ -2,21 +2,21 @@ - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\MyD3DFramework.exe + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\Binaries\Debug\MyD3DFramework.exe - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\LightPixelShader.cso + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\Binaries\Debug\LightPixelShader.cso - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\SimplePixelShader.cso + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\Binaries\Debug\SimplePixelShader.cso - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\SimpleVertexShader.cso + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\Binaries\Debug\SimpleVertexShader.cso - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\LightVertexShader.cso + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\Binaries\Debug\LightVertexShader.cso diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.ilk b/MyD3DFramework/x64/Debug/MyD3DFramework.ilk index 825ec2a..21fdd62 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.ilk and b/MyD3DFramework/x64/Debug/MyD3DFramework.ilk differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.log b/MyD3DFramework/x64/Debug/MyD3DFramework.log index 65706b1..69221d2 100644 --- a/MyD3DFramework/x64/Debug/MyD3DFramework.log +++ b/MyD3DFramework/x64/Debug/MyD3DFramework.log @@ -1,28 +1,34 @@ C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppBuild.targets(517,5): warning MSB8004: Output 디렉터리가 슬래시로 끝나지 않습니다. Output 디렉터리의 적절한 평가를 허용하는 데 필요하므로 이 빌드 인스턴스에서 슬래시를 추가합니다. - unity_F3LWLJ6LKDGCHCCN.cpp -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\CMeshRenderer.h(5,7): warning C4099: 'Material': 처음에는 'struct'을(를) 사용하여 형식 이름을 표시했는데 이제는 'class'을(를) 사용하여 표시합니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Material.h(3,8): - 'Material' 선언을 참조하십시오. + pch.cpp +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Macro.h(50,1): warning C4067: 전처리기 지시문 다음에 예기치 않은 토큰이 있습니다. 줄 바꿈 문자가 필요합니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) + +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(135,14): error C3646: 'm_cbPerObject': 알 수 없는 재정의 지정자입니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) + +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(135,28): error C2059: 구문 오류: '=' + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Effect.cpp(31,26): warning C4267: '인수': 'size_t'에서 'UINT'(으)로 변환하면서 데이터가 손실될 수 있습니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(135,30): error C2334: '{' 앞에 예기치 않은 토큰이 있습니다. 명백한 함수 본문을 건너뜁니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\WindowsApp.cpp(34,33): warning C4302: '형식 캐스트': 'LPWSTR'에서 'WORD'(으)로 잘립니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(136,13): error C3646: 'm_cbPerFrame': 알 수 없는 재정의 지정자입니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\WindowsApp.cpp(114,24): warning C4244: '인수': 'const unsigned __int64'에서 'int'(으)로 변환하면서 데이터가 손실될 수 있습니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(136,26): error C2059: 구문 오류: '=' + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\WindowsApp.cpp(114,12): warning C4244: '인수': 'const unsigned __int64'에서 'int'(으)로 변환하면서 데이터가 손실될 수 있습니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.h(136,28): error C2334: '{' 앞에 예기치 않은 토큰이 있습니다. 명백한 함수 본문을 건너뜁니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Mesh.h(33,37): warning C4267: '=': 'size_t'에서 'UINT'(으)로 변환하면서 데이터가 손실될 수 있습니다. - (소스 파일 '/x64/Debug/unity_F3LWLJ6LKDGCHCCN.cpp'을(를) 컴파일하는 중) - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Mesh.h(33,37): - 템플릿 인스턴스화 컨텍스트(가장 오래된 인스턴스화 컨텍스트)가 - C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Renderer.cpp(216,8): - 컴파일되는 함수 템플릿 인스턴스화 'void Mesh::SetVertexBuffer(ID3D11Device *,const std::vector> &)'에 대한 참조를 확인하세요. +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Mesh.h(52,36): warning C4267: '=': 'size_t'에서 'UINT'(으)로 변환하면서 데이터가 손실될 수 있습니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) + +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Mesh.h(60,36): warning C4267: '=': 'size_t'에서 'uint32'(으)로 변환하면서 데이터가 손실될 수 있습니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) + +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Material.h(3,8): warning C4099: 'Material': 처음에는 'class'을(를) 사용하여 형식 이름을 표시했는데 이제는 'struct'을(를) 사용하여 표시합니다. + (소스 파일 'pch.cpp'을(를) 컴파일하는 중) + C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Material.h(3,8): + 'Material' 선언을 참조하십시오. -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\Renderer.h(204,1): warning C4715: 'Renderer::GetFeatureLevelToString': 모든 제어 경로에서 값을 반환하지는 않습니다. - MyD3DFramework.vcxproj -> C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\Binaries\Debug\MyD3DFramework.exe diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.command.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.command.1.tlog index b63a3e0..755c840 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.command.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.command.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.read.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.read.1.tlog index 57bcd81..dddb3b1 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.read.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.read.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.write.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.write.1.tlog index 784a078..13d1241 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.write.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CL.write.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/Cl.items.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/Cl.items.tlog index c524177..5722315 100644 --- a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/Cl.items.tlog +++ b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/Cl.items.tlog @@ -1,2 +1,2 @@ -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\pch.cpp;C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\x64\Debug\pch.obj -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\x64\Debug\unity_F3LWLJ6LKDGCHCCN.cpp;C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\x64\Debug\unity_F3LWLJ6LKDGCHCCN.obj +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\pch.cpp;C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\x64\Debug\pch.obj +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\x64\Debug\unity_584TQL3SWBXC8DRL.cpp;C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\x64\Debug\unity_584TQL3SWBXC8DRL.obj diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.read.1u.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.read.1u.tlog index d8ac584..5ab1cef 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.read.1u.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.read.1u.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.write.1u.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.write.1u.tlog index 0b53efd..f9adfc1 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.write.1u.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/CopyLocal.write.1u.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/GeneratedUnityFiles.txt b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/GeneratedUnityFiles.txt index f644e2b..e0d4bc1 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/GeneratedUnityFiles.txt and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/GeneratedUnityFiles.txt differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/MyD3DFramework.lastbuildstate b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/MyD3DFramework.lastbuildstate index 0eed505..7b6a01e 100644 --- a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/MyD3DFramework.lastbuildstate +++ b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/MyD3DFramework.lastbuildstate @@ -1,2 +1,2 @@ PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.22621.0: -Debug|x64|C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\| +Debug|x64|C:\Users\alsxm\Desktop\dev\MyDX3DFramework\| diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.command.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.command.1.tlog index c71a4d1..5e397d1 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.command.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.command.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.read.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.read.1.tlog index 3d79ad1..13f5bc9 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.read.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.read.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.write.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.write.1.tlog index fd0e87e..3448523 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.write.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/fxc.write.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.command.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.command.1.tlog index 86b8df3..a6c30b4 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.command.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.command.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.read.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.read.1.tlog index 0407093..395713a 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.read.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.read.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.secondary.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.secondary.1.tlog index e7aae7b..c54170c 100644 --- a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.secondary.1.tlog +++ b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.secondary.1.tlog @@ -1,2 +1,2 @@ -^C:\USERS\AJW01\DESKTOP\JIWOO\MYDX3DFRAMEWORK\DIRECTXTK\BIN\DESKTOP_2022\X64\DEBUG\DIRECTXTK.LIB|C:\USERS\AJW01\DESKTOP\JIWOO\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\MYD3DFRAMEWORK.RES|C:\USERS\AJW01\DESKTOP\JIWOO\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\PCH.OBJ|C:\USERS\AJW01\DESKTOP\JIWOO\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\UNITY_F3LWLJ6LKDGCHCCN.OBJ -C:\Users\ajw01\Desktop\Jiwoo\MyDX3DFramework\MyD3DFramework\x64\Debug\MyD3DFramework.ilk +^C:\USERS\ALSXM\DESKTOP\DEV\MYDX3DFRAMEWORK\DIRECTXTK\BIN\DESKTOP_2022\X64\DEBUG\DIRECTXTK.LIB|C:\USERS\ALSXM\DESKTOP\DEV\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\MYD3DFRAMEWORK.RES|C:\USERS\ALSXM\DESKTOP\DEV\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\PCH.OBJ|C:\USERS\ALSXM\DESKTOP\DEV\MYDX3DFRAMEWORK\MYD3DFRAMEWORK\X64\DEBUG\UNITY_584TQL3SWBXC8DRL.OBJ +C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\x64\Debug\MyD3DFramework.ilk diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.write.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.write.1.tlog index f5c9a48..1e4db42 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.write.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/link.write.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.command.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.command.1.tlog index 18a5797..0cb0f3f 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.command.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.command.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.read.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.read.1.tlog index 885acf8..1942fce 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.read.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.read.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.write.1.tlog b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.write.1.tlog index 764b988..36c0edc 100644 Binary files a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.write.1.tlog and b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/rc.write.1.tlog differ diff --git a/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/unsuccessfulbuild b/MyD3DFramework/x64/Debug/MyD3DFramework.tlog/unsuccessfulbuild new file mode 100644 index 0000000..e69de29 diff --git a/MyD3DFramework/x64/Debug/pch.obj b/MyD3DFramework/x64/Debug/pch.obj deleted file mode 100644 index 46f6131..0000000 Binary files a/MyD3DFramework/x64/Debug/pch.obj and /dev/null differ diff --git a/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.cpp b/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.cpp new file mode 100644 index 0000000..a5aaf8b --- /dev/null +++ b/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.cpp @@ -0,0 +1,121 @@ +#include "pch.h" + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Algorithm.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Array.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CameraObject.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CAttribute.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CBehavior.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\BufferPool.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CCamera.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CircularArray.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CKeyInput.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Component.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\ContantBuffers.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\DevScene.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Effect.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Engine.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\FastCompVector.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Font.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\GameObject.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\GameTimer.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\InputManager.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CLight.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Main.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Material.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Mesh.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CMeshRenderer.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Name.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Renderer.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\RenderState.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\ResourceManager.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Scene.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\SceneManager.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\ShaderIncludeHelper.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\SimpleMathAdv.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\SortedVector.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Structs.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\CTransform.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\TypeTrait.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\Vertex.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\WindowsApp.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\WindowsProc.cpp" + + +#include "C:\Users\alsxm\Desktop\dev\MyDX3DFramework\MyD3DFramework\WindowsUtile.cpp" + diff --git a/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.obj b/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.obj new file mode 100644 index 0000000..bda10e3 Binary files /dev/null and b/MyD3DFramework/x64/Debug/unity_584TQL3SWBXC8DRL.obj differ diff --git a/MyD3DFramework/x64/Debug/vc143.idb b/MyD3DFramework/x64/Debug/vc143.idb index 35cf62f..326149d 100644 Binary files a/MyD3DFramework/x64/Debug/vc143.idb and b/MyD3DFramework/x64/Debug/vc143.idb differ diff --git a/MyD3DFramework/x64/Debug/vc143.pdb b/MyD3DFramework/x64/Debug/vc143.pdb index ad4c676..fcbfb5b 100644 Binary files a/MyD3DFramework/x64/Debug/vc143.pdb and b/MyD3DFramework/x64/Debug/vc143.pdb differ