diff --git a/SakuraVNE/src/AppLayer.cpp b/SakuraVNE/src/AppLayer.cpp index 5f838bd..61456ee 100644 --- a/SakuraVNE/src/AppLayer.cpp +++ b/SakuraVNE/src/AppLayer.cpp @@ -1 +1,19 @@ #include "AppLayer.h" +#include "Application.h" +#include "Layer.h" +#include "imgui.h" + +AppLayer::AppLayer() : Layer("AppLayer", true) {} + +void AppLayer::OnImGuiRender() { + ImGuiIO &io = ImGui::GetIO(); + bool demoWindow = true; + ImGui::Begin("Framerate"); + ImGui::ShowDemoWindow(&demoWindow); + ImGui::Text("Application avg %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); + + if (ImGui::Button("Quit")) { + Application::Get().SetRunningState(false); + } + ImGui::End(); +} diff --git a/SakuraVNE/src/AppLayer.h b/SakuraVNE/src/AppLayer.h index f6829fb..1a5ab8b 100644 --- a/SakuraVNE/src/AppLayer.h +++ b/SakuraVNE/src/AppLayer.h @@ -1,8 +1,10 @@ #include "Layer.h" -class AppLayer : SakuraVNE::Layer { +class AppLayer : public SakuraVNE::Layer { +public: AppLayer(); - virtual ~AppLayer(); + virtual ~AppLayer() = default; + virtual void OnImGuiRender() override; private: // bool OnMouseButtonPressed(Core::MouseButtonPressedEvent &event); diff --git a/SakuraVNE/src/main.cpp b/SakuraVNE/src/main.cpp index 0fe0ba5..be6e35d 100644 --- a/SakuraVNE/src/main.cpp +++ b/SakuraVNE/src/main.cpp @@ -1,3 +1,4 @@ +#include "AppLayer.h" #include "Application.h" int main(int argc, char *argv[]) { @@ -8,7 +9,7 @@ int main(int argc, char *argv[]) { appData.windowdata.height = 720; Application app(appData); - // app.PushLayer(); + app.PushLayer(); app.Run(); return 0; diff --git a/libs/SakuraCore b/libs/SakuraCore index da3ad2e..d58ddf6 160000 --- a/libs/SakuraCore +++ b/libs/SakuraCore @@ -1 +1 @@ -Subproject commit da3ad2ed6167725c956ab7cd3a511eaba0092f1f +Subproject commit d58ddf6c359ecdc1015628af87bf200bb79ececc