Skip to content

Commit e6842c9

Browse files
committed
GITechDemo:
* added controls to HUD when app starts * cosmetic modifications to code
1 parent 8a975d7 commit e6842c9

20 files changed

+63
-45
lines changed

GITechDemo/Code/AppMain/GITechDemo/GITechDemo.cpp

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,7 @@ void GITechDemo::Update(const float fDeltaTime)
324324
Vec3f(m_tCamera.mRot[0][0] * m_tCamera.vMoveVec[0], m_tCamera.mRot[0][1] * m_tCamera.vMoveVec[0], m_tCamera.mRot[0][2] * m_tCamera.vMoveVec[0]);
325325

326326
// Update mouse cursor
327-
if (cmd & APP_CMD_CTRL_PITCH ||
328-
cmd & APP_CMD_CTRL_YAW ||
329-
cmd & APP_CMD_CTRL_ROLL)
327+
if (cmd & (APP_CMD_CTRL_PITCH | APP_CMD_CTRL_YAW | APP_CMD_CTRL_ROLL))
330328
{
331329
int wLeft, wTop, wRight, wBottom;
332330
pFW->GetWindowArea(wLeft, wTop, wRight, wBottom);
@@ -434,6 +432,26 @@ void GITechDemo::Update(const float fDeltaTime)
434432
if (pAPM)
435433
pAPM->Update();
436434

435+
// Draw controls on HUD
436+
static bool bDrawControls = true;
437+
if(!pAPM->IsDrawingOnHUD() && bDrawControls)
438+
{
439+
HUD_PASS.PrintLn("Left mouse button (hold) + mouse move: control camera pitch/yaw");
440+
HUD_PASS.PrintLn("Right mouse button (hold) + mouse move: control camera roll");
441+
HUD_PASS.PrintLn("W/A/S/D: move camera forward/backward/left/right");
442+
HUD_PASS.PrintLn("LShift (hold): faster camera movement");
443+
HUD_PASS.PrintLn("LCtrl (hold): slower camera movement");
444+
445+
if (pAPM->GetParameterCount() > 0)
446+
{
447+
HUD_PASS.PrintLn("");
448+
HUD_PASS.PrintLn("Directional arrows up/down: cycle configurable parameters");
449+
HUD_PASS.PrintLn("Directional arrows left/right: modify currently selected parameter");
450+
}
451+
}
452+
if (cmd & (APP_CMD_FORWARD | APP_CMD_BACKWARD | APP_CMD_LEFT | APP_CMD_RIGHT))
453+
bDrawControls = false;
454+
437455
POP_PROFILE_MARKER();
438456
}
439457

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/AmbientOcclusionPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ AmbientOcclusionPass::AmbientOcclusionPass(const char* const passName, RenderPas
3030
AmbientOcclusionPass::~AmbientOcclusionPass()
3131
{}
3232

33-
void AmbientOcclusionPass::OnUpdate(const float fDeltaTime)
33+
void AmbientOcclusionPass::Update(const float fDeltaTime)
3434
{
3535
Renderer* RenderContext = Renderer::GetInstance();
3636
if (!RenderContext)
@@ -182,7 +182,7 @@ void AmbientOcclusionPass::ApplyAmbientOcclusion()
182182
POP_PROFILE_MARKER();
183183
}
184184

185-
void AmbientOcclusionPass::OnDraw()
185+
void AmbientOcclusionPass::Draw()
186186
{
187187
if (!AMBIENT_OCCLUSION_ENABLED)
188188
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/BloomPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ BloomPass::BloomPass(const char* const passName, RenderPass* const parentPass)
2626
BloomPass::~BloomPass()
2727
{}
2828

29-
void BloomPass::OnUpdate(const float fDeltaTime)
29+
void BloomPass::Update(const float fDeltaTime)
3030
{
3131
Renderer* RenderContext = Renderer::GetInstance();
3232
if (!RenderContext)
@@ -189,7 +189,7 @@ void BloomPass::BloomApply()
189189
POP_PROFILE_MARKER();
190190
}
191191

192-
void BloomPass::OnDraw()
192+
void BloomPass::Draw()
193193
{
194194
if (!BLOOM_ENABLED)
195195
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/DepthOfFieldPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DepthOfFieldPass::DepthOfFieldPass(const char* const passName, RenderPass* const
2828
DepthOfFieldPass::~DepthOfFieldPass()
2929
{}
3030

31-
void DepthOfFieldPass::OnUpdate(const float fDeltaTime)
31+
void DepthOfFieldPass::Update(const float fDeltaTime)
3232
{
3333
Renderer* RenderContext = Renderer::GetInstance();
3434
if (!RenderContext)
@@ -200,7 +200,7 @@ void DepthOfFieldPass::ApplyDoF()
200200
POP_PROFILE_MARKER();
201201
}
202202

203-
void DepthOfFieldPass::OnDraw()
203+
void DepthOfFieldPass::Draw()
204204
{
205205
if (!DOF_ENABLED)
206206
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/DirectionalIndirectLightPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ DirectionalIndirectLightPass::~DirectionalIndirectLightPass()
6262
delete[] f3RSMKernel;
6363
}
6464

65-
void DirectionalIndirectLightPass::OnUpdate(const float fDeltaTime)
65+
void DirectionalIndirectLightPass::Update(const float fDeltaTime)
6666
{
6767
Renderer* RenderContext = Renderer::GetInstance();
6868
if (!RenderContext)
@@ -84,7 +84,7 @@ void DirectionalIndirectLightPass::OnUpdate(const float fDeltaTime)
8484
texSource = IndirectLightAccumulationBuffer.GetRenderTarget()->GetColorBuffer(0);
8585
}
8686

87-
void DirectionalIndirectLightPass::OnDraw()
87+
void DirectionalIndirectLightPass::Draw()
8888
{
8989
if (!INDIRECT_LIGHT_ENABLED)
9090
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/DirectionalLightPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ DirectionalLightPass::~DirectionalLightPass()
5555
delete[] f2PoissonDisk;
5656
}
5757

58-
void DirectionalLightPass::OnUpdate(const float fDeltaTime)
58+
void DirectionalLightPass::Update(const float fDeltaTime)
5959
{
6060
f2HalfTexelOffset = Vec2f(0.5f / GBuffer.GetRenderTarget()->GetWidth(), 0.5f / GBuffer.GetRenderTarget()->GetHeight());
6161
texDiffuseBuffer = GBuffer.GetRenderTarget()->GetColorBuffer(0);
@@ -74,7 +74,7 @@ void DirectionalLightPass::OnUpdate(const float fDeltaTime)
7474
texEnvMap = EnvironmentTexture.GetTextureIndex();
7575
}
7676

77-
void DirectionalLightPass::OnDraw()
77+
void DirectionalLightPass::Draw()
7878
{
7979
if (!DIRECTIONAL_LIGHT_ENABLED)
8080
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/FXAAPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ FXAAPass::FXAAPass(const char* const passName, RenderPass* const parentPass)
2525
FXAAPass::~FXAAPass()
2626
{}
2727

28-
void FXAAPass::OnUpdate(const float fDeltaTime)
28+
void FXAAPass::Update(const float fDeltaTime)
2929
{
3030
Renderer* RenderContext = Renderer::GetInstance();
3131
if (!RenderContext)
@@ -46,7 +46,7 @@ void FXAAPass::OnUpdate(const float fDeltaTime)
4646

4747
}
4848

49-
void FXAAPass::OnDraw()
49+
void FXAAPass::Draw()
5050
{
5151
if (!FXAA_ENABLED)
5252
return;

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/GBufferPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ GBufferPass::GBufferPass(const char* const passName, RenderPass* const parentPas
2727
GBufferPass::~GBufferPass()
2828
{}
2929

30-
void GBufferPass::OnUpdate(const float fDeltaTime)
30+
void GBufferPass::Update(const float fDeltaTime)
3131
{
3232
Renderer* RenderContext = Renderer::GetInstance();
3333
if (!RenderContext)
@@ -45,7 +45,7 @@ void GBufferPass::OnUpdate(const float fDeltaTime)
4545
f44WorldViewProjMat = f44ProjMat * f44WorldViewMat;
4646
}
4747

48-
void GBufferPass::OnDraw()
48+
void GBufferPass::Draw()
4949
{
5050
Renderer* RenderContext = Renderer::GetInstance();
5151
if (!RenderContext)

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/HDRDownsamplePass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ HDRDownsamplePass::HDRDownsamplePass(const char* const passName, RenderPass* con
1919
HDRDownsamplePass::~HDRDownsamplePass()
2020
{}
2121

22-
void HDRDownsamplePass::OnUpdate(const float fDeltaTime)
22+
void HDRDownsamplePass::Update(const float fDeltaTime)
2323
{
2424
Renderer* RenderContext = Renderer::GetInstance();
2525
if (!RenderContext)
@@ -65,7 +65,7 @@ void HDRDownsamplePass::DownsamplePass(GITechDemoApp::RenderTarget* const pSourc
6565
pDest->Disable();
6666
}
6767

68-
void HDRDownsamplePass::OnDraw()
68+
void HDRDownsamplePass::Draw()
6969
{
7070
Renderer* RenderContext = Renderer::GetInstance();
7171
if (!RenderContext)

GITechDemo/Code/AppMain/GITechDemo/RenderScheme/HDRToneMappingPass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ HDRToneMappingPass::HDRToneMappingPass(const char* const passName, RenderPass* c
2424
HDRToneMappingPass::~HDRToneMappingPass()
2525
{}
2626

27-
void HDRToneMappingPass::OnUpdate(const float fDeltaTime)
27+
void HDRToneMappingPass::Update(const float fDeltaTime)
2828
{
2929
Renderer* RenderContext = Renderer::GetInstance();
3030
if (!RenderContext)
@@ -182,7 +182,7 @@ void HDRToneMappingPass::ToneMappingPass()
182182
POP_PROFILE_MARKER();
183183
}
184184

185-
void HDRToneMappingPass::OnDraw()
185+
void HDRToneMappingPass::Draw()
186186
{
187187
LuminanceMeasurementPass();
188188
LuminanceAdaptationPass();

0 commit comments

Comments
 (0)