Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wrapper for the OpenGL function glMultiDrawElements(). More...
#include <MultiDrawElements.hpp>
Public Types | |
typedef arr_type::scalar_type | index_type |
Public Member Functions | |
virtual unsigned int | primitiveRestartIndex () |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported. | |
MultiDrawElements (EPrimitiveType primitive=PT_TRIANGLES) | |
MultiDrawElements & | operator= (const MultiDrawElements &other) |
virtual ref< DrawCall > | clone () const |
Returns a clone of the draw call. | |
void | setIndexBuffer (arr_type *index_buffer) |
arr_type * | indexBuffer () |
const arr_type * | indexBuffer () const |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode mode) |
Updates the index buffer's BufferObject if marked as dirty. | |
virtual void | deleteBufferObject () |
Deletes the index buffer's BufferObject. | |
virtual void | render (bool use_bo) const |
Executes the draw call. | |
TriangleIterator | triangleIterator () const |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall. | |
IndexIterator | indexIterator () const |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall. | |
const std::vector< const index_type * > & | pointerVector () const |
The pointer vector used as 'indices' parameter of glMultiDrawElements when NOT using BufferObjects. | |
std::vector< const index_type * > & | pointerVector () |
The pointer vector used as 'indices' parameter of glMultiDrawElements when NOT using BufferObjects. | |
const std::vector< const index_type * > & | bufferObjectPointerVector () const |
The pointer vector used as 'indices' parameter of glMultiDrawElements when using BufferObjects. | |
std::vector< const index_type * > & | bufferObjectPointerVector () |
The pointer vector used as 'indices' parameter of glMultiDrawElements when using BufferObjects. | |
void | computePointerVector () |
Computes pointerVector() based on the values contained on countVector(). | |
void | computeBufferObjectPointerVector () |
Computes bufferObjectPointerVector() based on the values contained in pointerVector(). | |
Static Public Attributes | |
static const index_type | primitive_restart_index = index_type(~0) |
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for GLubyte, GLushort, GLuint index types. */. | |
Protected Attributes | |
ref< arr_type > | mIndexBuffer |
std::vector< const index_type * > | mPointerVector |
std::vector< const index_type * > | mBufferObjectPointerVector |
Wrapper for the OpenGL function glMultiDrawElements().
See vl::DrawCall for an overview of the different draw call methods.
This class wraps the following OpenGL functions:
Supports:
Use the functions setPrimitiveRestartIndex() and setPrimitiveRestartEnabled() to use the primitive restart functionality (requires OpenGL 3.1). For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glPrimitiveRestartIndex.xml
Use the function setBaseVertices() to use the base vertex functionality. Requires OpenGL 3.2 or GL_ARB_draw_elements_base_vertex. For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glMultiDrawElementsBaseVertex.xml
DrawElements, MultiDrawElements, DrawRangeElements, DrawArrays are used by Geometry to define a set of primitives to be rendered, see Geometry::drawCalls(). The indices are stored in a BufferObject and thus they can be stored locally or on the GPU. To gain direct access to the BufferObject use the indexBuffer() function.
DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements are used by Geometry to define a set of primitives to be rendered.
Definition at line 151 of file MultiDrawElements.hpp.
typedef arr_type::scalar_type vl::MultiDrawElements< arr_type >::index_type |
Definition at line 156 of file MultiDrawElements.hpp.
vl::MultiDrawElements< arr_type >::MultiDrawElements | ( | EPrimitiveType | primitive = PT_TRIANGLES ) |
[inline] |
Definition at line 162 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::clone().
virtual unsigned int vl::MultiDrawElements< arr_type >::primitiveRestartIndex | ( | ) | [inline, virtual] |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported.
Reimplemented from vl::DrawCall.
Definition at line 159 of file MultiDrawElements.hpp.
MultiDrawElements& vl::MultiDrawElements< arr_type >::operator= | ( | const MultiDrawElements< arr_type > & | other ) | [inline] |
Definition at line 170 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::operator=().
virtual ref<DrawCall> vl::MultiDrawElements< arr_type >::clone | ( | ) | const [inline, virtual] |
Returns a clone of the draw call.
Implements vl::DrawCall.
Definition at line 179 of file MultiDrawElements.hpp.
void vl::MultiDrawElements< arr_type >::setIndexBuffer | ( | arr_type * | index_buffer ) | [inline] |
Definition at line 186 of file MultiDrawElements.hpp.
arr_type* vl::MultiDrawElements< arr_type >::indexBuffer | ( | ) | [inline] |
Definition at line 188 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::computeBufferObjectPointerVector(), vl::MultiDrawElements< ArrayUShort1 >::computePointerVector(), vl::MultiDrawElements< ArrayUShort1 >::deleteBufferObject(), vl::VLXClassWrapper_DrawCall::exportDrawCall(), vl::MultiDrawElements< ArrayUShort1 >::operator=(), vl::MultiDrawElements< ArrayUShort1 >::render(), and vl::MultiDrawElements< ArrayUShort1 >::updateDirtyBufferObject().
const arr_type* vl::MultiDrawElements< arr_type >::indexBuffer | ( | ) | const [inline] |
Definition at line 190 of file MultiDrawElements.hpp.
virtual void vl::MultiDrawElements< arr_type >::updateDirtyBufferObject | ( | EBufferObjectUpdateMode | ) | [inline, virtual] |
Updates the index buffer's BufferObject if marked as dirty.
Implements vl::DrawCall.
Definition at line 192 of file MultiDrawElements.hpp.
virtual void vl::MultiDrawElements< arr_type >::deleteBufferObject | ( | ) | [inline, virtual] |
Deletes the index buffer's BufferObject.
Implements vl::DrawCall.
Definition at line 198 of file MultiDrawElements.hpp.
virtual void vl::MultiDrawElements< arr_type >::render | ( | bool | use_bo ) | const [inline, virtual] |
Executes the draw call.
Implements vl::DrawCall.
Definition at line 203 of file MultiDrawElements.hpp.
TriangleIterator vl::MultiDrawElements< arr_type >::triangleIterator | ( | ) | const [virtual] |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall.
Basically the iterator tesselates in triangles any DrawCall of type: PT_TRIANGLES, PT_TRIANGLE_STRIP PT_TRIANGLE_FAN, PT_POLYGON, PT_QUADS, PT_QUAD_STRIP.
Implements vl::DrawCall.
Definition at line 363 of file MultiDrawElements.hpp.
References vl::ref< T >::get().
IndexIterator vl::MultiDrawElements< arr_type >::indexIterator | ( | ) | const [inline, virtual] |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
This
Implements vl::DrawCall.
Definition at line 266 of file MultiDrawElements.hpp.
const std::vector<const index_type*>& vl::MultiDrawElements< arr_type >::pointerVector | ( | ) | const [inline] |
The pointer vector used as 'indices' parameter of glMultiDrawElements when NOT using BufferObjects.
Automatically computed when calling setCountVector(). If you need to modify this manually then you also have to modify the bufferObjectPointerVector.
Definition at line 277 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::render().
std::vector<const index_type*>& vl::MultiDrawElements< arr_type >::pointerVector | ( | ) | [inline] |
The pointer vector used as 'indices' parameter of glMultiDrawElements when NOT using BufferObjects.
Definition at line 280 of file MultiDrawElements.hpp.
const std::vector<const index_type*>& vl::MultiDrawElements< arr_type >::bufferObjectPointerVector | ( | ) | const [inline] |
The pointer vector used as 'indices' parameter of glMultiDrawElements when using BufferObjects.
Definition at line 283 of file MultiDrawElements.hpp.
std::vector<const index_type*>& vl::MultiDrawElements< arr_type >::bufferObjectPointerVector | ( | ) | [inline] |
The pointer vector used as 'indices' parameter of glMultiDrawElements when using BufferObjects.
Definition at line 286 of file MultiDrawElements.hpp.
void vl::MultiDrawElements< arr_type >::computePointerVector | ( | ) | [inline, virtual] |
Computes pointerVector() based on the values contained on countVector().
Implements vl::MultiDrawElementsBase.
Definition at line 289 of file MultiDrawElements.hpp.
void vl::MultiDrawElements< arr_type >::computeBufferObjectPointerVector | ( | ) | [inline, virtual] |
Computes bufferObjectPointerVector() based on the values contained in pointerVector().
Implements vl::MultiDrawElementsBase.
Definition at line 302 of file MultiDrawElements.hpp.
const index_type vl::MultiDrawElements< arr_type >::primitive_restart_index = index_type(~0) [static] |
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for GLubyte, GLushort, GLuint index types. */.
Definition at line 158 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::indexIterator(), vl::MultiDrawElements< ArrayUShort1 >::primitiveRestartIndex(), and vl::MultiDrawElements< ArrayUShort1 >::render().
ref< arr_type > vl::MultiDrawElements< arr_type >::mIndexBuffer [protected] |
std::vector<const index_type*> vl::MultiDrawElements< arr_type >::mPointerVector [protected] |
Definition at line 317 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::computeBufferObjectPointerVector(), vl::MultiDrawElements< ArrayUShort1 >::computePointerVector(), vl::MultiDrawElements< ArrayUShort1 >::pointerVector(), and vl::MultiDrawElements< ArrayUShort1 >::render().
std::vector<const index_type*> vl::MultiDrawElements< arr_type >::mBufferObjectPointerVector [protected] |
Definition at line 318 of file MultiDrawElements.hpp.
Referenced by vl::MultiDrawElements< ArrayUShort1 >::bufferObjectPointerVector(), vl::MultiDrawElements< ArrayUShort1 >::computeBufferObjectPointerVector(), and vl::MultiDrawElements< ArrayUShort1 >::render().