Files
CosmicEngine/src/Engine/Core/Kernel/CKernel.hpp
T

96 lines
2.3 KiB
C++
Raw Normal View History

2026-02-13 19:15:05 +01:00
#ifndef CKERNEL_HPP
#define CKERNEL_HPP
#include <memory>
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/glm.hpp>
#include <glm/gtx/transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "../Graphics/Window/CGameWindow.hpp"
2026-02-13 19:15:05 +01:00
#include "../Scene/CScene.hpp"
namespace CosmicCore {
/**
* @file CKernel.hpp
* @brief Central class of the game, handle window and I/O.
*/
/**
* @brief Central class of the game, handle window and I/O.
*/
class CKernel {
private:
std::string m_configPath;
std::string m_gameName;
// The config.
//CGameConfiguration m_config;
//CEngineConfiguration m_engineConfig;
// The windows.
//CLoadingWindow m_loadingWindow;
CGameWindow m_window;
2026-02-13 19:15:05 +01:00
// Global game var.
bool m_finished;
unsigned int m_deltaTime;
// The Scenes.
CScene* m_activeScene;
std::map<std::string, std::unique_ptr<CScene>> m_sceneMap;
2026-02-13 19:15:05 +01:00
public:
/**
* @brief A pointer to the simulation which is accessible from anywhere.
*/
static CKernel* m_kernel;
2026-02-13 19:15:05 +01:00
CKernel() = delete;
CKernel(std::string name, std::string gameName);
~CKernel();
std::string getName() { return m_gameName; };
2026-02-13 19:15:05 +01:00
//CGameConfiguration* getConfig() { return &m_config; };
//CEngineConfiguration* getEngineConfig() { return &m_engineConfig; };
//void addScene(std::shared_ptr<CScene>& scene);
//void setActiveScene(std::string scene);
CScene* getActiveScene();
void cleanup(){m_sceneMap.clear();};
2026-02-13 19:15:05 +01:00
//unsigned int getNbScene() { return m_sceneList.size(); };
//std::map<std::string, CScene*>& getScenes() { return m_sceneList; };
/*CKeyboard* getKeyboard(void) {
return m_inputHandler.getKeyboard();
}*/
/*CMouse* getMouse(void) {
return m_inputHandler.getMouse();
}*/
unsigned int getDeltatime(void) {
return m_deltaTime;
}
void setDeltatime(unsigned int delta){
m_deltaTime = delta;
}
//CGameWindow& getGameWindow(){return m_window;};
2026-02-13 19:15:05 +01:00
void start(bool isPreview = false);
void loop();
void quit();
void fullscreen();
void desktop();
void focus();
};
}
#endif