editor setup

This commit is contained in:
Erris
2026-02-05 17:05:33 +01:00
parent 60bf9550cd
commit 40152fafff
10 changed files with 1206 additions and 6 deletions

View File

@@ -0,0 +1,44 @@
#include <open_engine/core.hpp>
#include <control_layer.hpp>
#include <sandbox2d.hpp>
#include <editor.hpp>
ControlLayer::ControlLayer(OpenEngine::Ref<OpenEngine::Layer> layer)
: active_layer(layer), OpenEngine::Layer("control_layer")
{
}
void ControlLayer::OnUpdate()
{
}
bool ControlLayer::StopRunning(OpenEngine::KeyPressedEvent& event)
{
if (event.GetKeyCode() == OE_KEY_ESCAPE) {
OpenEngine::Application::Get().StopRunning();
return true;
}
return false;
}
void ControlLayer::OnEvent(OpenEngine::Event& event)
{
OpenEngine::EventDispatcher dispatcher(event);
dispatcher.Dispatch<OpenEngine::KeyPressedEvent>(BIND_EVENT_FN(ControlLayer::StopRunning));
}
void ControlLayer::OnImGuiRender()
{
}
void ControlLayer::OnAttach()
{
}
void ControlLayer::OnDetach()
{
}