lmgl 1.0.0
A lightweight OpenGL graphics engine library written in C++
Loading...
Searching...
No Matches
lmgl::renderer::IndexBuffer Class Reference

Manages an index buffer in OpenGL. More...

#include <buffer.hpp>

Public Member Functions

 IndexBuffer (const unsigned int *indices, unsigned int count)
 Constructor for the IndexBuffer.
 
 ~IndexBuffer ()
 Destructor for the IndexBuffer.
 
void bind () const
 Bind the index buffer.
 
void unbind () const
 Unbind the index buffer.
 
unsigned int get_count () const
 Get the count of indices in the buffer.
 

Detailed Description

Manages an index buffer in OpenGL.

This class encapsulates the creation, binding, and management of an index buffer. It stores indices used for indexed drawing and provides methods to bind and unbind the buffer as well as retrieve the count of indices.

Note
The buffer is identified by a renderer ID assigned by OpenGL.

Constructor & Destructor Documentation

◆ IndexBuffer()

lmgl::renderer::IndexBuffer::IndexBuffer ( const unsigned int * indices,
unsigned int count )

Constructor for the IndexBuffer.

Initializes the index buffer with the provided indices and count.

Parameters
indicesPointer to the index data.
countNumber of indices.

Member Function Documentation

◆ bind()

void lmgl::renderer::IndexBuffer::bind ( ) const

Bind the index buffer.

Activates the index buffer for subsequent rendering operations.

◆ get_count()

unsigned int lmgl::renderer::IndexBuffer::get_count ( ) const
inline

Get the count of indices in the buffer.

Returns the number of indices stored in the index buffer.

Returns
Number of indices.

◆ unbind()

void lmgl::renderer::IndexBuffer::unbind ( ) const

Unbind the index buffer.

Deactivates the index buffer.


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