// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved. #pragma once #if GRAPHICS_API_OPENGL #include "Engine/Graphics/GPUBuffer.h" #include "GPUResourceOGL.h" #include "IShaderResourceOGL.h" /// /// GPU buffer for OpenGL /// /// class GPUBufferOGL : public GPUResourceOGL, public IShaderResourceOGL { public: /// /// Initializes a new instance of the class. /// /// The graphics device. /// The resource name. GPUBufferOGL(GPUDeviceOGL* device, const String& name); /// /// Finalizes an instance of the class. /// ~GPUBufferOGL(); public: GLenum BufferTarget = 0; GLuint BufferId = 0; public: // [GPUBuffer] bool SetData(const void* data, uint64 size) override; bool GetData(BytesContainer& data) override; // [IShaderResourceOGL] void Bind(int32 slotIndex) override; protected: // [GPUBuffer] bool OnInit() override; void OnReleaseGPU() override; }; #endif