Class Layer#

Inheritance Relationships#

Derived Type#

Class Documentation#

class Layer#

Subclassed by TRAP::ImGuiLayer

Public Functions

explicit constexpr Layer(std::string debugName = "Layer") noexcept#

Constructor.

Parameters:

debugNameLayer name for debugging.

consteval Layer(const Layer&) noexcept = delete#

Copy constructor.

consteval Layer &operator=(const Layer&) noexcept = delete#

Copy assignment operator.

constexpr Layer(Layer&&) noexcept = default#

Move constructor.

constexpr Layer &operator=(Layer&&) noexcept = default#

Move assignment operator.

virtual constexpr ~Layer() = default#

Destructor.

virtual void OnAttach()#

Called when Layer gets pushed to a layer stack.

virtual void OnDetach()#

Called when Layer gets popped from a layer stack.

virtual void OnUpdate(const Utils::TimeStep &deltaTime)#

Called every frame.

Parameters:

deltaTime – Time difference between current and last frame.

virtual void OnTick(const Utils::TimeStep &deltaTime)#

Called every tick (default 100 ticks).

Parameters:

deltaTime – Time difference between current and last tick.

virtual void OnImGuiRender()#

Called every frame. Should be used for debug GUIs.

virtual void OnEvent(Events::Event &event)#

Called when an event occurs.

Parameters:

event – Event that occurred.

constexpr std::string GetName() const noexcept#

Retrieve the debug name of the layer.

Returns:

Name of the layer.

Protected Attributes

std::string m_DebugName#