mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-23 22:55:39 +00:00
32 lines
611 B
C++
32 lines
611 B
C++
|
#include "Renderer.h"
|
||
|
|
||
|
void Renderer::registerComponent(GuiComponent* comp)
|
||
|
{
|
||
|
renderVector.push_back(comp);
|
||
|
}
|
||
|
|
||
|
void Renderer::unregisterComponent(GuiComponent* comp)
|
||
|
{
|
||
|
for(unsigned int i = 0; i < renderVector.size(); i++)
|
||
|
{
|
||
|
if(renderVector.at(i) == comp)
|
||
|
{
|
||
|
renderVector.erase(renderVector.begin() + i);
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void Renderer::render()
|
||
|
{
|
||
|
for(unsigned int layer = 0; layer < LAYER_COUNT; layer++)
|
||
|
{
|
||
|
unsigned int layerBit = BIT(layer);
|
||
|
for(unsigned int i = 0; i < renderVector.size(); i++)
|
||
|
{
|
||
|
if(renderVector.at(i)->getLayer() & layerBit)
|
||
|
renderVector.at(i)->render();
|
||
|
}
|
||
|
}
|
||
|
}
|