|
|
- #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();
- }
- }
- };
- }
|