grafika_komputerowa/grk/project/GameUtils.h
2024-01-30 21:15:07 +01:00

51 lines
1.1 KiB
C++

#include <list>
#include "Sun.h"
#include "Bullet.h"
#include "src/Shader_Loader.h"
#include "ParticleSystem.h"
#pragma once
class GameUtils
{
private:
// Private constructor to prevent external instantiation
GameUtils() : aspectRatio(1.f)
{
this->suns = new std::list<Sun*>();
this->shaderLoader = new Core::Shader_Loader();
this->particleSystems = new std::list<ParticleSystem*>();
}
std::list<Sun*>* suns;
std::list<Bullet*> bullets;
std::list<ParticleSystem*>* particleSystems;
float aspectRatio;
public:
Core::Shader_Loader* shaderLoader;
Core::RenderContext sphereContext;
float getAspectRatio() {
return aspectRatio;
}
void setAspectRatio(float value) {
aspectRatio = value;
}
std::list<Sun*>* getSuns() {
return suns;
}
std::list<ParticleSystem*>* getParticleSystems() {
return particleSystems;
}
static GameUtils* getInstance()
{
static GameUtils instance; // Jedna i jedyna instancja
return &instance;
}
};