1
0
Fork 0
mirror of https://github.com/gwm17/Specter.git synced 2024-11-22 18:28:52 -05:00

Beginning development of UI

This commit is contained in:
Gordon McCann 2022-01-10 17:31:55 -05:00
parent 3f7ba739a4
commit 530d0bf8e3
4 changed files with 86 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#include "Application.h"
#include "Renderer/Renderer.h"
#include "Renderer/RenderCommand.h"
#include "Editor/EditorLayer.h"
namespace Navigator {
@ -14,7 +15,7 @@ namespace Navigator {
m_window = std::unique_ptr<Window>(Window::Create());
m_window->SetEventCallback(BIND_EVENT_FUNCTION(Application::OnEvent));
PushLayer(new Layer());
PushLayer(new EditorLayer(&m_histMap));
m_histMap.AddHistogram("myHisto", "joseph", 100, 0, 10);

View File

@ -0,0 +1,53 @@
#include "EditorLayer.h"
#include "imgui.h"
namespace Navigator {
EditorLayer::EditorLayer(HistogramMap* hmap) :
Layer("EditorLayer"), m_histMap(hmap)
{
}
EditorLayer::~EditorLayer() {}
void EditorLayer::OnAttach()
{
}
void EditorLayer::OnDetach()
{
}
void EditorLayer::OnUpdate()
{
}
void EditorLayer::OnEvent(Event& e)
{
}
void EditorLayer::OnImGuiRender()
{
ImGui::Begin("MyTestSpace");
if(ImGui::BeginMenuBar())
{
if(ImGui::BeginMenu("File"))
{
if(ImGui::MenuItem("Open"))
{
}
if(ImGui::MenuItem("Exit"))
{
}
if(ImGui::MenuItem("Save"))
{
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
ImGui::End();
}
}

View File

@ -0,0 +1,28 @@
#ifndef EDITOR_LAYER_H
#define EDITOR_LAYER_H
#include "Navigator/Layer.h"
#include "Navigator/Events/Event.h"
#include "Navigator/HistogramMap.h"
namespace Navigator {
class EditorLayer : public Layer
{
public:
EditorLayer(HistogramMap* hmap);
~EditorLayer();
virtual void OnAttach() override;
virtual void OnDetach() override;
virtual void OnImGuiRender() override;
virtual void OnUpdate() override;
virtual void OnEvent(Event& event) override;
private:
HistogramMap* m_histMap; //Not owned by the EditorLayer!!
};
}
#endif

View File

@ -92,8 +92,8 @@ namespace Navigator {
void ImGuiLayer::OnImGuiRender()
{
static bool show = true;
ImGui::ShowDemoWindow(&show);
ImPlot::ShowDemoWindow();
//static bool show = true;
//ImGui::ShowDemoWindow(&show);
//ImPlot::ShowDemoWindow();
}
}