KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
LayerStack.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "krpch.h"
13
14#include "Karma/Layer.h"
15
16namespace Karma
17{
22 {
23 public:
29 LayerStack();
30
38
49 void PushLayer(Layer* layer);
50
60 void PushOverlay(Layer* overlay);
61
68 void PopLayer(Layer* layer);
69
76 void PopOverlay(Layer* layer);
77
84 std::vector<Layer*>::iterator begin()
85 {
86 return m_Layers.begin();
87 }
88
94 std::vector<Layer*>::iterator end()
95 {
96 return m_Layers.end();
97 }
98
99 private:
100 std::vector<Layer*> m_Layers;
101 unsigned int m_LayerInsertIndex = 0;
102 };
103}
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the Layer class.
Base class of all Karma's Layers. For instance KarmaGuiLayer.
Definition Layer.h:23
void PopOverlay(Layer *layer)
For popping the specified Overlay and doing necessary arrangements (calling OnDetach function)
Definition LayerStack.cpp:58
std::vector< Layer * >::iterator end()
The Layer stack iterator with the last element (?) of the LayerStack.
Definition LayerStack.h:94
void PopLayer(Layer *layer)
For popping a Layer in the LayerStack and doing necessary arrangements (Layer counter decrement and c...
Definition LayerStack.cpp:46
LayerStack()
A constructor.
Definition LayerStack.cpp:18
std::vector< Layer * >::iterator begin()
The Layer stack iterator with first element of the LayerStack.
Definition LayerStack.h:84
void PushOverlay(Layer *overlay)
Places the Layer at the front most position, in the sense, after the last inserted layer.
Definition LayerStack.cpp:38
void PushLayer(Layer *layer)
LayerStack::m_Layers.emplace() is used to place the supplied layer at an index in ascending order....
Definition LayerStack.cpp:31