BsIndexBuffer.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. #include "BsHardwareBuffer.h"
  7. #include "BsCoreObject.h"
  8. namespace BansheeEngine
  9. {
  10. /**
  11. * @brief Hardware buffer that hold indices that reference vertices in a vertex buffer.
  12. */
  13. class BS_CORE_EXPORT IndexBuffer : public HardwareBuffer, public CoreObject
  14. {
  15. public:
  16. /**
  17. * @brief Type of the indices used, used for determining size.
  18. */
  19. enum IndexType
  20. {
  21. IT_16BIT,
  22. IT_32BIT
  23. };
  24. ~IndexBuffer();
  25. /**
  26. * @brief Returns the type of indices stored.
  27. */
  28. IndexType getType() const { return mIndexType; }
  29. /**
  30. * @brief Returns the number of indices this buffer can hold.
  31. */
  32. UINT32 getNumIndices() const { return mNumIndexes; }
  33. /**
  34. * @brief Returns the size of a single index in bytes.
  35. */
  36. UINT32 getIndexSize() const { return mIndexSize; }
  37. protected:
  38. IndexBuffer(IndexType idxType, UINT32 numIndexes, GpuBufferUsage usage, bool useSystemMemory);
  39. protected:
  40. IndexType mIndexType;
  41. UINT32 mNumIndexes;
  42. UINT32 mIndexSize;
  43. };
  44. }