[Add] MouseCursor, Mission 마우스 커서 비슷하게 변경 및 이미지 띄우기

This commit is contained in:
fbtk
2025-11-07 22:01:52 +09:00
parent 2e797da356
commit 9e61d2f159
102 changed files with 925 additions and 14 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

@@ -156,11 +156,14 @@
<ClInclude Include="..\Public\Editor_Define.h" />
<ClInclude Include="..\Public\Editor_Macro.h" />
<ClInclude Include="..\Public\Editor_Struct.h" />
<ClInclude Include="..\public\Mission.h" />
<ClInclude Include="..\Public\Level_Loading.h" />
<ClInclude Include="..\Public\Level_Logo.h" />
<ClInclude Include="..\public\Level_UI.h" />
<ClInclude Include="..\Public\Level_ObjectViewer.h" />
<ClInclude Include="..\Public\Loader.h" />
<ClInclude Include="..\Public\MainApp.h" />
<ClInclude Include="..\public\Mouse_Cursor.h" />
<ClInclude Include="Editor.h" />
<ClInclude Include="framework.h" />
<ClInclude Include="Resource.h" />
@@ -171,11 +174,14 @@
<ClCompile Include="..\Private\DummyRect.cpp" />
<ClCompile Include="..\Private\Dummy_Cube.cpp" />
<ClCompile Include="..\Private\Dummy_Goblin.cpp" />
<ClCompile Include="..\private\Mission.cpp" />
<ClCompile Include="..\Private\Level_Loading.cpp" />
<ClCompile Include="..\Private\Level_Logo.cpp" />
<ClCompile Include="..\private\Level_UI.cpp" />
<ClCompile Include="..\Private\Level_ObjectViewer.cpp" />
<ClCompile Include="..\Private\Loader.cpp" />
<ClCompile Include="..\Private\MainApp.cpp" />
<ClCompile Include="..\private\Mouse_Cursor.cpp" />
<ClCompile Include="..\Private\pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
@@ -61,6 +61,18 @@
<Filter Include="02.GameObjects\Dummys\DummyRect">
<UniqueIdentifier>{130c848e-6ab6-4b45-b12c-56db07e2c2f4}</UniqueIdentifier>
</Filter>
<Filter Include="01.Level\50.UIViewer">
<UniqueIdentifier>{6ef26778-6dfa-4880-807e-ad5306a3c26c}</UniqueIdentifier>
</Filter>
<Filter Include="50.UI">
<UniqueIdentifier>{627570ac-7129-4888-bdd1-467149dbcf35}</UniqueIdentifier>
</Filter>
<Filter Include="50.UI\Mission">
<UniqueIdentifier>{b652ee5a-69ca-4c85-8c6c-def398a4dd23}</UniqueIdentifier>
</Filter>
<Filter Include="50.UI\Mouse_Cursor">
<UniqueIdentifier>{b5d188ff-5925-40bd-8da4-2ed00c89f730}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Dummy_Goblin">
<UniqueIdentifier>{0ebb9c08-69b0-49b6-bac3-c827ca13319a}</UniqueIdentifier>
</Filter>
@@ -105,6 +117,15 @@
<ClInclude Include="..\Public\DummyRect.h">
<Filter>02.GameObjects\Dummys\DummyRect</Filter>
</ClInclude>
<ClInclude Include="..\public\Level_UI.h">
<Filter>01.Level\50.UIViewer</Filter>
</ClInclude>
<ClInclude Include="..\public\Mission.h">
<Filter>50.UI\Mission</Filter>
</ClInclude>
<ClInclude Include="..\public\Mouse_Cursor.h">
<Filter>50.UI\Mouse_Cursor</Filter>
</ClInclude>
<ClInclude Include="..\Public\Dummy_Goblin.h">
<Filter>02.GameObjects\Dummy_Goblin</Filter>
</ClInclude>
@@ -148,6 +169,15 @@
<ClCompile Include="..\Private\DummyRect.cpp">
<Filter>02.GameObjects\Dummys\DummyRect</Filter>
</ClCompile>
<ClCompile Include="..\private\Level_UI.cpp">
<Filter>01.Level\50.UIViewer</Filter>
</ClCompile>
<ClCompile Include="..\private\Mission.cpp">
<Filter>50.UI\Mission</Filter>
</ClCompile>
<ClCompile Include="..\private\Mouse_Cursor.cpp">
<Filter>50.UI\Mouse_Cursor</Filter>
</ClCompile>
<ClCompile Include="..\Private\Dummy_Goblin.cpp">
<Filter>02.GameObjects\Dummy_Goblin</Filter>
</ClCompile>
@@ -4,6 +4,7 @@
#include "GameInstance.h"
#include "Level_Logo.h"
#include "Level_UI.h"
#include "Level_ObjectViewer.h"
CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
@@ -39,6 +40,9 @@ void CLevel_Loading::Update(_float fTimeDelta)
case LEVEL::LOGO:
pNewLevel = CLevel_Logo::Create(m_pDevice, m_pContext, m_eNextLevelID);
break;
case LEVEL::UI:
pNewLevel = CLevel_UI::Create(m_pDevice, m_pContext, m_eNextLevelID);
break;
//case LEVEL::MAP:
// pNewLevel = CLevel_MapViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
// break;
@@ -21,6 +21,12 @@ HRESULT CLevel_Logo::Initialize()
void CLevel_Logo::Update(_float fTimeDelta)
{
if (m_pGameInstance->Key_Down(DIK_I))
{
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::UI))))
return;
}
GUI::Begin("SelectEditor");
//if (GUI::Button("Map Editor", { 100, 100 })) {
// if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::MAP))))
@@ -0,0 +1,85 @@
#include "pch.h"
#include "Level_UI.h"
#include "GameInstance.h"
#include "Level_Loading.h"
#include "DummyRect.h"
#include "Mission.h"
#include "Mouse_Cursor.h"
CLevel_UI::CLevel_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
{
}
HRESULT CLevel_UI::Initialize()
{
if (FAILED(Ready_Layer_UI(LAYER_BACKGROUND))) {
return E_FAIL;
}
if (FAILED(Ready_Layer_Cursor(LAYER_UI))) {
return E_FAIL;
}
return S_OK;
}
void CLevel_UI::Update(_float fTimeDelta)
{
GUI::Begin("SelectEditor");
GUI::End();
}
HRESULT CLevel_UI::Render()
{
SetWindowText(g_hWnd, TEXT("UI·¹º§ÀÔ´Ï´Ù."));
GUI::ShowDemoWindow();
return S_OK;
}
HRESULT CLevel_UI::Ready_Layer_Camera(const _wstring& strLayerTag)
{
return S_OK;
}
HRESULT CLevel_UI::Ready_Layer_UI(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
{
return E_FAIL;
}
return S_OK;
}
HRESULT CLevel_UI::Ready_Layer_Cursor(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMouse_Cursor>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
{
return E_FAIL;
}
return S_OK;
}
CLevel_UI* CLevel_UI::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
{
CLevel_UI* pInstance = new CLevel_UI(pDevice, pContext, eLevelID);
if (FAILED(pInstance->Initialize()))
{
MSG_BOX("Failed to Created : CLevel_UI");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CLevel_UI::Free()
{
__super::Free();
}
+57 -12
View File
@@ -4,6 +4,8 @@
#include "GameInstance.h"
#include "DummyRect.h"
#include "MainApp.h"
#include "Mission.h"
#include "Mouse_Cursor.h"
#include "Dummy_Goblin.h"
#include "Dummy_Cube.h"
@@ -58,6 +60,12 @@ HRESULT CLoader::Loading()
case LEVEL::LOGO:
hr = Loading_For_Logo();
break;
case LEVEL::UI:
hr = Loading_For_UI();
break;
//case LEVEL::MAP:
// hr = Loading_For_MapViewer();
// break;
@@ -96,16 +104,16 @@ void CLoader::Output()
HRESULT CLoader::Loading_For_Logo()
{
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Dororong"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/DororongDoro.png"), TEXT("Dororong"), 0)))){
return E_FAIL;
}
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_POSTEX,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl"),
@@ -143,7 +151,7 @@ HRESULT CLoader::Loading_For_Logo()
return E_FAIL;
}
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Prototype<CDummyRect>(g_iStaticLevel, CDummyRect::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
@@ -152,7 +160,44 @@ HRESULT CLoader::Loading_For_Logo()
if (FAILED(m_pGameInstance->Add_Prototype<CDebugCamera>(g_iStaticLevel, CDebugCamera::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_isFinished = true;
return S_OK;
}
HRESULT CLoader::Loading_For_UI()
{
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Keyboard"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Keyboard/Keyboard_%d.png"), TEXT("Keyboard"), 10)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.png"), TEXT("Cursor"), 0)))) {
return E_FAIL;
}
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Prototype<CMission>(g_iStaticLevel, CMission::Create(m_pDevice, m_pContext))))
{
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMouse_Cursor>(g_iStaticLevel, CMouse_Cursor::Create(m_pDevice, m_pContext))))
{
return E_FAIL;
}
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_isFinished = true;
@@ -161,9 +206,9 @@ HRESULT CLoader::Loading_For_Logo()
HRESULT CLoader::Loading_For_ObjectViewer()
{
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"),
CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinBody.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0))))
@@ -173,11 +218,11 @@ HRESULT CLoader::Loading_For_ObjectViewer()
CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Box/Box.fbx", MODEL::NONANIM, XMMatrixIdentity(), 0))))
return E_FAIL;
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
/* For.Prototype_GameObject_Dummy_Goblin */
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Goblin>(g_iStaticLevel, CDummy_Goblin::Create(m_pDevice, m_pContext))))
@@ -187,9 +232,9 @@ HRESULT CLoader::Loading_For_ObjectViewer()
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext))))
return E_FAIL;
m_strMessage = TEXT("정보를 불러오는 중입니다.");
m_strMessage = TEXT("정보를 불러오는 중입니다.");
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_isFinished = true;
+162
View File
@@ -0,0 +1,162 @@
#include "pch.h"
#include "Mission.h"
#include "GameInstance.h"
CMission::CMission(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CUIObject(pDevice, pContext)
{
}
CMission::CMission(const CMission& rhs)
:CUIObject(rhs)
{
}
HRESULT CMission::Initialize_Prototype()
{
return S_OK;
}
HRESULT CMission::Initialize(void* pArg)
{
CUIObject::UIOBJECT_DESC Desc{};
Desc.fX = 0.f;
Desc.fY = 0.f;
Desc.fSizeX = 300.f;
Desc.fSizeY = 300.f;
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
if (FAILED(__super::Initialize(&Desc)))
{
return E_FAIL;
}
if (FAILED(Ready_Components(pArg)))
{
return E_FAIL;
}
return S_OK;
}
void CMission::Priority_Update(_float fTimeDelta)
{
}
void CMission::Update(_float fTimeDelta)
{
}
void CMission::Late_Update(_float fTimeDelta)
{
if (m_bVisible) {
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
}
}
HRESULT CMission::Render()
{
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::UI)))) {
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Render())) {
return E_FAIL;
}
return S_OK;
}
_vector CMission::Get_WorldPostion()
{
return m_pTransformCom->Get_State(STATE::POSITION);
}
HRESULT CMission::Bind_ShaderResources()
{
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float))))
{
return E_FAIL;
}
return S_OK;
}
HRESULT CMission::Ready_Components(void* pArg)
{
if (FAILED(Add_Component<CVIBuffer_Rect>(g_iStaticLevel, &m_pVIBufferCom)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Keyboard"), reinterpret_cast<CComponent**>(&m_pTextureCom), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
{
return E_FAIL;
}
return S_OK;
}
CMission* CMission::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CMission* pInstance = new CMission(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CMission");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CMission::Clone(void* pArg, CGameObject* pOwner)
{
CMission* pInstance = new CMission(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMission");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CMission::Free()
{
__super::Free();
SAFE_RELEASE(m_pTextureCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pVIBufferCom);
}
void CMission::Describe_Entity()
{
}
@@ -0,0 +1,169 @@
#include "pch.h"
#include "Mouse_Cursor.h"
#include "GameInstance.h"
CMouse_Cursor::CMouse_Cursor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CUIObject(pDevice, pContext)
{
}
CMouse_Cursor::CMouse_Cursor(const CMouse_Cursor& rhs)
:CUIObject(rhs)
{
}
HRESULT CMouse_Cursor::Initialize_Prototype()
{
return S_OK;
}
HRESULT CMouse_Cursor::Initialize(void* pArg)
{
CUIObject::UIOBJECT_DESC Desc{};
Desc.fX = 0.f;
Desc.fY = 0.f;
Desc.fSizeX = 50.f;
Desc.fSizeY = 50.f;
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
if (FAILED(__super::Initialize(&Desc)))
{
return E_FAIL;
}
if (FAILED(Ready_Components(pArg)))
{
return E_FAIL;
}
return S_OK;
}
void CMouse_Cursor::Priority_Update(_float fTimeDelta)
{
}
void CMouse_Cursor::Update(_float fTimeDelta)
{
ShowCursor(false);
}
void CMouse_Cursor::Late_Update(_float fTimeDelta)
{
if (m_bVisible) {
POINT m_pPt{};
GetCursorPos(&m_pPt);
ScreenToClient(g_hWnd, &m_pPt);
_vector MousePos = XMVectorSet(static_cast<_float>(m_pPt.x - m_fWinSizeX * 0.5), static_cast<_float>(-m_pPt.y + m_fWinSizeY * 0.5), 0.f, 1.f);
m_pTransformCom->Set_State(STATE::POSITION, MousePos);
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
}
}
HRESULT CMouse_Cursor::Render()
{
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::UI)))) {
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Render())) {
return E_FAIL;
}
return S_OK;
}
_vector CMouse_Cursor::Get_WorldPostion()
{
return m_pTransformCom->Get_State(STATE::POSITION);
}
HRESULT CMouse_Cursor::Bind_ShaderResources()
{
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float))))
{
return E_FAIL;
}
return S_OK;
}
HRESULT CMouse_Cursor::Ready_Components(void* pArg)
{
if (FAILED(Add_Component<CVIBuffer_Rect>(g_iStaticLevel, &m_pVIBufferCom)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Cursor"), reinterpret_cast<CComponent**>(&m_pTextureCom), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
{
return E_FAIL;
}
return S_OK;
}
CMouse_Cursor* CMouse_Cursor::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CMouse_Cursor* pInstance = new CMouse_Cursor(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CMouse_Cursor");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CMouse_Cursor::Clone(void* pArg, CGameObject* pOwner)
{
CMouse_Cursor* pInstance = new CMouse_Cursor(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMouse_Cursor");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CMouse_Cursor::Free()
{
__super::Free();
SAFE_RELEASE(m_pTextureCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pVIBufferCom);
}
void CMouse_Cursor::Describe_Entity()
{
}
@@ -11,7 +11,7 @@ namespace Editor
const unsigned int g_iWinSizeX = 1920;
const unsigned int g_iWinSizeY = 1080;
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,END };
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,UI,END };
enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END };
enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END };
+31
View File
@@ -0,0 +1,31 @@
#pragma once
#include "Editor_Define.h"
#include "Level.h"
NS_BEGIN(Editor)
class CLevel_UI final : public CLevel
{
private:
CLevel_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
virtual ~CLevel_UI() = default;
public:
virtual void Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
private:
/* 이 레벨에서 쓰기위한 객체들을 생성한다. */
virtual HRESULT Initialize() override;
HRESULT Ready_Layer_Camera(const _wstring& strLayerTag);
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
HRESULT Ready_Layer_Cursor(const _wstring& strLayerTag);
public:
static CLevel_UI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
virtual void Free() override;
};
NS_END
+1
View File
@@ -42,6 +42,7 @@ class CLoader final : public CBase
HRESULT Initialize(LEVEL eNextLevelID);
HRESULT Loading_For_Logo();
HRESULT Loading_For_ObjectViewer();
HRESULT Loading_For_UI();
public:
static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID);
+41
View File
@@ -0,0 +1,41 @@
#pragma once
#include "Editor_Define.h"
#include "UIObject.h"
NS_BEGIN(Editor)
class CMission final : public CUIObject
{
private:
CMission(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMission(const CMission& rhs);
virtual ~CMission() = default;
public:
virtual void Priority_Update(_float fTimeDelta);
virtual void Update(_float fTimeDelta);
virtual void Late_Update(_float fTimeDelta);
virtual HRESULT Render() override;
virtual _vector Get_WorldPostion() override;
private:
virtual HRESULT Bind_ShaderResources() override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
private:
CTexture* m_pTextureCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
public:
static CMission* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
};
NS_END
@@ -0,0 +1,42 @@
#pragma once
#include "Editor_Define.h"
#include "UIObject.h"
NS_BEGIN(Editor)
class CMouse_Cursor final : public CUIObject
{
private:
CMouse_Cursor(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMouse_Cursor(const CMouse_Cursor& rhs);
virtual ~CMouse_Cursor() = default;
public:
virtual void Priority_Update(_float fTimeDelta);
virtual void Update(_float fTimeDelta);
virtual void Late_Update(_float fTimeDelta);
virtual HRESULT Render() override;
virtual _vector Get_WorldPostion() override;
private:
virtual HRESULT Bind_ShaderResources() override;
virtual HRESULT Ready_Components(void* pArg) override;
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
private:
CTexture* m_pTextureCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
public:
static CMouse_Cursor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
};
NS_END
@@ -260,6 +260,8 @@
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="..\Private\Transform.cpp" />
<ClCompile Include="..\private\UIComponent.cpp" />
<ClCompile Include="..\private\UIObject.cpp" />
<ClCompile Include="..\Private\VIBuffer.cpp" />
<ClCompile Include="..\Private\VIBuffer_Cell.cpp" />
<ClCompile Include="..\Private\VIBuffer_Cube.cpp" />
@@ -457,6 +459,8 @@
<ClInclude Include="..\Public\Timer_Manager.h" />
<ClInclude Include="..\Public\tinyxml2.h" />
<ClInclude Include="..\Public\Transform.h" />
<ClInclude Include="..\public\UIComponent.h" />
<ClInclude Include="..\public\UIObject.h" />
<ClInclude Include="..\Public\VIBuffer.h" />
<ClInclude Include="..\Public\VIBuffer_Cell.h" />
<ClInclude Include="..\Public\VIBuffer_Cube.h" />
@@ -214,6 +214,12 @@
<Filter Include="02.Element\02.Component\02.VIBuffer\Cube">
<UniqueIdentifier>{be0d499e-e4cf-4dde-92a0-a0904e713045}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\50.UI">
<UniqueIdentifier>{41e9427d-6e3b-4424-b2d0-0496a0a875af}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\01.GameObject\50.UI">
<UniqueIdentifier>{32546fa5-8ee9-4c26-8d48-7ef2b2d023b0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Base.cpp">
@@ -390,6 +396,12 @@
<ClCompile Include="..\Private\VIBuffer_Cube.cpp">
<Filter>02.Element\02.Component\02.VIBuffer\Cube</Filter>
</ClCompile>
<ClCompile Include="..\private\UIComponent.cpp">
<Filter>02.Element\02.Component\50.UI</Filter>
</ClCompile>
<ClCompile Include="..\private\UIObject.cpp">
<Filter>02.Element\01.GameObject\50.UI</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Public\Base.h">
@@ -932,6 +944,12 @@
<ClInclude Include="..\Public\VIBuffer_Cube.h">
<Filter>02.Element\02.Component\02.VIBuffer\Cube</Filter>
</ClInclude>
<ClInclude Include="..\public\UIComponent.h">
<Filter>02.Element\02.Component\50.UI</Filter>
</ClInclude>
<ClInclude Include="..\public\UIObject.h">
<Filter>02.Element\01.GameObject\50.UI</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\Public\Assimp\color4.inl">
@@ -62,7 +62,6 @@ _vector CPartObject::Get_WorldPostion()
return m_pOwner->Get_WorldPostion();
}
void CPartObject::Free()
{
__super::Free();
@@ -0,0 +1,57 @@
#include "pch.h"
#include "UIComponent.h"
CUIComponent ::CUIComponent(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CComponent{ pDevice, pContext }
{
}
CUIComponent::CUIComponent(const CUIComponent& rhs)
: CComponent(rhs)
{
}
HRESULT CUIComponent::Initialize_Prototype()
{
return S_OK;
}
HRESULT CUIComponent::Initialize(void* pArg)
{
return S_OK;
}
CUIComponent* CUIComponent::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CUIComponent* pInstance = new CUIComponent(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CUIComponent");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CComponent* CUIComponent::Clone(void* pArg, class CGameObject* pOwner)
{
CUIComponent* pInstance = new CUIComponent(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CUIComponent");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CUIComponent::Free()
{
__super::Free();
}
void CUIComponent::Describe_Entity()
{
}
+118
View File
@@ -0,0 +1,118 @@
#include "pch.h"
#include "UIObject.h"
CUIObject::CUIObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject{ pDevice, pContext }
{
}
CUIObject::CUIObject(const CUIObject& rhs)
: CGameObject(rhs)
{
}
HRESULT CUIObject::Initialize_Prototype()
{
return S_OK;
}
HRESULT CUIObject::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
{
return E_FAIL;
}
if (FAILED(__super::Ready_Components(pArg)))
{
return E_FAIL;
}
// 투영 행렬릉 하기 위해서 일단 뷰 포트를 받아온다.
D3D11_VIEWPORT ViewportDesc{};
// 그리고 설정할 뷰 포트의 개수를 선언 해준다.
_uint iNumViewports = { 1 };
// 이제 뷰포트의 개수랑 정보를 저장할 포인터를 넣어준다.
m_pContext->RSGetViewports(&iNumViewports, &ViewportDesc);
// 이제 받아온 fX,fY,fSizeX,fSizeY를 다 저장 해 놓는다.
UIOBJECT_DESC* pDesc = static_cast<UIOBJECT_DESC*>(pArg);
m_fX = pDesc->fX;
m_fY = pDesc->fY;
m_fSizeX = pDesc->fSizeX;
m_fSizeY = pDesc->fSizeY;
m_fWinSizeX = ViewportDesc.Width;
m_fWinSizeY = ViewportDesc.Height;
// 설정을 해준 구조체를 바탕으로 사이즈를 설정 해준다.
// 사이즈를 설정 했으면 이제 위치도 잡아준다.
// 먼저 Position을 세팅 해주기 위해서 가로를 반으로 갈라서 fx를 뺀다.
// 그 후에 세로를 반으로 갈라서 fy랑 더해주는데 왜 이친구는 -인가?
// DX의 중점은 정 중앙이다 그래서 지금이렇게 계산하는 이유는 화면 중앙이 0,0이다
// 그러면 이제 위치를 잡을 때 화면 중앙을 기준으로 왼쪽에 배치를 하고 싶으면
// 이제 값을 -로 해주고 위에 배치하려면 또 -를 해야해서 계산하는게 복잡하다.
// 그래서 이제 계산하기 편하게 하기 위에서 중점을 우상단 api처럼 좌표계를 바꿔주기 위해
// x는 api랑 같이 왼쪽이 - 오른쪽이 +이다. 하지만 DX는 위쪽이 +인데 api는 위로
// 올라가면 -고 내려가면 +이다. 그래서 이거를 바꿔주기 위해서 -를 해주고 화면의 절반을
// +로 해준다. 그리고 z값은 이제 렌더링을 할 때 깊이 버퍼르 0~1사이에 있는 친구들만
// 그려 주는데 이제 UI는 화면 제일 앞에 있어야 해서 z값을 0으로 해준다.
// 그리고 w값은 1을 줬는데 1을 줘야 x,y,z값이 계산이 되는데 만약 0을 준다면
// 계산이 안되서 1로 준다. 만약 2나 3으로 주면 1이 원본 크기인데 2면 절반 3이면
// 1/3만큼 줄어든다. 그래서 1을 주면 원래 크기대로 나온다.
/* 뷰스페이스 상에 네모를 어떻게 배치시킬건지를 설정하는거다. */
vScale = _float3(m_fSizeX, m_fSizeY, 1.f);
m_pTransformCom->Set_Scale(vScale);
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(
pDesc->fX - ViewportDesc.Width * 0.5f, -
pDesc->fY + ViewportDesc.Height * 0.5f,
0.f, 1.f));
// 직교 투영을 하기 위해서 먼저 뷰 행렬을 항등 행렬로 바꿔준다.
XMStoreFloat4x4(&m_ViewMatrix, XMMatrixIdentity());
// 이제 투영 행렬을 직교 투영 행렬로 바꿔 주는데 화면의 사이즈를 받고 near 0 far 1로
// 설정을 한다.
XMStoreFloat4x4(&m_ProjMatrix, XMMatrixOrthographicLH(ViewportDesc.Width,ViewportDesc.Height, 0.f, 1.f));
m_bVisible = true;
return S_OK;
}
void CUIObject::Priority_Update(_float fTimeDelta)
{
CTransform* pOwnerTransform = m_pOwner->Get_Component<CTransform>();
}
void CUIObject::Update(_float fTimeDelta)
{
}
void CUIObject::Late_Update(_float fTimeDelta)
{
}
HRESULT CUIObject::Render()
{
return S_OK;
}
HRESULT CUIObject::Ready_Components(void* pArg)
{
__super::Ready_Components(pArg);
return S_OK;
}
_vector CUIObject::Get_WorldPostion()
{
return m_pOwner->Get_WorldPostion();
}
void CUIObject::Free()
{
__super::Free();
}

Some files were not shown because too many files have changed in this diff Show More