QuasarEngine
Cross-platform 3D engine and editor
Toggle main menu visibility
Loading...
Searching...
No Matches
Layer.h
Go to the documentation of this file.
1
#pragma once
2
7
8
#include <
quasar/core/Timestep.h
>
9
#include <
quasar/events/Event.h
>
10
11
#include <string>
12
#include <utility>
13
14
namespace
Quasar
15
{
22
class
Layer
23
{
24
public
:
25
virtual
~Layer() =
default
;
26
27
Layer(
const
Layer&) =
delete
;
28
Layer& operator=(
const
Layer&) =
delete
;
29
Layer(Layer&&) =
delete
;
30
Layer& operator=(Layer&&) =
delete
;
31
33
virtual
void
OnAttach
() {}
34
36
virtual
void
OnDetach
() {}
37
40
virtual
void
OnUpdate
([[maybe_unused]]
Timestep
timestep) {}
41
43
virtual
void
OnRender
() {}
44
46
virtual
void
OnImGuiRender
() {}
47
51
virtual
void
OnEvent
([[maybe_unused]]
Event
& event) {}
52
54
const
std::string&
GetName
()
const
{
return
m_Name; }
55
56
protected
:
58
explicit
Layer
(std::string name =
"Layer"
) : m_Name(std::move(name)) {}
59
60
private
:
61
std::string m_Name;
62
};
63
}
Event.h
Base class of all events, with their types and categories.
Timestep.h
Contains the Timestep class, which represents a time duration in seconds.
Quasar::Event
Base class of all events.
Definition
Event.h:95
Quasar::Layer::OnAttach
virtual void OnAttach()
Called once when the layer is added to the application, before any other hook.
Definition
Layer.h:33
Quasar::Layer::Layer
Layer(std::string name="Layer")
Creates a layer with a name, used in logs and debugging tools.
Definition
Layer.h:58
Quasar::Layer::OnDetach
virtual void OnDetach()
Called once when the layer is removed from the application, after every other hook.
Definition
Layer.h:36
Quasar::Layer::GetName
const std::string & GetName() const
Returns the name of the layer, for debugging.
Definition
Layer.h:54
Quasar::Layer::OnEvent
virtual void OnEvent(Event &event)
Called for each event received by the layer.
Definition
Layer.h:51
Quasar::Layer::OnImGuiRender
virtual void OnImGuiRender()
Called once per frame, after OnRender(), to draw the ImGui windows of the layer.
Definition
Layer.h:46
Quasar::Layer::OnUpdate
virtual void OnUpdate(Timestep timestep)
Called once per frame to update the layer.
Definition
Layer.h:40
Quasar::Layer::OnRender
virtual void OnRender()
Called once per frame, after OnUpdate(), to render the layer.
Definition
Layer.h:43
Quasar::Timestep
Time elapsed between two frames, in seconds.
Definition
Timestep.h:15
Quasar
Contains all the engine code.
quasar
core
Layer.h
Generated by
1.18.0