A small game engine for 2D games based of Raylib
25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#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();
|
|
}
|
|
}
|
|
};
|
|
}
|