grafika_komputerowa/grk/project/GameUtils.h
2024-01-16 22:47:14 +01:00

44 lines
845 B
C++

#include <list>
#include "Sun.h"
#include "Bullet.h"
#include "src/Shader_Loader.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();
}
std::list<Sun*>* suns;
std::list<Bullet*> bullets;
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;
}
static GameUtils* getInstance()
{
static GameUtils instance; // Jedna i jedyna instancja
return &instance;
}
};