7#include <vulkan/vulkan.hpp>
10#include "SD/export.hpp"
39 for (
auto it = m_layers.rbegin();
it != m_layers.rend(); ++
it) {
47 std::ranges::for_each(m_layers, [
dt](
const auto&
layer) {
48 if (
layer->is_active())
53 std::ranges::for_each(m_layers, [
dt](
const auto&
layer) {
54 if (
layer->is_active())
59 std::ranges::for_each(m_layers, [](
const auto&
layer) {
60 if (
layer->is_active())
61 layer->on_gui_render();
65 std::ranges::for_each(m_layers, [](
const auto&
layer) {
66 if (
layer->is_active())
67 layer->on_im_gui_menu_bar();
72 for (
auto it = m_layers.rbegin();
it != m_layers.rend(); ++
it) {
73 if ((*it)->is_active()) {
83 auto layer = std::make_unique<T>(std::forward<Args>(
args)...);
86 m_layers.emplace_back(std::move(
layer));
94 auto layer = std::make_unique<T>(std::forward<Args>(
args)...);
98 m_layers.insert(m_layers.begin(), std::move(
layer));
107 m_layers.emplace_back(std::move(
layer));
113 for (
auto&
layer : m_layers) {
115 if (
auto p =
dynamic_cast<T*
>(
layer.get())) {
124 auto it = std::find_if(m_layers.begin(), m_layers.end(),
125 [](
const auto&
l) { return dynamic_cast<T*>(l.get()) != nullptr; });
127 if (
it != m_layers.end()) {
130 std::unique_ptr<T>
result(
static_cast<T*
>(
it->release()));
139 for (
auto it = m_layers.rbegin();
it != m_layers.rend(); ++
it) {
148 std::ranges::for_each(m_layers, [](
const auto&
layer) {
149 if (
layer->is_active())
150 layer->on_swapchain_recreated();
155 std::ranges::for_each(m_layers, [&
cmd](
const auto&
layer) {
156 if (
layer->is_active())
162 std::vector<std::unique_ptr<Layer>> m_layers{};
Definition LayerList.hpp:21
void on_imGui_menu_bar()
Definition LayerList.hpp:64
void on_fixed_update(double dt) const
Definition LayerList.hpp:52
T * Get()
Definition LayerList.hpp:112
iterator end()
Definition LayerList.hpp:33
LayerList & operator=(const LayerList &)=delete
void on_render(vk::CommandBuffer &cmd) const
Definition LayerList.hpp:154
T & push_bottom(Args &&... args)
Definition LayerList.hpp:93
std::vector< std::unique_ptr< Layer > >::const_iterator const_iterator
Definition LayerList.hpp:30
std::unique_ptr< T > pop_layer()
Definition LayerList.hpp:123
T & push_layer(Args &&... args)
Definition LayerList.hpp:82
LayerList(LayerList &&) noexcept=default
void on_swapchain_recreated()
Definition LayerList.hpp:147
LayerList(const LayerList &)=delete
void on_event(Event &e)
Definition LayerList.hpp:71
void update(const float dt) const
Definition LayerList.hpp:46
std::vector< std::unique_ptr< Layer > >::iterator iterator
Definition LayerList.hpp:29
void gui_render()
Definition LayerList.hpp:58
T & attach_layer(std::unique_ptr< T > layer)
Definition LayerList.hpp:105
const_iterator begin() const
Definition LayerList.hpp:34
const_iterator end() const
Definition LayerList.hpp:35
~LayerList()
Definition LayerList.hpp:37
void clear()
Definition LayerList.hpp:137
Base class for all layers. Prefer using System, RenderStage, or Panel instead.
Definition Layer.hpp:28
Definition Application.hpp:28
constexpr T g_type_max
Definition types.hpp:21