Layers and Events

This commit is contained in:
2025-04-05 22:37:24 -05:00
parent 5c798f8cb7
commit fbfa13a742
7 changed files with 184 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
#include "pch.hpp"
#include "Layer.h"
class Layerstack {
public:
Layerstack() {}
~Layerstack() {
while(!lstack.empty()) {
pop();
}
}
void push(Layer* l) { lstack.push_front(l); }
void pop() {
Layer* l = lstack.front();
lstack.pop_front();
delete l;
}
void renderAll() {
for(Layer* l : lstack)
l->onRender();
}
private:
std::list<Layer*> lstack;
};