-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9665ec
commit 85737aa
Showing
13 changed files
with
198 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,40 @@ | ||
#include "properties_editor.h" | ||
|
||
ObjectPropertiesEditor::ObjectPropertiesEditor(std::function<void()> renderCb) | ||
: m_renderCb(renderCb) | ||
{ | ||
} | ||
|
||
void ObjectPropertiesEditor::Render() | ||
{ | ||
if (ImGui::BeginTabItem("Object Properties")) | ||
{ | ||
m_renderCb(); | ||
ImGui::EndTabItem(); | ||
} | ||
} | ||
: m_renderCb(renderCb) { | ||
} | ||
|
||
void ObjectPropertiesEditor::SetAdditionalRenderCallback( | ||
std::function<void()> renderCb) { | ||
m_additionalRenderCb = renderCb; | ||
} | ||
|
||
void ObjectPropertiesEditor::Render() { | ||
if (ImGui::BeginTabItem("Object Properties")) { | ||
m_renderCb(); | ||
m_additionalRenderCb(); | ||
ImGui::EndTabItem(); | ||
} | ||
} | ||
|
||
CameraPropertiesEditor::CameraPropertiesEditor(std::function<void()> renderCb) | ||
: m_renderCb(renderCb) { | ||
} | ||
|
||
void CameraPropertiesEditor::Render() { | ||
if (ImGui::BeginTabItem("Camera")) { | ||
m_renderCb(); | ||
ImGui::EndTabItem(); | ||
} | ||
} | ||
|
||
InputPropertiesEditor::InputPropertiesEditor(std::function<void()> renderCb) | ||
: m_renderCb(renderCb) { | ||
} | ||
|
||
void InputPropertiesEditor::Render() { | ||
if (ImGui::BeginTabItem("Input")) { | ||
m_renderCb(); | ||
ImGui::EndTabItem(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,41 @@ | ||
#pragma once | ||
|
||
#include <functional> | ||
#include <imgui.h> | ||
|
||
class BasePropertiesEditor | ||
{ | ||
virtual void Render(){}; | ||
#include <functional> | ||
|
||
class BasePropertiesEditor { | ||
virtual void Render(){}; | ||
}; | ||
|
||
class CameraPropertiesEditor : public BasePropertiesEditor | ||
{ | ||
CameraPropertiesEditor(); | ||
class CameraPropertiesEditor : public BasePropertiesEditor { | ||
private: | ||
std::function<void()> m_renderCb; | ||
|
||
public: | ||
CameraPropertiesEditor(std::function<void()> renderCb); | ||
void Render(); | ||
}; | ||
|
||
class LightPropertiesEditor : public BasePropertiesEditor | ||
{ | ||
class LightPropertiesEditor : public BasePropertiesEditor {}; | ||
|
||
class ObjectPropertiesEditor : public BasePropertiesEditor { | ||
private: | ||
// TODO: Having issues with reference here | ||
std::function<void()> m_renderCb; | ||
std::function<void()> m_additionalRenderCb = []() {}; | ||
|
||
public: | ||
ObjectPropertiesEditor(std::function<void()> renderCb); | ||
void SetAdditionalRenderCallback(std::function<void()> renderCb); | ||
void Render(); | ||
}; | ||
|
||
class ObjectPropertiesEditor : public BasePropertiesEditor | ||
{ | ||
class InputPropertiesEditor : public BasePropertiesEditor { | ||
private: | ||
// TODO: Having issues with reference here | ||
std::function<void()> m_renderCb; | ||
std::function<void()> m_renderCb; | ||
|
||
public: | ||
ObjectPropertiesEditor(std::function<void()> renderCb); | ||
void Render(); | ||
InputPropertiesEditor(std::function<void()> renderCb); | ||
void Render(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.