Added test layer to the sandbox

dev
anulax1225 ago%!(EXTRA string=1 year)
parent 6cde09d273
commit 977fd67ddf
  1. 37
      sandbox/src/sandbox.cpp

@ -1,15 +1,48 @@
#include <iostream>
#include <memory> #include <memory>
#include <utility> #include <utility>
#include <string> #include <string>
#include <bakara.h> #include <bakara.h>
#include <bakara/events/events.h>
//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 class Sandbox : public Bk::Application
{ {
public: public:
Sandbox() Sandbox()
{ {
push_layer(new TestLayer());
push_layer(new TestLayer());
std::unique_ptr<Bk::Layer> 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::Application> Bk::create_app() { std::unique_ptr<Bk::Application> Bk::create_app() {
return std::unique_ptr<Bk::Application>(new Sandbox()); return std::unique_ptr<Bk::Application>(new Sandbox());
} }
Loading…
Cancel
Save