From 977fd67ddf308b80cda5a4b7660418f2f425d608 Mon Sep 17 00:00:00 2001 From: anulax1225 Date: Tue, 23 Jan 2024 23:14:19 +0100 Subject: [PATCH] Added test layer to the sandbox --- sandbox/src/sandbox.cpp | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/sandbox/src/sandbox.cpp b/sandbox/src/sandbox.cpp index dfc916f..e87c892 100644 --- a/sandbox/src/sandbox.cpp +++ b/sandbox/src/sandbox.cpp @@ -1,15 +1,48 @@ -#include #include #include #include #include +#include + +//USE THE FUCKING NAMESPACE OR BREAK + +class TestLayer : public Bk::Layer +{ + public: + TestLayer() + : Layer("Test") {} + + void on_attach() override + { + BK_INFO("Layer {} attached", name); + } + + void on_detach() override + { + BK_INFO("Layer {} detached", name); + } + + void on_event(Bk::Event& e) override + { + BK_INFO("Layer {} event", name); + } + + void on_update() override + { + BK_INFO("Layer {} updated", name); + } +}; class Sandbox : public Bk::Application { public: Sandbox() - { + { + push_layer(new TestLayer()); + push_layer(new TestLayer()); + std::unique_ptr layer = pop_overlay(); + BK_INFO("Layer retirer et récupérer {0}", layer->to_string()); } @@ -19,6 +52,8 @@ class Sandbox : public Bk::Application } }; + + std::unique_ptr Bk::create_app() { return std::unique_ptr(new Sandbox()); } \ No newline at end of file