mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
add headless mode (engine initialization and finalization)
This commit is contained in:
parent
1ab3707343
commit
ee1a170376
7 changed files with 101 additions and 51 deletions
|
|
@ -45,10 +45,17 @@ public:
|
|||
initialize_error(const std::string& message) : std::runtime_error(message) {}
|
||||
};
|
||||
|
||||
struct CoreParameters {
|
||||
bool headless = false;
|
||||
std::filesystem::path resFolder {"res"};
|
||||
std::filesystem::path userFolder {"."};
|
||||
};
|
||||
|
||||
class Engine : public util::ObjectsKeeper {
|
||||
CoreParameters params;
|
||||
EngineSettings settings;
|
||||
SettingsHandler settingsHandler;
|
||||
EnginePaths& paths;
|
||||
EnginePaths paths;
|
||||
|
||||
std::unique_ptr<Assets> assets;
|
||||
std::shared_ptr<Screen> screen;
|
||||
|
|
@ -77,9 +84,12 @@ class Engine : public util::ObjectsKeeper {
|
|||
void processPostRunnables();
|
||||
void loadAssets();
|
||||
public:
|
||||
Engine(EnginePaths& paths);
|
||||
Engine(CoreParameters coreParameters);
|
||||
~Engine();
|
||||
|
||||
|
||||
/// @brief Start the engine
|
||||
void run();
|
||||
|
||||
/// @brief Start main engine input/update/render loop.
|
||||
/// Automatically sets MenuScreen
|
||||
void mainloop();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue