Claire's Game Engine
Full C++ Engine using OpenGL
Loading...
Searching...
No Matches
VertexArray Class Reference

VertexArray is a class that encapsulates an OpenGL Vertex Array Object (VAO) and its associated buffers. It handles the creation and management of vertex buffers and index buffers, along with setting up the appropriate vertex attributes for rendering. This class is used to store and manage vertex data in memory for rendering purposes in OpenGL. More...

#include <VertexArray.h>

Public Member Functions

 VertexArray (const float *pVertices, unsigned int pVerticeCount)
 Constructor for VertexArray. Initializes and creates a vertex array object (VAO) and its associated buffers using the provided vertex data.
 
 ~VertexArray ()
 Destructor for VertexArray. Cleans up and deletes the VAO and buffers from OpenGL memory.
 
void SetActive ()
 Binds the vertex array to be the current active vertex array in OpenGL.
 
unsigned int GetVerticeCount () const
 Gets the count of vertices in the vertex array.
 

Detailed Description

VertexArray is a class that encapsulates an OpenGL Vertex Array Object (VAO) and its associated buffers. It handles the creation and management of vertex buffers and index buffers, along with setting up the appropriate vertex attributes for rendering. This class is used to store and manage vertex data in memory for rendering purposes in OpenGL.

Constructor & Destructor Documentation

◆ VertexArray()

VertexArray::VertexArray ( const float * pVertices,
unsigned int pVerticeCount )

Constructor for VertexArray. Initializes and creates a vertex array object (VAO) and its associated buffers using the provided vertex data.

Parameters
pVerticesA pointer to an array of vertex data.
pVerticeCountThe number of vertices in the array.

◆ ~VertexArray()

VertexArray::~VertexArray ( )

Destructor for VertexArray. Cleans up and deletes the VAO and buffers from OpenGL memory.

Member Function Documentation

◆ GetVerticeCount()

unsigned int VertexArray::GetVerticeCount ( ) const

Gets the count of vertices in the vertex array.

Returns
The number of vertices stored in the vertex array.

◆ SetActive()

void VertexArray::SetActive ( )

Binds the vertex array to be the current active vertex array in OpenGL.


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