MVE - Multi-View Environment mve-devel
|
OpenGL vertex buffer object (VBO) abstraction. More...
#include <vertex_buffer.h>
Public Types | |
typedef std::shared_ptr< VertexBuffer const > | ConstPtr |
typedef std::shared_ptr< VertexBuffer > | Ptr |
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) |
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.
typedef std::shared_ptr<VertexBuffer const> ogl::VertexBuffer::ConstPtr |
Definition at line 34 of file vertex_buffer.h.
typedef std::shared_ptr<VertexBuffer> ogl::VertexBuffer::Ptr |
Definition at line 33 of file vertex_buffer.h.
|
inline |
Definition at line 94 of file vertex_buffer.h.
|
inline |
Binds the VBO.
Definition at line 161 of file vertex_buffer.h.
|
inlinestatic |
Definition at line 101 of file vertex_buffer.h.
|
inline |
Returns the amount of bytes of the VBO.
Definition at line 137 of file vertex_buffer.h.
|
inline |
Returns the data type of the VBO data.
Definition at line 155 of file vertex_buffer.h.
|
inline |
Returns the amount of elements (attributes or primitives).
Definition at line 143 of file vertex_buffer.h.
|
inline |
Returns the data stride.
Definition at line 125 of file vertex_buffer.h.
|
inline |
Returns the amount of values per vertex.
Definition at line 131 of file vertex_buffer.h.
|
inline |
Returns the VBO target, e.g.
ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
Definition at line 119 of file vertex_buffer.h.
|
inline |
Returns the VBO usage flag.
Definition at line 149 of file vertex_buffer.h.
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.
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.
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.
|
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.
|
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.