Hymn to Beauty
C++ 3D Engine
Video::OpenGLBuffer Class Reference

OpenGL implementation of Buffer. More...

#include <OpenGLBuffer.hpp>

Inheritance diagram for Video::OpenGLBuffer:
Video::Buffer

Public Member Functions

 OpenGLBuffer (Buffer::BufferUsage bufferUsage, const BufferAllocation &allocation)
 Create new OpenGL buffer. More...
 
 ~OpenGLBuffer () final
 Destructor. More...
 
void Reset (BufferUsage bufferUsage, const BufferAllocation &allocation) final
 Reset the buffer. More...
 
unsigned int GetSize () const final
 Get the size of the buffer. More...
 
GLuint GetBufferID () const
 Get the buffer OpenGL ID. More...
 
GLenum GetTarget () const
 Get the OpenGL target. More...
 
uint32_t GetOffset () const
 Get the offset into the raw buffer. More...
 
- Public Member Functions inherited from Video::Buffer
 Buffer (BufferUsage bufferUsage)
 Create a new buffer. More...
 
virtual ~Buffer ()
 Destructor. More...
 
BufferUsage GetBufferUsage () const
 Get how the buffer is to be used. More...
 

Additional Inherited Members

- Public Types inherited from Video::Buffer
enum class  BufferUsage {
  VERTEX_BUFFER , INDEX_BUFFER , UNIFORM_BUFFER , STORAGE_BUFFER ,
  VERTEX_STORAGE_BUFFER , COUNT
}
 How the buffer is going to be used. More...
 
- Protected Attributes inherited from Video::Buffer
BufferUsage bufferUsage
 How the buffer will be used. More...
 

Detailed Description

OpenGL implementation of Buffer.

Constructor & Destructor Documentation

◆ OpenGLBuffer()

Video::OpenGLBuffer::OpenGLBuffer ( Buffer::BufferUsage  bufferUsage,
const BufferAllocation allocation 
)

Create new OpenGL buffer.

Parameters
bufferUsageHow the buffer will be used.
allocationThe allocation to encapsulate.

◆ ~OpenGLBuffer()

Video::OpenGLBuffer::~OpenGLBuffer ( )
final

Destructor.

Member Function Documentation

◆ GetBufferID()

GLuint Video::OpenGLBuffer::GetBufferID ( ) const

Get the buffer OpenGL ID.

Returns
ID to use with OpenGL commands.

◆ GetOffset()

uint32_t Video::OpenGLBuffer::GetOffset ( ) const

Get the offset into the raw buffer.

Returns
The offset into the raw buffer.

◆ GetSize()

uint32_t Video::OpenGLBuffer::GetSize ( ) const
finalvirtual

Get the size of the buffer.

Returns
The size of the buffer in bytes.

Implements Video::Buffer.

◆ GetTarget()

GLenum Video::OpenGLBuffer::GetTarget ( ) const

Get the OpenGL target.

Returns
The target to which the buffer is bound.

◆ Reset()

void Video::OpenGLBuffer::Reset ( BufferUsage  bufferUsage,
const BufferAllocation allocation 
)
finalvirtual

Reset the buffer.

Parameters
bufferUsageHow the buffer will be used.
allocationAllocation to back up buffer memory.

Implements Video::Buffer.


The documentation for this class was generated from the following files: