AireEngine
A 3D Open-World Game Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Aire::VertexArrayObject Class Reference

#include <vao.h>

Public Member Functions

 VertexArrayObject ()
 Create a new VAO.
 
void bindVAO ()
 Bind the VAO for rendering.
 
void unbindVAO ()
 Unbind the VAO.
 
void addAttribF (GLuint attribIdx, GLint size, GLenum type, GLuint relativeOffset, GLboolean normalized=GL_FALSE, bool enabled=true, bool autoBind=true)
 
void addAttribI (GLuint attribIdx, GLint size, GLenum type, GLuint relativeOffset, bool enabled=true, bool autoBind=true)
 
void addAttribL (GLuint attribIdx, GLint size, GLuint relativeOffset, bool enabled=true, bool autoBind=true)
 
void bindAttrib (GLuint attribIdx, GLuint bindingPointIdx)
 
void enableAttrib (GLuint attribIdx)
 
void disableAttrib (GLuint attribIdx)
 
GLuint getHandle () const
 
 VertexArrayObject (const VertexArrayObject &)=delete
 
VertexArrayObjectoperator= (const VertexArrayObject &)=delete
 

Detailed Description

A wrapper over an OpenGL VAO. Used to simplify VAO setup and to provide automatic clean-up.

Member Function Documentation

◆ bindAttrib()

void Aire::VertexArrayObject::bindAttrib ( GLuint attribIdx,
GLuint bindingPointIdx )
inline

Bind an attribute to a given binding point. Vertex buffers can then be bound to this binding point. For convenience, it is advisable to always set the binding point to be the same as the attribute index.

Parameters
attribIdxThe attribute index to be bound. Corresponds to the index set in the shader with location specifier.
bindingPointIdxAn arbitrarily chosen index that will be associated with the attribute. VBO then needs to bind to the same index.

◆ disableAttrib()

void Aire::VertexArrayObject::disableAttrib ( GLuint attribIdx)
inline

Disable a given attribute.

Parameters
attribIdxAttribute index of the attribute to disable.

◆ enableAttrib()

void Aire::VertexArrayObject::enableAttrib ( GLuint attribIdx)
inline

Enable a given attribute.

Parameters
attribIdxAttribute index of the attribute to enable.

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