1
0

add some AI generated dx11 render code

This commit is contained in:
2026-01-04 17:16:54 +08:00
parent f094dda054
commit a66d3dee8b
7 changed files with 297 additions and 19 deletions

View File

@@ -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