layer to layer transition working without event system
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
16
SakuraVNE/src/TestLayer.cpp
Normal file
16
SakuraVNE/src/TestLayer.cpp
Normal 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
11
SakuraVNE/src/TestLayer.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "Layer.h"
|
||||
|
||||
class TestLayer : public SakuraVNE::Layer {
|
||||
public:
|
||||
TestLayer();
|
||||
virtual ~TestLayer() = default;
|
||||
|
||||
virtual void OnImGuiRender() override;
|
||||
};
|
||||
Submodule libs/SakuraCore updated: 8b91c7ab76...3925ccc520
Reference in New Issue
Block a user