# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Classes | Public Member Functions | Protected Attributes

# vl::DrawRangeElements< index_type, Tgltype, arr_type > Class Template Reference

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

`#include <DrawRangeElements.hpp>`

Inheritance diagram for vl::DrawRangeElements< index_type, Tgltype, arr_type >:

List of all members.

## Classes

class | Triangle

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| DrawRangeElements (EPrimitiveType primitive=PT_TRIANGLES, int r_start=0, int r_end=index_type(~0))
DrawRangeElements & | operator= (const DrawRangeElements &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.
void | computeRange ()

## Protected Attributes

ref< arr_type > | mIndexBuffer

## Detailed Description

### template<typename index_type, GLenum Tgltype, class arr_type>
class vl::DrawRangeElements< index_type, Tgltype, arr_type >

Wrapper for the OpenGL function glDrawRangeElements().

See also http://www.opengl.org/sdk/docs/man3/xhtml/glDrawRangeElements.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 setBaseVertex() 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/glDrawRangeElementsBaseVertex.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, MultiDrawElements, DrawArrays, Geometry, Actor

Definition at line 122 of file DrawRangeElements.hpp.

## Constructor & Destructor Documentation

template<typename index_type, GLenum Tgltype, class arr_type>

vl::DrawRangeElements< index_type, Tgltype, arr_type >::DrawRangeElements | ( | EPrimitiveType | primitive = `PT_TRIANGLES`,
|  | int | r_start = `0`,
|  | int | r_end = `index_type(~0)`
| ) |  | `[inline]`

Definition at line 152 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::clone().

## Member Function Documentation

template<typename index_type, GLenum Tgltype, class arr_type>

virtual const char* vl::DrawRangeElements< index_type, Tgltype, arr_type >::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::DrawCall.

Definition at line 150 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

DrawRangeElements& vl::DrawRangeElements< index_type, Tgltype, arr_type >::operator= | ( | const DrawRangeElements< index_type, Tgltype, arr_type > & | other ) | `[inline]`

Definition at line 164 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::operator=().

template<typename index_type, GLenum Tgltype, class arr_type>

virtual ref<DrawCall> vl::DrawRangeElements< index_type, Tgltype, arr_type >::clone | ( | ) | const`[inline, virtual]`

Implements vl::DrawCall.

Definition at line 176 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

virtual unsigned int vl::DrawRangeElements< index_type, Tgltype, arr_type >::handle | ( | ) | const`[inline, virtual]`

Implements vl::DrawCall.

Definition at line 183 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::render().

template<typename index_type, GLenum Tgltype, class arr_type>

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

Definition at line 185 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::clearLocalBuffer(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::deleteVBOs(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::handle(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::operator=(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::render(), and vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::updateVBOs().

template<typename index_type, GLenum Tgltype, class arr_type>

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

Definition at line 187 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

virtual void vl::DrawRangeElements< index_type, Tgltype, arr_type >::updateVBOs | ( | bool | discard_local_data = `false`,
|  | bool | force_update = `false`
| ) |  | `[inline, virtual]`

Implements vl::DrawCall.

Definition at line 189 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

virtual void vl::DrawRangeElements< index_type, Tgltype, arr_type >::deleteVBOs | ( | ) | `[inline, virtual]`

Implements vl::DrawCall.

Definition at line 195 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

virtual void vl::DrawRangeElements< index_type, Tgltype, arr_type >::clearLocalBuffer | ( | ) | `[inline, virtual]`

Definition at line 200 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

virtual void vl::DrawRangeElements< index_type, Tgltype, arr_type >::render | ( | bool | use_vbo ) | const`[inline, virtual]`

Implements vl::DrawCall.

Definition at line 205 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

TriangleIterator vl::DrawRangeElements< index_type, 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 265 of file DrawRangeElements.hpp.

template<typename index_type, GLenum Tgltype, class arr_type>

IndexIterator vl::DrawRangeElements< index_type, 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 274 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::computeRange().

template<typename index_type, GLenum Tgltype, class arr_type>

void vl::DrawRangeElements< index_type, Tgltype, arr_type >::computeRange | ( | ) | `[inline]`

Definition at line 283 of file DrawRangeElements.hpp.

## Member Data Documentation

template<typename index_type, GLenum Tgltype, class arr_type>

ref< arr_type > vl::DrawRangeElements< index_type, Tgltype, arr_type >::mIndexBuffer`[protected]`

Definition at line 304 of file DrawRangeElements.hpp.

Referenced by vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::DrawRangeElements(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::indexIterator(), vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::indices(), and vl::DrawRangeElements< GLuint, GL_UNSIGNED_INT, ArrayUInt1 >::triangleIterator().

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

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

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