Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
Wrapper for the OpenGL function glDrawElements(). More...
#include <DrawElements.hpp>
Classes | |
| class | Triangle |
Public Member Functions | |
| virtual const char * | className () |
| Returns the name of the class. | |
| DrawElements (EPrimitiveType primitive=PT_TRIANGLES, int instances=1) | |
| DrawElements & | operator= (const DrawElements &other) |
| virtual ref< DrawCall > | clone () const |
| virtual unsigned int | handle () const |
| arr_type * | indices () |
| const arr_type * | indices () const |
| virtual void | updateVBOs (bool discard_local_data=false, bool force_update=false) |
| virtual void | deleteVBOs () |
| virtual void | clearLocalBuffer () |
| virtual void | render (bool use_vbo) const |
| 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. | |
Protected Attributes | |
| ref< arr_type > | mIndexBuffer |
Wrapper for the OpenGL function glDrawElements().
See also http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml for more information.
Features supported:
Use the functions setInstances() and instances() to use the multi instancing functionality. (requires OpenGL 3.1). For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glDrawElementsInstanced.xml
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 setBaseVertex() with a non zero argument 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/glDrawElementsBaseVertex.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 GLBufferObject and thus they can be stored locally or on the GPU. To gain direct access to the GLBufferObject use the indices() function.
Definition at line 118 of file DrawElements.hpp.
| vl::DrawElements< Tgltype, arr_type >::DrawElements | ( | EPrimitiveType | primitive = PT_TRIANGLES, |
| int | instances = 1 |
||
| ) | [inline] |
Definition at line 148 of file DrawElements.hpp.
Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::clone().
| virtual const char* vl::DrawElements< Tgltype, arr_type >::className | ( | ) | [inline, virtual] |
Returns the name of the class.
Reimplemented from vl::DrawCall.
Definition at line 146 of file DrawElements.hpp.
| DrawElements& vl::DrawElements< Tgltype, arr_type >::operator= | ( | const DrawElements< Tgltype, arr_type > & | other ) | [inline] |
Definition at line 159 of file DrawElements.hpp.
Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=().
| virtual ref<DrawCall> vl::DrawElements< Tgltype, arr_type >::clone | ( | ) | const [inline, virtual] |
Implements vl::DrawCall.
Definition at line 170 of file DrawElements.hpp.
| virtual unsigned int vl::DrawElements< Tgltype, arr_type >::handle | ( | ) | const [inline, virtual] |
Implements vl::DrawCall.
Definition at line 177 of file DrawElements.hpp.
Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render().
| arr_type* vl::DrawElements< Tgltype, arr_type >::indices | ( | ) | [inline] |
Definition at line 179 of file DrawElements.hpp.
Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::clearLocalBuffer(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::deleteVBOs(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::handle(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), vl::Geometry::sortVertices(), and vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::updateVBOs().
| const arr_type* vl::DrawElements< Tgltype, arr_type >::indices | ( | ) | const [inline] |
Definition at line 181 of file DrawElements.hpp.
| virtual void vl::DrawElements< Tgltype, arr_type >::updateVBOs | ( | bool | discard_local_data = false, |
| bool | force_update = false |
||
| ) | [inline, virtual] |
Implements vl::DrawCall.
Definition at line 183 of file DrawElements.hpp.
| virtual void vl::DrawElements< Tgltype, arr_type >::deleteVBOs | ( | ) | [inline, virtual] |
Implements vl::DrawCall.
Definition at line 189 of file DrawElements.hpp.
| virtual void vl::DrawElements< Tgltype, arr_type >::clearLocalBuffer | ( | ) | [inline, virtual] |
Definition at line 194 of file DrawElements.hpp.
| virtual void vl::DrawElements< Tgltype, arr_type >::render | ( | bool | use_vbo ) | const [inline, virtual] |
Implements vl::DrawCall.
Definition at line 199 of file DrawElements.hpp.
| TriangleIterator vl::DrawElements< Tgltype, arr_type >::triangleIterator | ( | ) | const [inline, 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 284 of file DrawElements.hpp.
| IndexIterator vl::DrawElements< Tgltype, 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 293 of file DrawElements.hpp.
ref< arr_type > vl::DrawElements< Tgltype, arr_type >::mIndexBuffer [protected] |
Definition at line 303 of file DrawElements.hpp.
Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indexIterator(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indices(), and vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::triangleIterator().