layer to layer transition working without event system

This commit is contained in:
2026-04-04 11:54:33 +02:00
parent 206a2b7aa1
commit 24d3e5eacf
4 changed files with 35 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
#include "AppLayer.h"
#include "Application.h"
#include "Layer.h"
#include "TestLayer.h"
#include "imgui.h"
AppLayer::AppLayer() : Layer("AppLayer", true) {}
@@ -16,4 +17,10 @@ void AppLayer::OnImGuiRender() {
Application::Get().SetRunningState(false);
}
ImGui::End();
ImGui::Begin("Layer Transition");
if (ImGui::Button("Transition")) {
TransitionTo<TestLayer>();
}
ImGui::End();
}

View File

@@ -0,0 +1,16 @@
#include "TestLayer.h"
#include "AppLayer.h"
#include "Layer.h"
#include "imgui.h"
TestLayer::TestLayer() : Layer("TestLayer", true) {}
void TestLayer::OnImGuiRender() {
ImGuiIO &io = ImGui::GetIO();
ImGui::Begin("Layer Transition");
if (ImGui::Button("Transition")) {
TransitionTo<AppLayer>();
}
ImGui::End();
}

11
SakuraVNE/src/TestLayer.h Normal file
View File

@@ -0,0 +1,11 @@
#pragma once
#include "Layer.h"
class TestLayer : public SakuraVNE::Layer {
public:
TestLayer();
virtual ~TestLayer() = default;
virtual void OnImGuiRender() override;
};