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 "krpch.h"
13
14#include "Karma/Events/Event.h"
15#include "Renderer/Scene.h"
16
17namespace Karma
18{
23 {
24 public:
30 Layer(const std::string& name = "Layer");
31
37 virtual ~Layer();
38
45 virtual void OnAttach() = 0;
46
53 virtual void OnDetach() = 0;
54
63 virtual void OnUpdate(float deltaTime) = 0;
64
65 // If we want KarmaGui to render the scene
74 virtual void KarmaGuiRender(float deltaTime) = 0;
75
83 virtual void OnEvent(Event& event)
84 {
85 }
86
92 inline const std::string& GetName() const
93 {
94 return m_DebugName;
95 }
96
97 protected:
98 std::string m_DebugName;
99 };
100}
#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:90
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:83
const std::string & GetName() const
Getter for the name of the Layer (debugging purposes).
Definition Layer.h:92