Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]

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

Wrapper for the OpenGL function glDrawElements(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml for more information. More...

#include <DrawElements.hpp>

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

vl::Primitives vl::Object

List of all members.

Classes

class  Triangle

Public Member Functions

 DrawElements (EPrimitiveType primitive=PT_TRIANGLES, int instances=1)
virtual const char * className ()
 Returns the name of the class.
virtual ref< Primitivesclone () const
virtual unsigned int handle () const
void setPrimitiveType (EPrimitiveType type)
EPrimitiveType primitiveType () const
virtual unsigned int indexCount () const
virtual unsigned int indexCountGPU () const
virtual unsigned int index (int i) const
arr_type * indices ()
const arr_type * indices () const
virtual void updateVBOs (bool discard_local_data=false)
virtual void deleteVBOs ()
virtual void clearLocalBuffer ()
int triangleCount () const
int lineCount () const
int pointCount () const
virtual void sortTriangles ()
 Supported only by DrawElements.
virtual void render (bool use_vbo) const

Protected Attributes

ref< arr_type > mIndexBuffer


Detailed Description

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

Wrapper for the OpenGL function glDrawElements(), see also http://www.opengl.org/sdk/docs/man/xhtml/glDrawElements.xml for more information.

DrawElements is the template base of vl::DrawElementsUInt, vl::DrawElementsUShort, vl::DrawElementsUByte. DrawArrays and DrawElements are used by Geometry to define a set of primitives to be rendered (Geometry::primitives()). DrawArrays and DrawElements supports all the OpenGL primitive types. Geometry multi instancing is also supported, see the functions setInstances() and instances(). The indices of a DrawElement are stored in a GLBufferObject and thus can be stored locally or on the GPU. To gain direct access to the GLBufferObject use the indices() function.

See also:
DrawElementsUInt, DrawElementsUShort, DrawElementsUByte, DrawArrays, Geometry, Actor

Constructor & Destructor Documentation

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


Member Function Documentation

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

Returns the name of the class.

Reimplemented from vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
virtual ref<Primitives> vl::DrawElements< index_type, Tgltype, arr_type >::clone (  )  const [inline, virtual]

Implements vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
virtual unsigned int vl::DrawElements< index_type, Tgltype, arr_type >::handle (  )  const [inline, virtual]

Implements vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
void vl::DrawElements< index_type, Tgltype, arr_type >::setPrimitiveType ( EPrimitiveType  type  )  [inline]

Reimplemented from vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
EPrimitiveType vl::DrawElements< index_type, Tgltype, arr_type >::primitiveType (  )  const [inline]

Reimplemented from vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
virtual unsigned int vl::DrawElements< index_type, Tgltype, arr_type >::indexCount (  )  const [inline, virtual]

Implements vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
virtual unsigned int vl::DrawElements< index_type, Tgltype, arr_type >::indexCountGPU (  )  const [inline, virtual]

template<typename index_type , GLenum Tgltype, class arr_type >
virtual unsigned int vl::DrawElements< index_type, Tgltype, arr_type >::index ( int  i  )  const [inline, virtual]

Implements vl::Primitives.

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

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

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

Implements vl::Primitives.

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

Implements vl::Primitives.

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

template<typename index_type , GLenum Tgltype, class arr_type >
int vl::DrawElements< index_type, Tgltype, arr_type >::triangleCount (  )  const [inline, virtual]

Implements vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
int vl::DrawElements< index_type, Tgltype, arr_type >::lineCount (  )  const [inline, virtual]

Implements vl::Primitives.

template<typename index_type , GLenum Tgltype, class arr_type >
int vl::DrawElements< index_type, Tgltype, arr_type >::pointCount (  )  const [inline, virtual]

Implements vl::Primitives.

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

Supported only by DrawElements.

Reimplemented from vl::Primitives.

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

Implements vl::Primitives.


Member Data Documentation

template<typename index_type , GLenum Tgltype, class arr_type >
ref< arr_type > vl::DrawElements< index_type, Tgltype, arr_type >::mIndexBuffer [protected]


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

Visualization Library v2009.07 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Mon Aug 10 21:41:34 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.