CmVertexData.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmVertexDeclaration.h"
  4. #include "CmVertexBuffer.h"
  5. namespace BansheeEngine
  6. {
  7. /** \addtogroup Core
  8. * @{
  9. */
  10. /** \addtogroup RenderSystem
  11. * @{
  12. */
  13. /** Summary class collecting together vertex source information. */
  14. class CM_EXPORT VertexData
  15. {
  16. public:
  17. VertexData();
  18. ~VertexData();
  19. /** Declaration of the vertex to be used in this operation.
  20. @remarks Note that this is created for you on construction.
  21. */
  22. VertexDeclarationPtr vertexDeclaration;
  23. /// The number of vertices used in this operation
  24. UINT32 vertexCount;
  25. void setBuffer(UINT32 index, VertexBufferPtr buffer);
  26. /// Gets the buffer bound to the given source index
  27. VertexBufferPtr getBuffer(UINT32 index) const;
  28. const UnorderedMap<UINT32, VertexBufferPtr>& getBuffers() const { return mVertexBuffers; }
  29. /// Gets whether a buffer is bound to the given source index
  30. bool isBufferBound(UINT32 index) const;
  31. UINT32 getBufferCount(void) const { return (UINT32)mVertexBuffers.size(); }
  32. UINT32 getMaxBufferIndex(void) const { return (UINT32)mVertexBuffers.size(); }
  33. private:
  34. /** The vertex buffer bindings to be used.
  35. @remarks Note that this is created for you on construction.
  36. */
  37. UnorderedMap<UINT32, VertexBufferPtr> mVertexBuffers;
  38. };
  39. }