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

OpenGL vertex buffer object (VBO) abstraction. More...

#include <vertex_buffer.h>

Public Types

typedef std::shared_ptr< VertexBuffer const > ConstPtr
 
typedef std::shared_ptr< VertexBufferPtr
 

Public Member Functions

 ~VertexBuffer (void)
 
void bind (void)
 Binds the VBO.
 
GLsizeiptr get_byte_size (void) const
 Returns the amount of bytes of the VBO.
 
GLenum get_data_type (void) const
 Returns the data type of the VBO data.
 
GLsizei get_element_amount (void) const
 Returns the amount of elements (attributes or primitives).
 
GLsizei get_stride (void) const
 Returns the data stride.
 
GLint get_values_per_vertex (void) const
 Returns the amount of values per vertex.
 
GLenum get_vbo_target (void) const
 Returns the VBO target, e.g.
 
GLenum get_vbo_usage (void) const
 Returns the VBO usage flag.
 
void set_data (GLfloat const *data, GLsizei elems, GLint vpv)
 Sets data for the VBO: amount of elements and values per vertex.
 
void set_data (GLubyte const *data, GLsizei elems, GLint vpv)
 Sets data for the VBO: amount of elements and values per vertex.
 
void set_indices (GLuint const *data, GLsizei num_indices)
 Sets index data for the VBO.
 
void set_stride (GLsizei stride)
 Sets the data stride, i.e.
 
void set_usage (GLenum usage)
 Sets the VBO usage flag.
 

Static Public Member Functions

static Ptr create (void)
 

Detailed Description

OpenGL vertex buffer object (VBO) abstraction.

A vertex buffer object stores large chunks of data, for example per-vertex attributes such as positions, normals or colors or primitive connectivity such as triangle index lists. Instances of this class may be plugged in vertex arrays to efficiently render more complex objects such as point sets or meshes.

Definition at line 30 of file vertex_buffer.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 34 of file vertex_buffer.h.

◆ Ptr

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

Definition at line 33 of file vertex_buffer.h.

Constructor & Destructor Documentation

◆ ~VertexBuffer()

ogl::VertexBuffer::~VertexBuffer ( void  )
inline

Definition at line 94 of file vertex_buffer.h.

Member Function Documentation

◆ bind()

void ogl::VertexBuffer::bind ( void  )
inline

Binds the VBO.

Definition at line 161 of file vertex_buffer.h.

◆ create()

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

Definition at line 101 of file vertex_buffer.h.

◆ get_byte_size()

GLsizeiptr ogl::VertexBuffer::get_byte_size ( void  ) const
inline

Returns the amount of bytes of the VBO.

Definition at line 137 of file vertex_buffer.h.

◆ get_data_type()

GLenum ogl::VertexBuffer::get_data_type ( void  ) const
inline

Returns the data type of the VBO data.

Definition at line 155 of file vertex_buffer.h.

◆ get_element_amount()

GLsizei ogl::VertexBuffer::get_element_amount ( void  ) const
inline

Returns the amount of elements (attributes or primitives).

Definition at line 143 of file vertex_buffer.h.

◆ get_stride()

GLsizei ogl::VertexBuffer::get_stride ( void  ) const
inline

Returns the data stride.

Definition at line 125 of file vertex_buffer.h.

◆ get_values_per_vertex()

GLint ogl::VertexBuffer::get_values_per_vertex ( void  ) const
inline

Returns the amount of values per vertex.

Definition at line 131 of file vertex_buffer.h.

◆ get_vbo_target()

GLenum ogl::VertexBuffer::get_vbo_target ( void  ) const
inline

Returns the VBO target, e.g.

ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.

Definition at line 119 of file vertex_buffer.h.

◆ get_vbo_usage()

GLenum ogl::VertexBuffer::get_vbo_usage ( void  ) const
inline

Returns the VBO usage flag.

Definition at line 149 of file vertex_buffer.h.

◆ set_data() [1/2]

void ogl::VertexBuffer::set_data ( GLfloat const *  data,
GLsizei  elems,
GLint  vpv 
)

Sets data for the VBO: amount of elements and values per vertex.

Definition at line 30 of file vertex_buffer.cc.

◆ set_data() [2/2]

void ogl::VertexBuffer::set_data ( GLubyte const *  data,
GLsizei  elems,
GLint  vpv 
)

Sets data for the VBO: amount of elements and values per vertex.

Definition at line 46 of file vertex_buffer.cc.

◆ set_indices()

void ogl::VertexBuffer::set_indices ( GLuint const *  data,
GLsizei  num_indices 
)

Sets index data for the VBO.

Triangles are assumed, i.e. vpv = 3.

Definition at line 62 of file vertex_buffer.cc.

◆ set_stride()

void ogl::VertexBuffer::set_stride ( GLsizei  stride)
inline

Sets the data stride, i.e.

bytes between subsequent values. Call this before setting data to create proper vertex buffer.

Definition at line 107 of file vertex_buffer.h.

◆ set_usage()

void ogl::VertexBuffer::set_usage ( GLenum  usage)
inline

Sets the VBO usage flag.

GL_STATIC_DRAW is default. Call this before setting data to create proper vertex buffer.

Definition at line 113 of file vertex_buffer.h.


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