Files
UwU-Engine/Core/Game/GameInstance.hpp
T

38 lines
770 B
C++

#pragma once
#include <atomic>
#include <memory>
class CoreInstance;
class World;
class ModelManager;
#define GENERATE_FACTORY_GAME_INSTANCE(Class) \
GameInstance* GameFactory(CoreInstance& core) { return new Class(core); }
class GameInstance
{
CoreInstance& core;
World* world = nullptr;
ModelManager* current_model_manager_ = nullptr;
std::atomic<bool> is_running = true;
void start();
// Stop call from the core
void stop();
public:
// Stop call from game
void quit();
// Init vulkan
GameInstance(CoreInstance& core);
virtual ~GameInstance();
World* GetWorld() const { return world; }
CoreInstance& GetCore() const { return core; }
ModelManager* GetCurrentModelManager() const { return current_model_manager_; }
friend class CoreInstance;
};