diff --git a/SakuraCore/src/LayerStack.cpp b/SakuraCore/src/LayerStack.cpp index bdf3916..761d1af 100644 --- a/SakuraCore/src/LayerStack.cpp +++ b/SakuraCore/src/LayerStack.cpp @@ -4,6 +4,12 @@ #include namespace SakuraVNE { + +LayerStack::LayerStack() { + m_LayerStack.reserve(3); + m_CommandQueue.reserve(10); +} + LayerStack::~LayerStack() { for (auto &layer : m_LayerStack) { layer->OnDetach(); diff --git a/SakuraCore/src/LayerStack.h b/SakuraCore/src/LayerStack.h index ddcfea4..9ee7f39 100644 --- a/SakuraCore/src/LayerStack.h +++ b/SakuraCore/src/LayerStack.h @@ -16,7 +16,7 @@ struct LayerCommand { class LayerStack { public: - LayerStack() = default; + LayerStack(); ~LayerStack(); void PushLayer(std::unique_ptr layer);