HPC_Voxel_Engine 0.2.0
High-Performance C++ Voxel Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Renderer::VertexArray Class Reference

Wrapper for OpenGL VAO (Vertex Array Object). Stores the configuration of vertex attributes (layout) and binds VBOs to shader inputs. More...

#include <src/renderer/VertexArray.h>

Collaboration diagram for Renderer::VertexArray:
Collaboration graph

Public Member Functions

 VertexArray ()
 
 ~VertexArray ()
 
 VertexArray (const VertexArray &)=delete
 
VertexArrayoperator= (const VertexArray &)=delete
 
void Bind () const
 
void Unbind () const
 
void LinkAttribute (const VertexBuffer &vbo, unsigned int iLayoutIndex, int iNumComponents, int iStride, int iOffset) const
 Configures a vertex attribute layout.
 
void AttachIndexBuffer (const IndexBuffer &ibo) const
 Attaches an IndexBuffer to this VAO using DSA.
 

Public Attributes

unsigned int m_RendererID
 

Detailed Description

Wrapper for OpenGL VAO (Vertex Array Object). Stores the configuration of vertex attributes (layout) and binds VBOs to shader inputs.

Constructor & Destructor Documentation

◆ VertexArray() [1/2]

Renderer::VertexArray::VertexArray ( )
inline

◆ ~VertexArray()

Renderer::VertexArray::~VertexArray ( )
inline

◆ VertexArray() [2/2]

Renderer::VertexArray::VertexArray ( const VertexArray )
delete

Member Function Documentation

◆ AttachIndexBuffer()

void Renderer::VertexArray::AttachIndexBuffer ( const IndexBuffer ibo) const
inline

Attaches an IndexBuffer to this VAO using DSA.

Parameters
iboThe IndexBuffer to attach.
Here is the caller graph for this function:

◆ Bind()

void Renderer::VertexArray::Bind ( ) const
inline
Here is the caller graph for this function:

◆ LinkAttribute()

void Renderer::VertexArray::LinkAttribute ( const VertexBuffer vbo,
unsigned int  iLayoutIndex,
int  iNumComponents,
int  iStride,
int  iOffset 
) const
inline

Configures a vertex attribute layout.

Parameters
vboThe VertexBuffer to read from.
iLayoutIndexShader layout location (e.g., layout(location = 0)).
iNumComponentsNumber of components per vertex (e.g., 3 for vec3).
iStrideTotal number of FLOATS between vertices.
iOffsetNumber of FLOATS to skip to reach this attribute.
Here is the caller graph for this function:

◆ operator=()

VertexArray & Renderer::VertexArray::operator= ( const VertexArray )
delete

◆ Unbind()

void Renderer::VertexArray::Unbind ( ) const
inline
Here is the caller graph for this function:

Member Data Documentation

◆ m_RendererID

unsigned int Renderer::VertexArray::m_RendererID

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