1
0

add stopwatch

This commit is contained in:
2026-01-09 19:29:39 +08:00
parent ff34754274
commit fba5d0627c
4 changed files with 57 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
#include "dll_loader.hpp"
#include "cmd_client.hpp"
#include "stopwatch.hpp"
#include <basalt/char_types.hpp>
#include <basalt/engine.hpp>
#include <basalt/deliver.hpp>
@@ -16,6 +17,7 @@ using dll_loader::DllKind;
using dll_loader::DllLoader;
using ::basalt::presenter::cmd_client::CmdClient;
using ::basalt::presenter::stopwatch::Stopwatch;
int main(int argc, char* argv[]) {
auto engine_dll = DllLoader(DllKind::Engine, BSTEXT("BasaltDirectX11Engine"));
@@ -30,8 +32,10 @@ int main(int argc, char* argv[]) {
EngineConfig engine_config{.headless = false, .width = payload.width, .height = payload.height};
engine->startup(std::move(engine_config));
Stopwatch stopwatch(120);
while (true) {
auto req_stop = engine->tick();
stopwatch.tick();
auto can_stop = client.tick(req_stop);
if (can_stop) break;
}