refactor shared
This commit is contained in:
41
BasaltPresenter/Shared/basalt/engine.hpp
Normal file
41
BasaltPresenter/Shared/basalt/engine.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
#include "guid.hpp"
|
||||
#include <string>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace basalt::shared::engine {
|
||||
|
||||
struct EngineConfig {
|
||||
bool headless; ///< Whether enable headless mode (No Window created).
|
||||
std::uint32_t width; ///< Window width.
|
||||
std::uint32_t height; ///< Window height.
|
||||
guid::Guid deliver; ///< The GUID of deliver.
|
||||
};
|
||||
|
||||
enum class EngineStatus {
|
||||
Ready, ///< Engine was allocated but not initialized.
|
||||
Running, ///< Engine has been initialized and running.
|
||||
Stop, ///< Engine is shutdown.
|
||||
};
|
||||
|
||||
class IEngine {
|
||||
public:
|
||||
IEngine();
|
||||
virtual ~IEngine();
|
||||
|
||||
public:
|
||||
virtual guid::Guid GetGuid() const;
|
||||
virtual void Startup(EngineConfig&& config);
|
||||
/**
|
||||
* @brief
|
||||
* @return True for active exit.
|
||||
*/
|
||||
virtual bool Tick();
|
||||
virtual void Shutdown();
|
||||
|
||||
protected:
|
||||
EngineConfig config;
|
||||
EngineStatus status;
|
||||
};
|
||||
|
||||
} // namespace basalt::shared::engine
|
||||
Reference in New Issue
Block a user