hibiscus/core/engine/engine.cpp

51 lines
1.2 KiB
C++
Raw Normal View History

2023-05-26 21:41:51 +00:00
#include "enginever.hpp"
#include "engine.hpp"
namespace hibis {
Engine::Engine(Renderer* renderer, LoggerCallback logger) {
this->renderer = renderer;
loggerCallback = logger;
previousProcessTick = 0.00001f;
previousPhysicsProcessTick = 0.00001f;
//watch.start();
this->loggerCallback(Information, "Started Hibis!");
}
Engine::~Engine() {
//watch.stop();
}
void Engine::runNodeProcesses() {
// TODO: fix delta then adapt for runNodePhysicsProcesses
//const float current = watch.peek.total!"msecs" / 1_000;
//float delta = (current - previousProcessTick);
for (Node* node : nodeList) {
node->physicsProcess(0.00f);
}
//this.previousProcessTick = watch.peek.total!"msecs" / 1_000;
}
void Engine::runNodePhysicsProcesses() {
// TODO: See above TODO
// Schade! Have the wrong function content while I figure out how std.datetime.watch works
//const float current = watch.peek.total!"msecs" / 1_000;
//float delta = (current - previousProcessTick);
for (Node* node : nodeList) {
node->physicsProcess(0.00f);
}
//this.previousPhysicsProcessTick = watch.peek.total!"msecs" / 1_000;
}
void Engine::drawNodes() {
// TODO
}
const char* Engine::getEngineVersion() { return HIBIS_VERSION; }
}