BsDrawList.cpp 673 B

1234567891011121314151617181920212223242526
  1. #include "BsDrawList.h"
  2. namespace BansheeEngine
  3. {
  4. void DrawList::clear()
  5. {
  6. mDrawOperations.clear();
  7. }
  8. void DrawList::add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort)
  9. {
  10. // TODO - Make sure RenderOperations are cached so we dont allocate memory for them every frame
  11. mDrawOperations.push_back(DrawOperation());
  12. DrawOperation& renderOp = mDrawOperations.back();
  13. renderOp.material = material;
  14. renderOp.mesh = mesh;
  15. renderOp.worldPosition = worldPosForSort;
  16. renderOp.submeshIdx = submeshIdx;
  17. }
  18. const Vector<DrawOperation>& DrawList::getDrawOperations() const
  19. {
  20. return mDrawOperations;
  21. }
  22. }