MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
ogl::VertexArray Class Reference

OpenGL vertex array object abstraction. More...

#include <vertex_array.h>

Public Types

typedef std::pair< VertexBuffer::Ptr, std::string > BoundVBO
 
typedef std::shared_ptr< VertexArray const > ConstPtr
 
typedef std::shared_ptr< VertexArrayPtr
 
typedef std::vector< BoundVBOVBOList
 

Public Member Functions

virtual ~VertexArray (void)
 
void add_vbo (VertexBuffer::Ptr vbo, std::string const &name)
 Adds a generic VBO with attribute name.
 
void draw (void)
 Binds the shader and issues drawing commands.
 
void remove_vbo (std::string const &name)
 Removes a VBO from the list.
 
void reset_vertex_array (void)
 Removes VBOs and creates a new vertex array.
 
void set_index_vbo (VertexBuffer::Ptr vbo)
 Sets the vertex indices VBO with triangle definitions.
 
void set_primitive (GLuint primitive)
 Sets the primitive type to be used with the corresponding draw call.
 
void set_shader (ShaderProgram::Ptr shader)
 Assigns a shader that is used for drawing the vertex array.
 
void set_vertex_vbo (VertexBuffer::Ptr vbo)
 Sets the vertex VBO with vertex positions.
 

Static Public Member Functions

static Ptr create (void)
 

Protected Member Functions

 VertexArray (void)
 
void assign_attrib (BoundVBO const &bound_vbo)
 

Detailed Description

OpenGL vertex array object abstraction.

Vertex buffer objects (VBOs) may be plugged into this class to compose more complex objects such as colored point sets or meshes with generic per-vertex attributes. Per-vertex attributes are named and automatically associated with shader input variables.

Definition at line 34 of file vertex_array.h.

Member Typedef Documentation

◆ BoundVBO

typedef std::pair<VertexBuffer::Ptr, std::string> ogl::VertexArray::BoundVBO

Definition at line 40 of file vertex_array.h.

◆ ConstPtr

typedef std::shared_ptr<VertexArray const> ogl::VertexArray::ConstPtr

Definition at line 38 of file vertex_array.h.

◆ Ptr

typedef std::shared_ptr<VertexArray> ogl::VertexArray::Ptr

Definition at line 37 of file vertex_array.h.

◆ VBOList

typedef std::vector<BoundVBO> ogl::VertexArray::VBOList

Definition at line 41 of file vertex_array.h.

Constructor & Destructor Documentation

◆ ~VertexArray()

ogl::VertexArray::~VertexArray ( void  )
inlinevirtual

Definition at line 97 of file vertex_array.h.

◆ VertexArray()

ogl::VertexArray::VertexArray ( void  )
inlineprotected

Definition at line 89 of file vertex_array.h.

Member Function Documentation

◆ add_vbo()

void ogl::VertexArray::add_vbo ( VertexBuffer::Ptr  vbo,
std::string const &  name 
)
inline

Adds a generic VBO with attribute name.

Definition at line 128 of file vertex_array.h.

◆ assign_attrib()

void ogl::VertexArray::assign_attrib ( BoundVBO const &  bound_vbo)
protected

Definition at line 36 of file vertex_array.cc.

◆ create()

VertexArray::Ptr ogl::VertexArray::create ( void  )
inlinestatic

Definition at line 104 of file vertex_array.h.

◆ draw()

void ogl::VertexArray::draw ( void  )

Binds the shader and issues drawing commands.

Definition at line 56 of file vertex_array.cc.

◆ remove_vbo()

void ogl::VertexArray::remove_vbo ( std::string const &  name)

Removes a VBO from the list.

Definition at line 26 of file vertex_array.cc.

◆ reset_vertex_array()

void ogl::VertexArray::reset_vertex_array ( void  )
inline

Removes VBOs and creates a new vertex array.

Definition at line 134 of file vertex_array.h.

◆ set_index_vbo()

void ogl::VertexArray::set_index_vbo ( VertexBuffer::Ptr  vbo)
inline

Sets the vertex indices VBO with triangle definitions.

Definition at line 122 of file vertex_array.h.

◆ set_primitive()

void ogl::VertexArray::set_primitive ( GLuint  primitive)
inline

Sets the primitive type to be used with the corresponding draw call.

Definition at line 110 of file vertex_array.h.

◆ set_shader()

void ogl::VertexArray::set_shader ( ShaderProgram::Ptr  shader)
inline

Assigns a shader that is used for drawing the vertex array.

Definition at line 147 of file vertex_array.h.

◆ set_vertex_vbo()

void ogl::VertexArray::set_vertex_vbo ( VertexBuffer::Ptr  vbo)
inline

Sets the vertex VBO with vertex positions.

Definition at line 116 of file vertex_array.h.


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