BsGLGpuParamBlockBuffer.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLPrerequisites.h"
  5. #include "RenderAPI/BsGpuParamBlockBuffer.h"
  6. namespace bs { namespace ct
  7. {
  8. /** @addtogroup GL
  9. * @{
  10. */
  11. /** OpenGL implementation of a GPU parameter buffer (Uniform buffer). */
  12. class GLGpuParamBlockBuffer : public GpuParamBlockBuffer
  13. {
  14. public:
  15. GLGpuParamBlockBuffer(UINT32 size, GpuParamBlockUsage usage, GpuDeviceFlags deviceMask);
  16. ~GLGpuParamBlockBuffer();
  17. /** @copydoc GpuParamBlockBuffer::writeToGPU */
  18. void writeToGPU(const UINT8* data, UINT32 queueIdx = 0) override;
  19. /** Returns internal OpenGL uniform buffer handle. */
  20. GLuint getGLHandle() const { return mGLHandle; }
  21. protected:
  22. /** @copydoc GpuParamBlockBuffer::initialize */
  23. void initialize() override ;
  24. private:
  25. GLuint mGLHandle;
  26. };
  27. /** @} */
  28. }}