Represents a reusable application layer that receives lifecycle callbacks (attach, detach, update, events, render, and ImGui render). Intended as a base class for concrete layers.
More...
#include <Layer.h>
|
| | Layer (const std::string &name="Layer") |
| | Constructs a Layer with an optional name for debugging purposes.
|
| virtual | ~Layer () |
| virtual void | OnAttach () |
| | Called when the layer is attached to the application.
|
| virtual void | OnDetach () |
| | Called when the layer is detached from the application.
|
| virtual void | OnUpdate (Timestep ts) |
| | Called every frame to update the layer with the given timestep.
|
| virtual void | OnEvent (Event &event) |
| | Called when an event is dispatched to the layer.
|
| virtual void | OnRender () |
| | Called when the layer should render its contents.
|
| virtual void | OnImGuiRender () |
| | Called when the layer should render its ImGui components.
|
| const std::string & | GetName () const |
| | Retrieves the name of the layer for debugging purposes.
|
|
| std::string | m_DebugName |
| | The name of the layer assigned at creation, used for debugging.
|
Represents a reusable application layer that receives lifecycle callbacks (attach, detach, update, events, render, and ImGui render). Intended as a base class for concrete layers.
◆ Layer()
| Vesper::Layer::Layer |
( |
const std::string & | name = "Layer" | ) |
|
Constructs a Layer with an optional name for debugging purposes.
- Parameters
-
| name | The name of the layer, used for debugging, defaulted to "Layer". |
8 {
9 }
std::string m_DebugName
The name of the layer assigned at creation, used for debugging.
Definition Layer.h:57
References Layer().
Referenced by Layer().
◆ ~Layer()
| Vesper::Layer::~Layer |
( |
| ) |
|
|
virtual |
◆ GetName()
| const std::string & Vesper::Layer::GetName |
( |
| ) |
const |
|
inline |
Retrieves the name of the layer for debugging purposes.
◆ OnAttach()
| virtual void Vesper::Layer::OnAttach |
( |
| ) |
|
|
inlinevirtual |
◆ OnDetach()
| virtual void Vesper::Layer::OnDetach |
( |
| ) |
|
|
inlinevirtual |
◆ OnEvent()
| virtual void Vesper::Layer::OnEvent |
( |
Event & | event | ) |
|
|
inlinevirtual |
◆ OnImGuiRender()
| virtual void Vesper::Layer::OnImGuiRender |
( |
| ) |
|
|
inlinevirtual |
◆ OnRender()
| virtual void Vesper::Layer::OnRender |
( |
| ) |
|
|
inlinevirtual |
Called when the layer should render its contents.
- Note
- Layers are responsible for their own rendering needs.
- Todo
- add layer rendering into the application's render loop
◆ OnUpdate()
| virtual void Vesper::Layer::OnUpdate |
( |
Timestep | ts | ) |
|
|
inlinevirtual |
Called every frame to update the layer with the given timestep.
- Parameters
-
| ts | The timestep representing the time elapsed since the last update. |
Reimplemented in Vesper::EditorLayer.
◆ m_DebugName
| std::string Vesper::Layer::m_DebugName |
|
protected |
The name of the layer assigned at creation, used for debugging.
The documentation for this class was generated from the following files: