BsDrawList.cpp 1.0 KB

1234567891011121314151617181920212223242526272829
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsDrawList.h"
  5. namespace BansheeEngine
  6. {
  7. void DrawList::clear()
  8. {
  9. mDrawOperations.clear();
  10. }
  11. void DrawList::add(const MaterialPtr& material, const MeshBasePtr& mesh, UINT32 submeshIdx, const Vector3& worldPosForSort)
  12. {
  13. // TODO - Make sure RenderOperations are cached so we dont allocate memory for them every frame
  14. mDrawOperations.push_back(DrawOperation());
  15. DrawOperation& renderOp = mDrawOperations.back();
  16. renderOp.material = material;
  17. renderOp.mesh = mesh;
  18. renderOp.worldPosition = worldPosForSort;
  19. renderOp.submeshIdx = submeshIdx;
  20. }
  21. const Vector<DrawOperation>& DrawList::getDrawOperations() const
  22. {
  23. return mDrawOperations;
  24. }
  25. }