# 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 >:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| MultiDrawElements (EPrimitiveType primitive=PT_TRIANGLES)
MultiDrawElements & | operator= (const MultiDrawElements &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.
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:

- multi instancing: NO
- base vertex: YES
- primitive restart: YES

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]`

Definition at line 128 of file MultiDrawElements.hpp.

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

## 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]`

Definition at line 137 of file MultiDrawElements.hpp.

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

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]`

Implements vl::DrawCall.

Definition at line 154 of file MultiDrawElements.hpp.

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

template<GLenum Tgltype, class arr_type>

arr_type* vl::MultiDrawElements< Tgltype, arr_type >::indices | ( | ) | `[inline]`

Definition at line 156 of file MultiDrawElements.hpp.

Referenced by vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::clearLocalBuffer(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::compute_pointer_vector(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::deleteVBOs(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::handle(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), and vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::updateVBOs().

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]`

Definition at line 280 of file MultiDrawElements.hpp.

Referenced by vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indexIterator(), vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indices(), and vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::MultiDrawElements().

template<GLenum Tgltype, class arr_type>

std::vector<const typename arr_type::scalar_type*> vl::MultiDrawElements< Tgltype, arr_type >::mPointerVector`[protected]`

Definition at line 281 of file MultiDrawElements.hpp.

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

template<GLenum Tgltype, class arr_type>

std::vector<const typename arr_type::scalar_type*> vl::MultiDrawElements< Tgltype, arr_type >::mNULLPointerVector`[protected]`

Definition at line 282 of file MultiDrawElements.hpp.

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

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/MultiDrawElements.hpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:42.
Permission is granted to use this page to write and publish articles regarding Visualization Library.