mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor: add Window interface
This commit is contained in:
parent
cd5c6a889c
commit
9694a59649
31 changed files with 859 additions and 923 deletions
|
|
@ -14,6 +14,7 @@ Mainloop::Mainloop(Engine& engine) : engine(engine) {
|
|||
|
||||
void Mainloop::run() {
|
||||
auto& time = engine.getTime();
|
||||
auto& window = engine.getWindow();
|
||||
|
||||
engine.setLevelConsumer([this](auto level, int64_t localPlayer) {
|
||||
if (level == nullptr) {
|
||||
|
|
@ -32,10 +33,10 @@ void Mainloop::run() {
|
|||
engine.setScreen(std::make_shared<MenuScreen>(engine));
|
||||
|
||||
logger.info() << "main loop started";
|
||||
while (!Window::isShouldClose()){
|
||||
time.update(Window::time());
|
||||
while (!window.isShouldClose()){
|
||||
time.update(window.time());
|
||||
engine.updateFrontend();
|
||||
if (!Window::isIconified()) {
|
||||
if (!window.isIconified()) {
|
||||
engine.renderFrame();
|
||||
}
|
||||
engine.postUpdate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue