BsVertexBuffer.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. #include "BsHardwareBuffer.h"
  4. #include "BsCoreObject.h"
  5. #include "BsColor.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Specialization of a hardware buffer used for holding vertex data.
  10. */
  11. class BS_CORE_EXPORT VertexBuffer : public HardwareBuffer, public CoreObject
  12. {
  13. public:
  14. virtual ~VertexBuffer() { }
  15. /**
  16. * @brief Gets the size in bytes of a single vertex in this buffer.
  17. */
  18. UINT32 getVertexSize() const { return mVertexSize; }
  19. /**
  20. * @brief Get the number of vertices in this buffer.
  21. */
  22. UINT32 getNumVertices() const { return mNumVertices; }
  23. /**
  24. * @brief Some render systems expect vertex color bits in an order different than
  25. * RGBA, in which case override this to flip the RGBA order.
  26. */
  27. virtual bool vertexColorReqRGBFlip() { return false; }
  28. static const int MAX_SEMANTIC_IDX = 8;
  29. protected:
  30. VertexBuffer(UINT32 vertexSize, UINT32 numVertices, GpuBufferUsage usage, bool useSystemMemory);
  31. protected:
  32. UINT32 mNumVertices;
  33. UINT32 mVertexSize;
  34. };
  35. }