| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #pragma once
- #include "BsCorePrerequisites.h"
- #include "BsVector3.h"
- namespace BansheeEngine
- {
- /**
- * @brief Represents a single drawable object
- * stored in a DrawList.
- */
- struct BS_CORE_EXPORT DrawOperation
- {
- MaterialPtr material;
- MeshBasePtr mesh;
- UINT32 submeshIdx;
- Vector3 worldPosition;
- };
- /**
- * @brief A container you may use to queue
- * custom drawable objects in.
- */
- class BS_CORE_EXPORT DrawList
- {
- public:
- /**
- * @brief Adds a new drawable object.
- *
- * @param material Material to draw the object with.
- * @param mesh Parent mesh of the object.
- * @param submeshIdx Index of the sub-mesh to render, in the parent mesh.
- * @param worldPosForSort World position of the object that will be used for distance
- * sorting before rendering.
- */
- void add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort);
- /**
- * @brief Removes all queued drawable objects.
- */
- void clear();
- /**
- * @brief Returns all queued drawable objects.
- */
- const Vector<DrawOperation>& getDrawOperations() const;
- protected:
- Vector<DrawOperation> mDrawOperations;
- };
- }
|