BsGLGpuBuffer.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include "BsGLPrerequisites.h"
  3. #include "BsGpuBuffer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_RSGL_EXPORT GLGpuBuffer : public GpuBuffer
  7. {
  8. public:
  9. ~GLGpuBuffer();
  10. /**
  11. * @copydoc GenericBuffer::lockImpl
  12. */
  13. virtual void* lock(UINT32 offset, UINT32 length, GpuLockOptions options);
  14. /**
  15. * @copydoc GenericBuffer::unlockImpl
  16. */
  17. virtual void unlock();
  18. /**
  19. * @copydoc GenericBuffer::readData
  20. */
  21. virtual void readData(UINT32 offset, UINT32 length, void* pDest);
  22. /**
  23. * @copydoc GenericBuffer::writeData
  24. */
  25. virtual void writeData(UINT32 offset, UINT32 length, const void* pSource,
  26. BufferWriteType writeFlags = BufferWriteType::Normal);
  27. /**
  28. * @copydoc GenericBuffer::copyData
  29. */
  30. void copyData(GpuBuffer& srcBuffer, UINT32 srcOffset,
  31. UINT32 dstOffset, UINT32 length, bool discardWholeBuffer = false);
  32. protected:
  33. friend class GLHardwareBufferManager;
  34. GLGpuBuffer(UINT32 elementCount, UINT32 elementSize, GpuBufferType type, GpuBufferUsage usage, bool randomGpuWrite = false, bool useCounter = false);
  35. virtual GpuBufferView* createView();
  36. virtual void destroyView(GpuBufferView* view);
  37. /**
  38. * @copydoc GpuBuffer::initialize_internal()
  39. */
  40. void initialize_internal();
  41. };
  42. }