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::MultiDrawElementsBase Class Reference

Base interface for all MultiDrawElements* sub classes. More...

#include <MultiDrawElements.hpp>

Inheritance diagram for vl::MultiDrawElementsBase:
vl::DrawCall vl::Object vl::MultiDrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 > vl::MultiDrawElements< GL_UNSIGNED_INT, ArrayUInt1 > vl::MultiDrawElements< GL_UNSIGNED_SHORT, ArrayUShort1 > vl::MultiDrawElements< Tgltype, arr_type > vl::MultiDrawElementsUByte vl::MultiDrawElementsUInt vl::MultiDrawElementsUShort

List of all members.

Public Member Functions

GLuint primitiveRestartIndex () const
 Returns the special index which idendifies a primitive restart.
void setPrimitiveRestartIndex (GLuint index)
 Sets the special index which idendifies a primitive restart.
bool primitiveRestartEnabled () const
 Returns whether the primitive-restart functionality is enabled or not.
void setPrimitiveRestartEnabled (bool enabled)
 Enables the primitive-restart functionality.
void setCountVector (const std::vector< GLsizei > &vcount)
 Sets the vector defining the length of each primitive and automatically computes the pointer vectors used to exectue glMultiDrawElements().
const std::vector< GLsizei > & countVector () const
 The count vector used as 'count' parameter of glMultiDrawElements.
void setBaseVertices (const std::vector< GLint > &base_verts)
 Returns the list of base vertices, one for each primitive.
const std::vector< GLint > & baseVertices () const
 Returns the list of base vertices, one for each primitive.
std::vector< GLint > & baseVertices ()
 Returns the list of base vertices, one for each primitive.

Protected Member Functions

virtual void compute_pointer_vector ()=0

Protected Attributes

GLuint mPrimitiveRestartIndex
bool mPrimitiveRestartEnabled
std::vector< GLsizei > mCountVector
std::vector< GLint > mBaseVertices

Detailed Description

Base interface for all MultiDrawElements* sub classes.

Implements the index-type-independent interface of the class. That is you can cast to MultiDrawElementsBase* and access its members without needing to know whether the actual class is a vl::MultiDrawElementsUInt, vl::MultiDrawElementsUShort or vl::MultiDrawElementsUByte.

Definition at line 52 of file MultiDrawElements.hpp.


Member Function Documentation

GLuint vl::MultiDrawElementsBase::primitiveRestartIndex (  ) const [inline]

Returns the special index which idendifies a primitive restart.

By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for ubyte, ushort, uint index types.

Definition at line 57 of file MultiDrawElements.hpp.

References mPrimitiveRestartIndex.

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

void vl::MultiDrawElementsBase::setPrimitiveRestartIndex ( GLuint  index ) [inline]

Sets the special index which idendifies a primitive restart.

By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for ubyte, ushort, uint index types.

Definition at line 61 of file MultiDrawElements.hpp.

References mPrimitiveRestartIndex.

bool vl::MultiDrawElementsBase::primitiveRestartEnabled (  ) const [inline]

Returns whether the primitive-restart functionality is enabled or not.

See http://www.opengl.org/registry/specs/NV/primitive_restart.txt

Definition at line 64 of file MultiDrawElements.hpp.

References mPrimitiveRestartEnabled.

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

void vl::MultiDrawElementsBase::setPrimitiveRestartEnabled ( bool  enabled ) [inline]

Enables the primitive-restart functionality.

See http://www.opengl.org/registry/specs/NV/primitive_restart.txt

Definition at line 67 of file MultiDrawElements.hpp.

References mPrimitiveRestartEnabled.

void vl::MultiDrawElementsBase::setCountVector ( const std::vector< GLsizei > &  vcount ) [inline]

Sets the vector defining the length of each primitive and automatically computes the pointer vectors used to exectue glMultiDrawElements().

Definition at line 71 of file MultiDrawElements.hpp.

References compute_pointer_vector(), and mCountVector.

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

const std::vector<GLsizei>& vl::MultiDrawElementsBase::countVector (  ) const [inline]

The count vector used as 'count' parameter of glMultiDrawElements.

Definition at line 78 of file MultiDrawElements.hpp.

References mCountVector.

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

void vl::MultiDrawElementsBase::setBaseVertices ( const std::vector< GLint > &  base_verts ) [inline]

Returns the list of base vertices, one for each primitive.

This will enable the use of glMultiDrawElementsBaseVertex() to render a set of primitives. See also http://www.opengl.org/sdk/docs/man3/xhtml/glMultiDrawElementsBaseVertex.xml

Definition at line 83 of file MultiDrawElements.hpp.

References mBaseVertices.

const std::vector<GLint>& vl::MultiDrawElementsBase::baseVertices (  ) const [inline]

Returns the list of base vertices, one for each primitive.

Definition at line 86 of file MultiDrawElements.hpp.

References mBaseVertices.

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

std::vector<GLint>& vl::MultiDrawElementsBase::baseVertices (  ) [inline]

Returns the list of base vertices, one for each primitive.

Definition at line 89 of file MultiDrawElements.hpp.

References mBaseVertices.

virtual void vl::MultiDrawElementsBase::compute_pointer_vector (  ) [protected, pure virtual]

Member Data Documentation

std::vector<GLsizei> vl::MultiDrawElementsBase::mCountVector [protected]
std::vector<GLint> vl::MultiDrawElementsBase::mBaseVertices [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:14.
Permission is granted to use this page to write and publish articles regarding Visualization Library.