#pragma once #include #include #include #include #include #include #include struct DrawCommand { ~DrawCommand() { geometryData.clear(); indices.clear(); vertices.clear(); models.clear(); } struct Data { int vertexCount; int instanceCount; int firstVertex; int baseVertex; int baseInstance; }; std::vector geometryData; std::vector indices; std::vector vertices; std::vector models; }; struct StaticGeometry { std::map drawCommands; }; //reserved for future use struct InstancedGeometry {}; struct DynamicGeometry { std::string name; Mesh* mesh; Material* material; glm::mat4 model; }; class DrawList { public: void RebuildDynamicLists(); void RebuildStaticLists(); static void InvalidateNextFrame(); StaticGeometry GetStaticGeometry(); std::vector GetInstancedGeometry(); std::vector GetDynamicGeometry(); static std::function onStaticGeometryUpdate; private: std::vector m_dynamicGeometry; StaticGeometry m_staticGeometry; static bool m_frameInvalidated; };