mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-24 07:05:39 +00:00
eaf7df7ad5
Folders should now be sorted alphabetically. Will now fall back to a system font if LinLibertine.ttf is not found. Added a Menu button. Began working on a simple menu.
42 lines
873 B
C++
42 lines
873 B
C++
#include "Renderer.h"
|
|
#include "GuiComponent.h"
|
|
|
|
std::vector<GuiComponent*> renderVector;
|
|
|
|
unsigned int Renderer::getScreenWidth() { return Renderer::screen ? Renderer::screen->w : 640; } //1024; }
|
|
unsigned int Renderer::getScreenHeight() { return Renderer::screen ? Renderer::screen->h : 480; }
|
|
|
|
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::deleteAll()
|
|
{
|
|
for(unsigned int i = 0; i < renderVector.size(); i++)
|
|
{
|
|
delete renderVector.at(i);
|
|
}
|
|
renderVector.clear();
|
|
}
|
|
|
|
void Renderer::render()
|
|
{
|
|
for(unsigned int i = 0; i < renderVector.size(); i++)
|
|
{
|
|
renderVector.at(i)->render();
|
|
}
|
|
}
|