A small game engine for 2D games based of Raylib
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

24 行
534 B

#pragma once
#include <memory>
#include <vector>
#include <chrono>
#include "entity.h"
namespace ant::core {
struct scene {
static std::shared_ptr<scene> current;
std::vector<std::shared_ptr<entity>> root_nodes;
void update(std::chrono::duration<double> delta_time) {
for (auto &elem: root_nodes) {
elem->update(delta_time);
}
}
void render() {
for (auto &elem: root_nodes | std::views::filter([](const std::shared_ptr<entity>& elem){return elem->visibility_flag();})) {
elem->render();
}
}
};
}