CmTransientMesh.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmMeshBase.h"
  4. namespace CamelotFramework
  5. {
  6. class CM_EXPORT TransientMesh : public MeshBase
  7. {
  8. public:
  9. virtual ~TransientMesh();
  10. /**
  11. * @copydoc GpuResource::writeSubresource
  12. */
  13. virtual void writeSubresource(UINT32 subresourceIdx, const GpuResourceData& data, bool discardEntireBuffer);
  14. /**
  15. * @copydoc GpuResource::readSubresource
  16. */
  17. virtual void readSubresource(UINT32 subresourceIdx, GpuResourceData& data);
  18. /**
  19. * @copydoc MeshBase::getVertexData
  20. */
  21. std::shared_ptr<VertexData> getVertexData() const;
  22. /**
  23. * @copydoc MeshBase::getIndexData
  24. */
  25. std::shared_ptr<IndexData> getIndexData() const;
  26. /**
  27. * @copydoc MeshBase::getVertexOffset
  28. */
  29. virtual UINT32 getVertexOffset() const;
  30. /**
  31. * @copydoc MeshBase::getIndexOffset
  32. */
  33. virtual UINT32 getIndexOffset() const;
  34. /**
  35. * @copydoc MeshBase::notifyUsedOnGPU
  36. */
  37. virtual void notifyUsedOnGPU();
  38. protected:
  39. friend class MeshHeap;
  40. TransientMesh(const MeshHeapPtr& parentHeap, UINT32 id, UINT32 numIndices,
  41. UINT32 numVertices, DrawOperationType drawOp = DOT_TRIANGLE_LIST);
  42. void markAsDestroyed() { mIsDestroyed = true; }
  43. protected:
  44. bool mIsDestroyed;
  45. MeshHeapPtr mParentHeap;
  46. UINT32 mId;
  47. };
  48. }