CmD3D11IndexBuffer.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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, BufferWriteType writeFlags = BufferWriteType::Normal);
  19. /**
  20. * @copydoc HardwareBuffer::copyData
  21. */
  22. void copyData(HardwareBuffer& srcBuffer, UINT32 srcOffset, UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false);
  23. /**
  24. * @brief Get the D3D-specific index buffer
  25. */
  26. ID3D11Buffer* getD3DIndexBuffer() const { return mBuffer->getD3DBuffer(); }
  27. protected:
  28. friend class D3D11HardwareBufferManager;
  29. D3D11IndexBuffer(D3D11Device& device, HardwareBufferManager* mgr, IndexType idxType, UINT32 numIndexes,
  30. GpuBufferUsage usage, bool useSystemMem);
  31. /**
  32. * @copydoc HardwareBuffer::lockImpl
  33. */
  34. void* lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options);
  35. /**
  36. * @copydoc HardwareBuffer::unlockImpl
  37. */
  38. void unlockImpl(void);
  39. /**
  40. * @copydoc IndexBuffer::initialize_internal()
  41. */
  42. void initialize_internal();
  43. /**
  44. * @copydoc IndexBuffer::destroy_internal()
  45. */
  46. void destroy_internal();
  47. D3D11HardwareBuffer* mBuffer;
  48. D3D11Device& mDevice;
  49. };
  50. }