87 lines
2.0 KiB
C++
87 lines
2.0 KiB
C++
#include "GUI.h"
|
|
|
|
|
|
void SceneExplorer(const std::string& PanelName) {
|
|
ImGui::Begin(PanelName.c_str());
|
|
//if (ImGui::ListBoxHeader("##ObjectList")) {
|
|
//Node& current = scene.GetRoot();
|
|
|
|
//Node* next = ¤t;
|
|
|
|
// Show first node
|
|
//ImGui::Selectable(next->name.c_str(), true);
|
|
// ImGui::Selectable("Scene Node", true);
|
|
// ImGui::Indent();
|
|
|
|
/*
|
|
|
|
if (next->children.size() != 0) {
|
|
for (auto child : next->children)
|
|
{
|
|
std::string& name = child->name;
|
|
ImGui::Selectable(name.c_str(), false);
|
|
}
|
|
}
|
|
|
|
*/
|
|
|
|
// ImGui::ListBoxFooter();
|
|
// }
|
|
ImGui::End();
|
|
}
|
|
|
|
|
|
|
|
void CameraTool() {
|
|
static float Zoom = 0;
|
|
static glm::vec3 Position = glm::vec3(0.0f, 0.0f, 0.0f);
|
|
static glm::vec3 Rotation = glm::vec3(0.0f, 0.0f, 0.0f);
|
|
|
|
|
|
ImGui::Begin("Camera");
|
|
|
|
|
|
ImGui::SliderFloat("Zoom:", &Zoom, 10, 190);
|
|
|
|
ImGui::InputFloat3("Position:", &Position[0]);
|
|
|
|
ImGui::InputFloat3("Rotation:", &Rotation[0]);
|
|
|
|
ImGui::End();
|
|
}
|
|
|
|
void ScriptingTool(char* code) {
|
|
ImGui::Begin("Scripting");
|
|
|
|
ImGui::Text("Lua Code");
|
|
ImGui::InputTextMultiline("##", code, 255);
|
|
bool runCode = ImGui::Button("Run");
|
|
|
|
|
|
ImGui::End();
|
|
|
|
}
|
|
|
|
void SceneView(Framebuffer& framebuffer ) {
|
|
ImGui::Begin("Viewport");
|
|
ImGui::Image((void*)(intptr_t)framebuffer.GetColourAttachment(), ImVec2{800, 600});
|
|
ImGui::End();
|
|
}
|
|
|
|
/*
|
|
* void transformWindow(Transform& transform, std::string PanelName) {
|
|
ImGui::Begin(PanelName.c_str());
|
|
ImGui::InputFloat3("Position:", (float*)&transform.Position[0]);
|
|
ImGui::InputFloat3("Rotation:", (float*)&transform.Rotation[0]);
|
|
ImGui::InputFloat3("Scale:", (float*)&transform.Scale[0]);
|
|
ImGui::End();
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
void materialWindow(Material& material, std::string PanelName) {
|
|
ImGui::Begin(PanelName.c_str());
|
|
ImGui::ColorPicker3("Color:", &material.Color[0]);
|
|
ImGui::End();
|
|
} |