1//************************************ bs::framework - Copyright 2018 Marko Pintera **************************************//
2//*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********//
3#pragma once
4
5#include "BsGLPrerequisites.h"
6#include "Managers/BsHardwareBufferManager.h"
7
8namespace bs { namespace ct
9{
10 /** @addtogroup GL
11 * @{
12 */
13
14 /** Handles creation of OpenGL specific hardware buffers. */
15 class GLHardwareBufferManager : public HardwareBufferManager
16 {
17 public:
18 /** Converts engine buffer usage flags into OpenGL specific flags. */
19 static GLenum getGLUsage(GpuBufferUsage usage);
20
21 /** Converts vertex element type into OpenGL specific type. */
22 static GLenum getGLType(VertexElementType type);
23
24 protected:
25 /** @copydoc HardwareBufferManager::createVertexBufferInternal */
26 SPtr<VertexBuffer> createVertexBufferInternal(const VERTEX_BUFFER_DESC& desc,
27 GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
28
29 /** @copydoc HardwareBufferManager::createIndexBufferInternal */
30 SPtr<IndexBuffer> createIndexBufferInternal(const INDEX_BUFFER_DESC& desc,
31 GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
32
33 /** @copydoc HardwareBufferManager::createGpuParamBlockBufferInternal */
34 SPtr<GpuParamBlockBuffer> createGpuParamBlockBufferInternal(UINT32 size,
35 GpuBufferUsage usage = GBU_DYNAMIC, GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
36
37 /** @copydoc HardwareBufferManager::createGpuBufferInternal(const GPU_BUFFER_DESC&, GpuDeviceFlags) */
38 SPtr<GpuBuffer> createGpuBufferInternal(const GPU_BUFFER_DESC& desc,
39 GpuDeviceFlags deviceMask = GDF_DEFAULT) override;
40
41 /** @copydoc HardwareBufferManager::createGpuBufferInternal(const GPU_BUFFER_DESC&, SPtr<HardwareBuffer>) */
42 SPtr<GpuBuffer> createGpuBufferInternal(const GPU_BUFFER_DESC& desc,
43 SPtr<HardwareBuffer> underlyingBuffer) override;
44 };
45
46 /** @} */
47}}