Visualization Library

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

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

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

#include <DrawElements.hpp>

Inheritance diagram for vl::DrawElements< Tgltype, arr_type >:
vl::DrawElementsBase vl::DrawCall vl::Object

List of all members.

Classes

class  Triangle

Public Member Functions

virtual const char * className ()
 Returns the name of the class.
 DrawElements (EPrimitiveType primitive=PT_TRIANGLES, int instances=1)
DrawElementsoperator= (const DrawElements &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.

Protected Attributes

ref< arr_type > mIndexBuffer

Detailed Description

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

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.

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

Definition at line 118 of file DrawElements.hpp.


Constructor & Destructor Documentation

template<GLenum Tgltype, class arr_type>
vl::DrawElements< Tgltype, arr_type >::DrawElements ( EPrimitiveType  primitive = PT_TRIANGLES,
int  instances = 1 
) [inline]

Member Function Documentation

template<GLenum Tgltype, class arr_type>
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.

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

Implements vl::DrawCall.

Definition at line 170 of file DrawElements.hpp.

template<GLenum Tgltype, class arr_type>
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().

template<GLenum Tgltype, class arr_type>
arr_type* vl::DrawElements< Tgltype, arr_type >::indices (  ) [inline]
template<GLenum Tgltype, class arr_type>
const arr_type* vl::DrawElements< Tgltype, arr_type >::indices (  ) const [inline]

Definition at line 181 of file DrawElements.hpp.

template<GLenum Tgltype, class arr_type>
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.

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

Implements vl::DrawCall.

Definition at line 189 of file DrawElements.hpp.

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

Definition at line 194 of file DrawElements.hpp.

template<GLenum Tgltype, class arr_type>
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.

template<GLenum Tgltype, class arr_type>
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.

template<GLenum Tgltype, class arr_type>
IndexIterator vl::DrawElements< 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 293 of file DrawElements.hpp.


Member Data Documentation

template<GLenum Tgltype, class arr_type>
ref< arr_type > vl::DrawElements< Tgltype, arr_type >::mIndexBuffer [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:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.