33 lines
699 B
C++
33 lines
699 B
C++
#include "service_menu.h"
|
|
#include "screen.h"
|
|
#include <SDL3/SDL.h>
|
|
|
|
// Singleton
|
|
ServiceMenu *ServiceMenu::instance_ = nullptr;
|
|
|
|
// Inicializa la instancia única del singleton
|
|
void ServiceMenu::init() { ServiceMenu::instance_ = new ServiceMenu(); }
|
|
|
|
// Libera la instancia
|
|
void ServiceMenu::destroy() { delete ServiceMenu::instance_; }
|
|
|
|
// Obtiene la instancia
|
|
ServiceMenu *ServiceMenu::get() { return ServiceMenu::instance_; }
|
|
|
|
void ServiceMenu::toggle()
|
|
{
|
|
enabled_ = !enabled_;
|
|
}
|
|
|
|
void ServiceMenu::render()
|
|
{
|
|
if (enabled_)
|
|
{
|
|
SDL_FRect rect = {10.0f, 10.0f, 100.0f, 100.0f};
|
|
SDL_RenderRect(Screen::get()->getRenderer(), &rect);
|
|
}
|
|
}
|
|
|
|
void ServiceMenu::update()
|
|
{
|
|
} |