KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Layer.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "Karma/Events/Event.h"
13#include "Renderer/Scene.h"
14
15namespace Karma
16{
21 {
22 public:
28 Layer(const std::string& name = "Layer");
29
35 virtual ~Layer();
36
43 virtual void OnAttach() = 0;
44
51 virtual void OnDetach() = 0;
52
61 virtual void OnUpdate(float deltaTime) = 0;
62
63 // If we want KarmaGui to render the scene
72 virtual void KarmaGuiRender(float deltaTime) = 0;
73
81 virtual void OnEvent(Event& event)
82 {
83 }
84
90 inline const std::string& GetName() const
91 {
92 return m_DebugName;
93 }
94
95 protected:
96 std::string m_DebugName;
97 };
98}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the base class Event for Karma's events.
This file contains the class Scene.
The base class of all the events for Karma.
Definition Event.h:88
virtual void OnDetach()=0
A function called on Layer when the LayerStack is destroyed.
virtual void OnUpdate(float deltaTime)=0
Function called in each game loop.
virtual void OnAttach()=0
A function called on Layer when the Layer is pushed or OverLay is pushed.
Layer(const std::string &name="Layer")
A constructor.
Definition Layer.cpp:5
virtual void KarmaGuiRender(float deltaTime)=0
Function called in each game loop, specifically for rendering purposes.
virtual void OnEvent(Event &event)
For dispatching Events specific to the Layer.
Definition Layer.h:81
const std::string & GetName() const
Getter for the name of the Layer (debugging purposes).
Definition Layer.h:90