grafika_komputerowa/grk/project/GameUtils.h

44 lines
845 B
C
Raw Normal View History

2024-01-10 20:56:06 +01:00
#include <list>
#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-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-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;
}
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
}
};