Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vl::MultiDrawElements< Tgltype, arr_type > Class Template Reference

Wrapper for the OpenGL function glMultiDrawElements(). More...

#include <MultiDrawElements.hpp>

Inheritance diagram for vl::MultiDrawElements< Tgltype, arr_type >:
vl::MultiDrawElementsBase vl::DrawCall vl::Object

List of all members.

Public Member Functions

virtual const char * className ()
 Returns the name of the class.
 MultiDrawElements (EPrimitiveType primitive=PT_TRIANGLES)
MultiDrawElementsoperator= (const MultiDrawElements &other)
virtual ref< DrawCallclone () 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.
const std::vector< const
typename arr_type::scalar_type * > & 
pointerVector () const
 The pointer vector used as 'indices' parameter of glMultiDrawElements.

Protected Member Functions

void compute_pointer_vector ()

Protected Attributes

ref< arr_type > mIndexBuffer
std::vector< const typename
arr_type::scalar_type * > 
mPointerVector
std::vector< const typename
arr_type::scalar_type * > 
mNULLPointerVector

Detailed Description

template<GLenum Tgltype, class arr_type>
class vl::MultiDrawElements< Tgltype, arr_type >

Wrapper for the OpenGL function glMultiDrawElements().

See also http://www.opengl.org/sdk/docs/man/xhtml/glMultiDrawElements.xml for more information.

Features supported:

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 GLBufferObject and thus they can be stored locally or on the GPU. To gain direct access to the GLBufferObject use the indices() function.

See also:
DrawCall, DrawElements, DrawRangeElements, DrawArrays, Geometry, Actor

Definition at line 123 of file MultiDrawElements.hpp.


Constructor & Destructor Documentation

template<GLenum Tgltype, class arr_type>
vl::MultiDrawElements< Tgltype, arr_type >::MultiDrawElements ( EPrimitiveType  primitive = PT_TRIANGLES ) [inline]

Member Function Documentation

template<GLenum Tgltype, class arr_type>
virtual const char* vl::MultiDrawElements< Tgltype, arr_type >::className (  ) [inline, virtual]

Returns the name of the class.

Reimplemented from vl::DrawCall.

Definition at line 126 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
MultiDrawElements& vl::MultiDrawElements< Tgltype, arr_type >::operator= ( const MultiDrawElements< Tgltype, arr_type > &  other ) [inline]
template<GLenum Tgltype, class arr_type>
virtual ref<DrawCall> vl::MultiDrawElements< Tgltype, arr_type >::clone (  ) const [inline, virtual]

Implements vl::DrawCall.

Definition at line 147 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
virtual unsigned int vl::MultiDrawElements< Tgltype, arr_type >::handle (  ) const [inline, virtual]
template<GLenum Tgltype, class arr_type>
arr_type* vl::MultiDrawElements< Tgltype, arr_type >::indices (  ) [inline]
template<GLenum Tgltype, class arr_type>
const arr_type* vl::MultiDrawElements< Tgltype, arr_type >::indices (  ) const [inline]

Definition at line 158 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
virtual void vl::MultiDrawElements< Tgltype, arr_type >::updateVBOs ( bool  discard_local_data = false,
bool  force_update = false 
) [inline, virtual]

Implements vl::DrawCall.

Definition at line 160 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
virtual void vl::MultiDrawElements< Tgltype, arr_type >::deleteVBOs (  ) [inline, virtual]

Implements vl::DrawCall.

Definition at line 166 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
virtual void vl::MultiDrawElements< Tgltype, arr_type >::clearLocalBuffer (  ) [inline, virtual]

Definition at line 171 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
virtual void vl::MultiDrawElements< Tgltype, arr_type >::render ( bool  use_vbo ) const [inline, virtual]

Implements vl::DrawCall.

Definition at line 176 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type >
TriangleIterator vl::MultiDrawElements< Tgltype, 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 312 of file MultiDrawElements.hpp.

References vl::ref< T >::get().

template<GLenum Tgltype, class arr_type>
IndexIterator vl::MultiDrawElements< Tgltype, arr_type >::indexIterator (  ) const [inline, virtual]

Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.

This

Note:
The returned indices already take into account primitive restart and base vertex.

Implements vl::DrawCall.

Definition at line 249 of file MultiDrawElements.hpp.

template<GLenum Tgltype, class arr_type>
const std::vector<const typename arr_type::scalar_type*>& vl::MultiDrawElements< Tgltype, arr_type >::pointerVector (  ) const [inline]

The pointer vector used as 'indices' parameter of glMultiDrawElements.

Definition at line 259 of file MultiDrawElements.hpp.

Referenced by vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render().

template<GLenum Tgltype, class arr_type>
void vl::MultiDrawElements< Tgltype, arr_type >::compute_pointer_vector (  ) [inline, protected, virtual]

Implements vl::MultiDrawElementsBase.

Definition at line 262 of file MultiDrawElements.hpp.


Member Data Documentation

template<GLenum Tgltype, class arr_type>
ref< arr_type > vl::MultiDrawElements< Tgltype, arr_type >::mIndexBuffer [protected]
template<GLenum Tgltype, class arr_type>
std::vector<const typename arr_type::scalar_type*> vl::MultiDrawElements< Tgltype, arr_type >::mPointerVector [protected]
template<GLenum Tgltype, class arr_type>
std::vector<const typename arr_type::scalar_type*> vl::MultiDrawElements< Tgltype, arr_type >::mNULLPointerVector [protected]

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

Visualization Library v2011.05.1144 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Tue Sep 13 2011 21:59:15.
Permission is granted to use this page to write and publish articles regarding Visualization Library.