add some AI generated dx11 render code
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
#include "engine.hpp"
|
||||
#include <stdexcept>
|
||||
|
||||
namespace Basalt::Shared::Engine {
|
||||
|
||||
IEngine::IEngine(EngineConfig&& config) : config(std::move(config)) {}
|
||||
IEngine::IEngine() : config(), status(EngineStatus::Ready) {}
|
||||
|
||||
IEngine::~IEngine() {}
|
||||
IEngine::~IEngine() {
|
||||
if (this->status != EngineStatus::Stop) {
|
||||
this->Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
void IEngine::Startup(EngineConfig &&config) {
|
||||
if (this->status != EngineStatus::Ready) throw std::runtime_error("unexpected engine status");
|
||||
this->config = std::move(config);
|
||||
this->status = EngineStatus::Running;
|
||||
}
|
||||
|
||||
void IEngine::Tick() {
|
||||
if (this->status != EngineStatus::Running) throw std::runtime_error("unexpected engine status");
|
||||
}
|
||||
|
||||
void IEngine::Shutdown() {
|
||||
if (this->status != EngineStatus::Running) throw std::runtime_error("unexpected engine status");
|
||||
this->status = EngineStatus::Stop;
|
||||
}
|
||||
|
||||
} // namespace Basalt::Shared::Engine
|
||||
|
||||
Reference in New Issue
Block a user