aboutsummaryrefslogtreecommitdiff
path: root/source/App.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-04-30 13:55:20 -0700
committerrtk0c <[email protected]>2022-04-30 13:55:20 -0700
commit453e1df6fb7a5847c8a5b26bd8479451091fb69d (patch)
treee0753be4c78535a3d2697c8b7be4123b76d2ad0d /source/App.cpp
parentac153a0a9463e3877fb0066e3603b6bf15fe6706 (diff)
Changeset: 20 Add ImGuizmo for GameObjects, start to make things actually render
Diffstat (limited to 'source/App.cpp')
-rw-r--r--source/App.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/App.cpp b/source/App.cpp
index dc38342..9c18fea 100644
--- a/source/App.cpp
+++ b/source/App.cpp
@@ -25,7 +25,7 @@ App::App() {
mGameCamera.SetHasPerspective(false);
mEditorCamera.Move(glm::vec3(0, 0, 1));
mEditorCamera.LookAt(glm::vec3(0, 0, 0));
- mGameCamera.SetHasPerspective(false);
+ mEditorCamera.SetHasPerspective(false);
}
App::~App() {
@@ -55,7 +55,7 @@ void App::SetEditorVisible(bool visible) {
mEditorVisible = visible;
if (visible) {
if (mEditor == nullptr) {
- mEditor = std::make_unique<EditorInstance>(this, &mWorld);
+ mEditor = std::make_unique<EditorInstance>(this);
}
}
}
@@ -70,6 +70,7 @@ void App::Show() {
void App::Update() {
if (IsGameRunning()) {
mWorld.Update();
+ mEditor->OnUpdate();
}
}
@@ -98,6 +99,8 @@ void App::Draw(float currentTime, float deltaTime) {
}
mRenderer.EndFrame();
+ // TODO pass camera info to editor without strong coupling to Renderer
+ mEditor->OnDraw(mRenderer.GetLastFrameInfo());
}
void App::HandleMouse(int button, int action) {