KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
Karma::LayerStack Class Reference

Class concerned with the stacked Layer (what a way to frame the idea, if I may say so) More...

#include <LayerStack.h>

Public Member Functions

 LayerStack ()
 A constructor.
 
 ~LayerStack ()
 Destructor for freeing up the Layer occupied resource and calling Layer::OnDetach function in each Layer.
 
void PushLayer (Layer *layer)
 LayerStack::m_Layers.emplace() is used to place the supplied layer at an index in ascending order. For instance the layer inserted first has least index and subsequent layers have higher indices ordered accordingly.
 
void PushOverlay (Layer *overlay)
 Places the Layer at the front most position, in the sense, after the last inserted layer.
 
void PopLayer (Layer *layer)
 For popping a Layer in the LayerStack and doing necessary arrangements (Layer counter decrement and calling OnDetach function)
 
void PopOverlay (Layer *layer)
 For popping the specified Overlay and doing necessary arrangements (calling OnDetach function)
 
std::vector< Layer * >::iterator begin ()
 The Layer stack iterator with first element of the LayerStack.
 
std::vector< Layer * >::iterator end ()
 The Layer stack iterator with the last element (?) of the LayerStack.
 

Detailed Description

Class concerned with the stacked Layer (what a way to frame the idea, if I may say so)

Constructor & Destructor Documentation

◆ LayerStack()

Karma::LayerStack::LayerStack ( )

A constructor.

Since
Karma 1.0.0

◆ ~LayerStack()

Karma::LayerStack::~LayerStack ( )

Destructor for freeing up the Layer occupied resource and calling Layer::OnDetach function in each Layer.

Since
Karma 1.0.0

Member Function Documentation

◆ begin()

std::vector< Layer * >::iterator Karma::LayerStack::begin ( )
inline

The Layer stack iterator with first element of the LayerStack.

See also
Application::Run
Since
Karma 1.0.0

◆ end()

std::vector< Layer * >::iterator Karma::LayerStack::end ( )
inline

The Layer stack iterator with the last element (?) of the LayerStack.

Since
Karma 1.0.0

◆ PopLayer()

void Karma::LayerStack::PopLayer ( Layer * layer)

For popping a Layer in the LayerStack and doing necessary arrangements (Layer counter decrement and calling OnDetach function)

Parameters
layerThe layer to be popped
Since
Karma 1.0.0

◆ PopOverlay()

void Karma::LayerStack::PopOverlay ( Layer * layer)

For popping the specified Overlay and doing necessary arrangements (calling OnDetach function)

Parameters
layerThe overlay layer to be popped
Since
Karma 1.0.0

◆ PushLayer()

void Karma::LayerStack::PushLayer ( Layer * layer)

LayerStack::m_Layers.emplace() is used to place the supplied layer at an index in ascending order. For instance the layer inserted first has least index and subsequent layers have higher indices ordered accordingly.

Note
The natural way to PushLayer is by the API in Karma's Application class, Application::PushLayer which, in turn, calls this function.
Parameters
layerThe Layer to be placed
Since
Karma 1.0.0

◆ PushOverlay()

void Karma::LayerStack::PushOverlay ( Layer * overlay)

Places the Layer at the front most position, in the sense, after the last inserted layer.

Note
The natural way to PushOverly is by the API in Karma's Application class, Application::PushOverlay which, in turn, calls this function.
Parameters
layerThe Layer to be pushed as overlay
Since
Karma 1.0.0

The documentation for this class was generated from the following files: