# Visualization Library

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

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

Public Member Functions | Protected Attributes

# vl::DrawElementsBase Class Reference

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

`#include <DrawElements.hpp>`

Inheritance diagram for vl::DrawElementsBase:

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 | setInstances (int instances)
| Sets the number of instances for this set of primitives.
int | instances () const
| Returns the number of instances for this set of primitives.
void | setBaseVertex (int base_vertex)
| If base_vertx is != 0 glDrawElementsBaseVertex/glDrawElementsInstancedBaseVertex will be used instead of their non *BaseVertx counterparts.
int | baseVertex () const
| Returns the currently used base vertex.

## Protected Attributes

int | mInstances
GLuint | mPrimitiveRestartIndex
bool | mPrimitiveRestartEnabled
int | mBaseVertex

## Detailed Description

Base interface for all DrawElements* sub classes.

Implements the index-type-independent interface of the class. That is you can cast to DrawElementsBase* and access its members without needing to know whether the actual class is a vl::DrawElementsUInt, vl::DrawElementsUShort or vl::DrawElementsUByte.

Definition at line 53 of file DrawElements.hpp.

## Member Function Documentation

GLuint vl::DrawElementsBase::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 58 of file DrawElements.hpp.

References mPrimitiveRestartIndex.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), and vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::triangleIterator().

void vl::DrawElementsBase::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 62 of file DrawElements.hpp.

References mPrimitiveRestartIndex.

bool vl::DrawElementsBase::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 65 of file DrawElements.hpp.

References mPrimitiveRestartEnabled.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), and vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::triangleIterator().

void vl::DrawElementsBase::setPrimitiveRestartEnabled | ( | bool | enabled ) | `[inline]`

Enables the primitive-restart functionality.

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

Definition at line 68 of file DrawElements.hpp.

References mPrimitiveRestartEnabled.

void vl::DrawElementsBase::setInstances | ( | int | instances ) | `[inline]`

Sets the number of instances for this set of primitives.

Definition at line 71 of file DrawElements.hpp.

References instances(), and mInstances.

int vl::DrawElementsBase::instances | ( | ) | const`[inline, virtual]`

Returns the number of instances for this set of primitives.

Reimplemented from vl::DrawCall.

Definition at line 74 of file DrawElements.hpp.

References mInstances.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), setInstances(), and vl::Geometry::sortVertices().

void vl::DrawElementsBase::setBaseVertex | ( | int | base_vertex ) | `[inline]`

If base_vertx is != 0 glDrawElementsBaseVertex/glDrawElementsInstancedBaseVertex will be used instead of their non *BaseVertx counterparts.

Note that using base_vertx != requires OpenGL 3.2 or higher or ARB_draw_elements_base_vertex. For more information see also http://www.opengl.org/sdk/docs/man3/xhtml/glDrawElementsBaseVertex.xml

Definition at line 80 of file DrawElements.hpp.

References mBaseVertex.

int vl::DrawElementsBase::baseVertex | ( | ) | const`[inline]`

Returns the currently used base vertex.

For more information see also http://www.opengl.org/sdk/docs/man3/xhtml/glDrawElementsBaseVertex.xml

Definition at line 84 of file DrawElements.hpp.

References mBaseVertex.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::triangleIterator().

## Member Data Documentation

int vl::DrawElementsBase::mInstances`[protected]`

Definition at line 87 of file DrawElements.hpp.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), instances(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), and setInstances().

GLuint vl::DrawElementsBase::mPrimitiveRestartIndex`[protected]`

Definition at line 88 of file DrawElements.hpp.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indexIterator(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), primitiveRestartIndex(), and setPrimitiveRestartIndex().

bool vl::DrawElementsBase::mPrimitiveRestartEnabled`[protected]`

Definition at line 89 of file DrawElements.hpp.

Referenced by vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indexIterator(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), primitiveRestartEnabled(), and setPrimitiveRestartEnabled().

int vl::DrawElementsBase::mBaseVertex`[protected]`

Definition at line 90 of file DrawElements.hpp.

Referenced by baseVertex(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::DrawElements(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::indexIterator(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::operator=(), vl::DrawElements< GL_UNSIGNED_BYTE, ArrayUByte1 >::render(), and setBaseVertex().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/DrawElements.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.