Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public 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< ArrayUByte1 > vl::MultiDrawElements< ArrayUInt1 > vl::MultiDrawElements< ArrayUShort1 > vl::MultiDrawElements< arr_type > vl::MultiDrawElementsUByte vl::MultiDrawElementsUInt vl::MultiDrawElementsUShort

List of all members.

Public Member Functions

virtual bool primitiveRestartEnabled () const
 Returns whether the primitive-restart functionality is enabled or not.
void setPrimitiveRestartEnabled (bool enabled)
 Enables the primitive-restart functionality.
void finalizeSetup ()
 Calls computePointerVector(), computeBufferObjectPointerVector() and resizes the base vertex array to fit the count vector.
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().
void setCountVector (const GLsizei *vcount, size_t size)
 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.
std::vector< GLsizei > & countVector ()
 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.
virtual void computePointerVector ()=0
 Computes the pointer vector to be used when BufferObjects are DISABLED.
virtual void computeBufferObjectPointerVector ()=0
 Computes the pointer vector to be used when BufferObjects are ENABLED.

Protected Attributes

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

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

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

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

Reimplemented from vl::DrawCall.

Definition at line 58 of file MultiDrawElements.hpp.

References mPrimitiveRestartEnabled.

Referenced by vl::VLXClassWrapper_DrawCall::exportDrawCall(), and vl::MultiDrawElements< ArrayUShort1 >::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 61 of file MultiDrawElements.hpp.

References mPrimitiveRestartEnabled.

Referenced by vl::VLXClassWrapper_DrawCall::importDrawCall().

void vl::MultiDrawElementsBase::finalizeSetup (  ) [inline]

Calls computePointerVector(), computeBufferObjectPointerVector() and resizes the base vertex array to fit the count vector.

Note:
Must be called after the index buffer has been filled.

Definition at line 65 of file MultiDrawElements.hpp.

References computeBufferObjectPointerVector(), computePointerVector(), mBaseVertices, and mCountVector.

Referenced by setCountVector().

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().

Note:
Must be called after the index buffer has been filled.

Definition at line 77 of file MultiDrawElements.hpp.

References finalizeSetup(), and mCountVector.

Referenced by vl::MultiDrawElements< ArrayUShort1 >::operator=().

void vl::MultiDrawElementsBase::setCountVector ( const GLsizei *  vcount,
size_t  size 
) [inline]

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

Note:
Must be called after the index buffer has been filled.

Definition at line 85 of file MultiDrawElements.hpp.

References finalizeSetup(), and mCountVector.

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

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

Definition at line 94 of file MultiDrawElements.hpp.

References mCountVector.

Referenced by vl::VLXClassWrapper_DrawCall::exportDrawCall(), vl::VLXClassWrapper_DrawCall::importDrawCall(), vl::MultiDrawElements< ArrayUShort1 >::render(), and vl::Geometry::shrinkDrawCalls().

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

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

Definition at line 97 of file MultiDrawElements.hpp.

References mCountVector.

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 102 of file MultiDrawElements.hpp.

References mBaseVertices.

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

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

Definition at line 108 of file MultiDrawElements.hpp.

References mBaseVertices.

virtual void vl::MultiDrawElementsBase::computePointerVector (  ) [pure virtual]

Computes the pointer vector to be used when BufferObjects are DISABLED.

Call this function after having updated the count vector and the index buffer indexBuffer().

Note:
Normally you don't need to call this function as setCountVector() already calls it.

Implemented in vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, and vl::MultiDrawElements< ArrayUShort1 >.

Referenced by finalizeSetup(), and vl::VLXClassWrapper_DrawCall::importDrawCall().

virtual void vl::MultiDrawElementsBase::computeBufferObjectPointerVector (  ) [pure virtual]

Computes the pointer vector to be used when BufferObjects are ENABLED.

Call this function after having updated the count vector and the index buffer indexBuffer().

Note:
Normally you don't need to call this function as setCountVector() already calls it.

Implemented in vl::MultiDrawElements< arr_type >, vl::MultiDrawElements< ArrayUInt1 >, vl::MultiDrawElements< ArrayUByte1 >, and vl::MultiDrawElements< ArrayUShort1 >.

Referenced by finalizeSetup(), and vl::VLXClassWrapper_DrawCall::importDrawCall().


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 v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.