Skip to content

Commit

Permalink
c++ stuff fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
choi303 committed Jun 20, 2021
1 parent f2010d5 commit aa52541
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Citrus/Blur.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ void Blur::Draw()
pVS.Bind(pContext.Get());
pPS.Bind(pContext.Get());
//bind c buffer
pBlurCBuffer->data.screenWidth = width;
pBlurCBuffer->data.screenHeight = height;
pBlurCBuffer->data.screenWidth = static_cast<float>(width);
pBlurCBuffer->data.screenHeight = static_cast<float>(height);
pBlurCBuffer->MapData();
pBlurCBuffer->VSBind(pContext.Get(), 1u, 1u);
}
1 change: 0 additions & 1 deletion Citrus/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ bool Graphics::InitScene()
pPointLight.Init(pDevice.Get(), pContext.Get());
pObject.Init(pDevice.Get(), pContext.Get(), "Models\\sponza\\sponza.obj", width, height, true);
pSkyBox.Init(pDevice.Get(), pContext.Get());
pObject.GetMesh()->SetScale(0.1f, 0.1f, 0.1f);

return true;
}
Expand Down
10 changes: 5 additions & 5 deletions Citrus/Graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ class Graphics
{
public:
Graphics() {}
Graphics(const Graphics&) {}
~Graphics() {}
bool InitializeGraphics(HWND hwnd, const int width, const int height);
bool InitDxBase(HWND hwnd);
bool InitScene();
Graphics(Graphics&) = delete;
~Graphics() {}
public:
void BeginFrame() const noexcept;
void EndFrame() const noexcept;
Expand All @@ -22,9 +22,9 @@ class Graphics
GameObject pObject;
CPUInfo pCPU;
PointLight pPointLight;
protected:
Microsoft::WRL::ComPtr<ID3D11Device> pDevice = nullptr;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> pContext = nullptr;
public:
Microsoft::WRL::ComPtr<ID3D11Device> pDevice;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> pContext;
Microsoft::WRL::ComPtr<IDXGISwapChain> pChain = nullptr;
Microsoft::WRL::ComPtr<ID3D11RenderTargetView> pRtv = nullptr;
Microsoft::WRL::ComPtr<ID3D11DepthStencilView> pDSV = nullptr;
Expand Down
8 changes: 8 additions & 0 deletions Citrus/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ XMFLOAT3 Model::AdjustPos(float x, float y, float z)
return pos;
}

XMFLOAT3 Model::AdjustRot(float roll, float pitch, float yaw)
{
rot.x += roll;
rot.y += pitch;
rot.z += yaw;
return rot;
}

XMFLOAT3 Model::SetRot(const float x, const float y, const float z)
{
rot.x = x;
Expand Down
1 change: 1 addition & 0 deletions Citrus/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Model
void Render(const Camera3D cam);
XMFLOAT3 SetPos(const float x, const float y, const float z);
XMFLOAT3 AdjustPos(float x, float y, float z);
XMFLOAT3 AdjustRot(float roll, float pitch, float yaw);
XMFLOAT3 SetRot(const float x, const float y, const float z);
XMFLOAT3 SetScale(const float x, const float y, const float z);
XMFLOAT3 GetPos() const;
Expand Down
2 changes: 1 addition & 1 deletion Citrus/UI.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include "Model.h"
#include <DirectXMath.h>
using namespace DirectX;

class UI
{
public:
Expand Down

0 comments on commit aa52541

Please sign in to comment.