BsGLIndexBuffer.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "BsGLPrerequisites.h"
  3. #include "BsIndexBuffer.h"
  4. namespace BansheeEngine
  5. {
  6. class BS_RSGL_EXPORT GLIndexBuffer : public IndexBuffer
  7. {
  8. public:
  9. ~GLIndexBuffer();
  10. /** See HardwareBuffer. */
  11. void readData(UINT32 offset, UINT32 length, void* pDest);
  12. /** See HardwareBuffer. */
  13. void writeData(UINT32 offset, UINT32 length,
  14. const void* pSource, BufferWriteType writeFlags = BufferWriteType::Normal);
  15. GLuint getGLBufferId(void) const { return mBufferId; }
  16. protected:
  17. friend class GLHardwareBufferManager;
  18. GLIndexBuffer(IndexType idxType, UINT32 numIndexes,
  19. GpuBufferUsage usage);
  20. /** See HardwareBuffer. */
  21. void* lockImpl(UINT32 offset, UINT32 length, GpuLockOptions options);
  22. /** See HardwareBuffer. */
  23. void unlockImpl(void);
  24. /**
  25. * @copydoc IndexBuffer::initialize_internal()
  26. */
  27. void initialize_internal();
  28. /**
  29. * @copydoc IndexBuffer::destroy_internal()
  30. */
  31. void destroy_internal();
  32. private:
  33. GLuint mBufferId;
  34. };
  35. }