CmIndexData.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. #include "CmIndexBuffer.h"
  4. namespace CamelotEngine
  5. {
  6. /** Summary class collecting together index data source information. */
  7. class CM_EXPORT IndexData
  8. {
  9. public:
  10. IndexData();
  11. ~IndexData();
  12. /// pointer to the HardwareIndexBuffer to use, must be specified if useIndexes = true
  13. IndexBufferPtr indexBuffer;
  14. /// index in the buffer to start from for this operation
  15. UINT32 indexStart;
  16. /// The number of indexes to use from the buffer
  17. UINT32 indexCount;
  18. /** Clones this index data, potentially including replicating the index buffer.
  19. @param copyData Whether to create new buffers too or just reference the existing ones
  20. @param mgr If supplied, the buffer manager through which copies should be made
  21. @remarks The caller is expected to delete the returned pointer when finished
  22. */
  23. IndexData* clone(bool copyData = true, HardwareBufferManager* mgr = 0) const;
  24. /** Re-order the indexes in this index data structure to be more
  25. vertex cache friendly; that is to re-use the same vertices as close
  26. together as possible.
  27. @remarks
  28. Can only be used for index data which consists of triangle lists.
  29. It would in fact be pointless to use it on triangle strips or fans
  30. in any case.
  31. */
  32. void optimiseVertexCacheTriList(void);
  33. protected:
  34. /// Protected copy constructor, to prevent misuse
  35. IndexData(const IndexData& rhs); /* do nothing, should not use */
  36. /// Protected operator=, to prevent misuse
  37. IndexData& operator=(const IndexData& rhs); /* do not use */
  38. };
  39. }