CmD3D11IndexBuffer.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #pragma once
  2. #include "CmD3D11Prerequisites.h"
  3. #include "CmIndexBuffer.h"
  4. #include "CmD3D11HardwareBuffer.h"
  5. namespace CamelotFramework
  6. {
  7. class CM_D3D11_EXPORT D3D11IndexBuffer : public IndexBuffer
  8. {
  9. public:
  10. ~D3D11IndexBuffer();
  11. /**
  12. * @copydoc HardwareBuffer::readData
  13. */
  14. void readData(UINT32 offset, UINT32 length, void* pDest);
  15. /**
  16. * @copydoc HardwareBuffer::writeData
  17. */
  18. void writeData(UINT32 offset, UINT32 length, const void* pSource,
  19. bool discardWholeBuffer = false);
  20. /**
  21. * @copydoc HardwareBuffer::copyData
  22. */
  23. void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false);
  24. /**
  25. * @brief Get the D3D-specific index buffer
  26. */
  27. ID3D11Buffer* getD3DIndexBuffer() const { return mBuffer->getD3DBuffer(); }
  28. protected:
  29. friend class D3D11HardwareBufferManager;
  30. D3D11IndexBuffer(D3D11Device& device, HardwareBufferManager* mgr, IndexType idxType, UINT32 numIndexes,
  31. GpuBufferUsage usage, bool useSystemMem);
  32. /**
  33. * @copydoc HardwareBuffer::lockImpl
  34. */
  35. void* lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options);
  36. /**
  37. * @copydoc HardwareBuffer::unlockImpl
  38. */
  39. void unlockImpl(void);
  40. /**
  41. * @copydoc IndexBuffer::initialize_internal()
  42. */
  43. void initialize_internal();
  44. /**
  45. * @copydoc IndexBuffer::destroy_internal()
  46. */
  47. void destroy_internal();
  48. D3D11HardwareBuffer* mBuffer;
  49. D3D11Device& mDevice;
  50. };
  51. }