Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
AeonGames::OpenGLBuffer Class Reference

OpenGL GPU buffer wrapper implementing the Buffer interface. More...

#include <C:/Code/AeonEngine/engine/renderers/opengl/OpenGLBuffer.hpp>

Inheritance diagram for AeonGames::OpenGLBuffer:
Inheritance graph
Collaboration diagram for AeonGames::OpenGLBuffer:
Collaboration graph

Public Member Functions

 OpenGLBuffer (const GLsizei aSize, const GLenum aUsage, const void *aData=nullptr)
 Construct from size, usage hint, and optional initial data.
 OpenGLBuffer (OpenGLBuffer &&aOpenGLBuffer)
 Move constructor.
 OpenGLBuffer (const OpenGLBuffer &aOpenGLBuffer)=delete
OpenGLBuffer & operator= (const OpenGLBuffer &aOpenGLBuffer)=delete
OpenGLBuffer & operator= (OpenGLBuffer &&aOpenGLBuffer)=delete
void Initialize (const GLsizei aSize, const GLenum aUsage, const void *aData=nullptr)
 Initialize the buffer with the given size, usage, and optional data.
void Finalize ()
 Release the buffer resources.
void * Map (const GLbitfield aAccess) const
 Map the entire buffer with the specified access flags.
void * MapRange (const GLintptr aOffset, const GLsizeiptr aSize, const GLbitfield aAccess) const
 Map a sub-range of the buffer.
GLuint GetBufferId () const
 Get the OpenGL buffer object identifier.
Virtual functions
void WriteMemory (const size_t aOffset, const size_t aSize, const void *aData=nullptr) const final
 Write data into the buffer at a given offset.
void * Map (const size_t aOffset, size_t aSize) const final
 Map a region of the buffer into CPU-accessible memory.
void Unmap () const final
 Unmap a previously mapped buffer region.
size_t GetSize () const final
 Get the total size of the buffer in bytes.

Detailed Description

OpenGL GPU buffer wrapper implementing the Buffer interface.

Definition at line 26 of file OpenGLBuffer.hpp.

Constructor & Destructor Documentation

◆ OpenGLBuffer() [1/2]

AeonGames::OpenGLBuffer::OpenGLBuffer ( const GLsizei aSize,
const GLenum aUsage,
const void * aData = nullptr )

Construct from size, usage hint, and optional initial data.

Definition at line 26 of file OpenGLBuffer.cpp.

◆ OpenGLBuffer() [2/2]

AeonGames::OpenGLBuffer::OpenGLBuffer ( OpenGLBuffer && aOpenGLBuffer)

Move constructor.

Definition at line 45 of file OpenGLBuffer.cpp.

◆ ~OpenGLBuffer()

AeonGames::OpenGLBuffer::~OpenGLBuffer ( )

Definition at line 40 of file OpenGLBuffer.cpp.

Member Function Documentation

◆ Finalize()

void AeonGames::OpenGLBuffer::Finalize ( )

Release the buffer resources.

Definition at line 118 of file OpenGLBuffer.cpp.

◆ GetBufferId()

GLuint AeonGames::OpenGLBuffer::GetBufferId ( ) const

Get the OpenGL buffer object identifier.

Definition at line 52 of file OpenGLBuffer.cpp.

◆ GetSize()

size_t AeonGames::OpenGLBuffer::GetSize ( ) const
finalvirtual

Get the total size of the buffer in bytes.

Returns
Buffer size in bytes.

Implements AeonGames::Buffer.

Definition at line 100 of file OpenGLBuffer.cpp.

◆ Initialize()

void AeonGames::OpenGLBuffer::Initialize ( const GLsizei aSize,
const GLenum aUsage,
const void * aData = nullptr )

Initialize the buffer with the given size, usage, and optional data.

Definition at line 57 of file OpenGLBuffer.cpp.

◆ Map() [1/2]

void * AeonGames::OpenGLBuffer::Map ( const GLbitfield aAccess) const

Map the entire buffer with the specified access flags.

Definition at line 76 of file OpenGLBuffer.cpp.

◆ Map() [2/2]

void * AeonGames::OpenGLBuffer::Map ( const size_t aOffset,
size_t aSize ) const
finalvirtual

Map a region of the buffer into CPU-accessible memory.

Parameters
aOffsetByte offset of the region to map.
aSizeNumber of bytes to map.
Returns
Pointer to the mapped memory region.

Implements AeonGames::Buffer.

Definition at line 83 of file OpenGLBuffer.cpp.

◆ MapRange()

void * AeonGames::OpenGLBuffer::MapRange ( const GLintptr aOffset,
const GLsizeiptr aSize,
const GLbitfield aAccess ) const

Map a sub-range of the buffer.

Definition at line 87 of file OpenGLBuffer.cpp.

◆ Unmap()

void AeonGames::OpenGLBuffer::Unmap ( ) const
finalvirtual

Unmap a previously mapped buffer region.

Implements AeonGames::Buffer.

Definition at line 94 of file OpenGLBuffer.cpp.

◆ WriteMemory()

void AeonGames::OpenGLBuffer::WriteMemory ( const size_t aOffset,
const size_t aSize,
const void * aData = nullptr ) const
finalvirtual

Write data into the buffer at a given offset.

Parameters
aOffsetByte offset into the buffer to begin writing.
aSizeNumber of bytes to write.
aDataPointer to the source data, or nullptr to clear.

Implements AeonGames::Buffer.

Definition at line 64 of file OpenGLBuffer.cpp.


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