-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathengine.cpp
More file actions
41 lines (31 loc) · 764 Bytes
/
Copy pathengine.cpp
File metadata and controls
41 lines (31 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Created by arrayJY on 2022/12/08.
//
#include "engine.h"
#include "function/render_system.h"
#include "function/window_system.h"
#include "global_context.h"
namespace Sparrow {
void Engine::startEngine() {
gContext.initialize();
mainLoop();
}
void Engine::tick(float deltaTime) {
logicalTick(deltaTime);
renderTick(deltaTime);
}
void Engine::shutdown() {}
void Engine::logicalTick(float deltaTime) {}
void Engine::renderTick(float deltaTime) {
gContext.renderSystem->tick(deltaTime);
}
float Engine::calcOneFrameDeltaTime() const {
return 0.0; // TODO
}
void Engine::mainLoop() {
while (!gContext.windowSystem->shouldClose()) {
tick(calcOneFrameDeltaTime());
gContext.windowSystem->pollEvents();
}
}
} // namespace Sparrow