Clutter Engine 0.0.1
Loading...
Searching...
No Matches
clt::VertexArray Class Reference

Represents an OpenGL Vertex Array and its associated buffer. More...

#include <VertexArray.h>

Public Member Functions

 VertexArray (BufferUsage usage=BufferUsage::STATIC)
 Constructs an empty VertexArray with the specified usage.
 
 VertexArray (const float *pVertices, u32 pVerticeCount, BufferUsage usage=BufferUsage::STATIC)
 Constructs a VertexArray and uploads the provided vertex data.
 
 ~VertexArray ()
 Destructor. Releases OpenGL resources.
 
void Set (const float *pVertices, u32 pVerticeCount)
 Sets or updates the vertex data in the buffer.
 
void Bind ()
 Binds the vertex array for rendering.
 
void Unbind ()
 Unbinds the vertex array.
 
u32 GetVerticeCount () const
 Gets the number of vertices in the array.
 

Detailed Description

Represents an OpenGL Vertex Array and its associated buffer.

Constructor & Destructor Documentation

◆ VertexArray() [1/2]

clt::VertexArray::VertexArray ( BufferUsage usage = BufferUsage::STATIC)
inline

Constructs an empty VertexArray with the specified usage.

Parameters
usageThe buffer usage pattern.

◆ VertexArray() [2/2]

VertexArray::VertexArray ( const float * pVertices,
u32 pVerticeCount,
BufferUsage usage = BufferUsage::STATIC )

Constructs a VertexArray and uploads the provided vertex data.

Parameters
pVerticesPointer to the vertex data.
pVerticeCountNumber of vertices.
usageThe buffer usage pattern.

Member Function Documentation

◆ GetVerticeCount()

u32 clt::VertexArray::GetVerticeCount ( ) const
inline

Gets the number of vertices in the array.

Returns
The vertex count.

◆ Set()

void VertexArray::Set ( const float * pVertices,
u32 pVerticeCount )

Sets or updates the vertex data in the buffer.

Parameters
pVerticesPointer to the vertex data.
pVerticeCountNumber of vertices.

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