2024-01-10 20:56:06 +01:00
|
|
|
#include <list>
|
2024-01-24 22:49:59 +01:00
|
|
|
#include <tuple>
|
2024-01-10 20:56:06 +01:00
|
|
|
#include "Sun.h"
|
2024-01-16 22:15:26 +01:00
|
|
|
#include "Bullet.h"
|
|
|
|
#include "src/Shader_Loader.h"
|
2024-01-10 20:56:06 +01:00
|
|
|
|
2024-01-03 22:06:27 +01:00
|
|
|
#pragma once
|
|
|
|
class GameUtils
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
// Private constructor to prevent external instantiation
|
2024-01-10 20:56:06 +01:00
|
|
|
GameUtils() : aspectRatio(1.f)
|
|
|
|
{
|
|
|
|
this->suns = new std::list<Sun*>();
|
2024-01-16 22:15:26 +01:00
|
|
|
this->shaderLoader = new Core::Shader_Loader();
|
2024-01-24 22:49:59 +01:00
|
|
|
this->planetsTextures = new std::list<std::tuple<GLuint, GLuint>>();
|
2024-01-10 20:56:06 +01:00
|
|
|
}
|
|
|
|
std::list<Sun*>* suns;
|
2024-01-16 22:15:26 +01:00
|
|
|
std::list<Bullet*> bullets;
|
2024-01-10 20:56:06 +01:00
|
|
|
float aspectRatio;
|
2024-01-24 22:49:59 +01:00
|
|
|
std::list<std::tuple<GLuint, GLuint>>* planetsTextures;
|
2024-01-10 20:56:06 +01:00
|
|
|
|
2024-01-03 22:06:27 +01:00
|
|
|
|
|
|
|
public:
|
2024-01-16 22:15:26 +01:00
|
|
|
Core::Shader_Loader* shaderLoader;
|
|
|
|
Core::RenderContext sphereContext;
|
|
|
|
|
2024-01-03 22:06:27 +01:00
|
|
|
|
2024-01-10 20:56:06 +01:00
|
|
|
float getAspectRatio() {
|
|
|
|
return aspectRatio;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setAspectRatio(float value) {
|
|
|
|
aspectRatio = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::list<Sun*>* getSuns() {
|
|
|
|
return suns;
|
|
|
|
}
|
|
|
|
|
2024-01-24 22:49:59 +01:00
|
|
|
std::list<std::tuple<GLuint, GLuint>>* getPlanetsTextures() {
|
|
|
|
return planetsTextures;
|
|
|
|
}
|
|
|
|
|
2024-01-10 20:56:06 +01:00
|
|
|
static GameUtils* getInstance()
|
2024-01-03 22:06:27 +01:00
|
|
|
{
|
|
|
|
static GameUtils instance; // Jedna i jedyna instancja
|
2024-01-10 20:56:06 +01:00
|
|
|
return &instance;
|
2024-01-03 22:06:27 +01:00
|
|
|
}
|
|
|
|
};
|