grafika_komputerowa/grk/project/GameUtils.h
Pawel Felcyn 90e88b0dc2 xd
2024-01-24 22:49:59 +01:00

51 lines
1.1 KiB
C++

#include <list>
#include <tuple>
#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();
this->planetsTextures = new std::list<std::tuple<GLuint, GLuint>>();
}
std::list<Sun*>* suns;
std::list<Bullet*> bullets;
float aspectRatio;
std::list<std::tuple<GLuint, GLuint>>* planetsTextures;
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<std::tuple<GLuint, GLuint>>* getPlanetsTextures() {
return planetsTextures;
}
static GameUtils* getInstance()
{
static GameUtils instance; // Jedna i jedyna instancja
return &instance;
}
};