cangine
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
cangine::VBO Class Reference

Wraps an OpenGL Vertex Buffer Object. More...

#include <vbo.hpp>

Public Member Functions

 VBO ()
 Generates the underlying OpenGL buffer object.
 
 ~VBO ()
 Deletes the underlying OpenGL buffer object.
 
void bind () const
 Binds the buffer as the current array buffer.
 
void unbind () const
 Unbinds the current array buffer.
 
void update (const void *data, size_t size)
 Uploads raw vertex data to the buffer.
 

Private Attributes

unsigned int ID
 OpenGL buffer object handle.
 

Detailed Description

Wraps an OpenGL Vertex Buffer Object.

Holds raw vertex data on the GPU. Use VAO to describe how this data is laid out for the shader.

Constructor & Destructor Documentation

◆ VBO()

cangine::VBO::VBO ( )

Generates the underlying OpenGL buffer object.

◆ ~VBO()

cangine::VBO::~VBO ( )

Deletes the underlying OpenGL buffer object.

Member Function Documentation

◆ bind()

void cangine::VBO::bind ( ) const

Binds the buffer as the current array buffer.

◆ unbind()

void cangine::VBO::unbind ( ) const

Unbinds the current array buffer.

◆ update()

void cangine::VBO::update ( const void *  data,
size_t  size 
)

Uploads raw vertex data to the buffer.

Parameters
dataPointer to the raw vertex data.
sizeSize of the data in bytes.

Member Data Documentation

◆ ID

unsigned int cangine::VBO::ID
private

OpenGL buffer object handle.


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