Visualization Library 2.1.0

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vl::DrawCall Class Referenceabstract

The base class of DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements. More...

#include <DrawCall.hpp>

+ Inheritance diagram for vl::DrawCall:

Public Member Functions

 DrawCall ()
 Constructor. More...
 
DrawCalloperator= (const DrawCall &other)
 Assignment operator. More...
 
void setPrimitiveType (EPrimitiveType type)
 Sets the draw call's primitive type. More...
 
EPrimitiveType primitiveType () const
 Returns the draw call's primitive type. More...
 
virtual void render (bool use_bo=true) const =0
 Executes the draw call. More...
 
virtual ref< DrawCallclone () const =0
 Returns a clone of the draw call. More...
 
virtual void updateDirtyBufferObject (EBufferObjectUpdateMode)=0
 Updates the index buffer's BufferObject if marked as dirty. More...
 
virtual void deleteBufferObject ()=0
 Deletes the index buffer's BufferObject. More...
 
void setEnabled (bool enable)
 Enables/disables the draw call. More...
 
bool isEnabled () const
 True if the draw call is enabled. More...
 
virtual TriangleIterator triangleIterator () const =0
 Returns a TriangleIterator used to iterate through the triangles of a DrawCall. More...
 
virtual IndexIterator indexIterator () const =0
 Returns a IndexIterator used to iterate through the virtual indices of a DrawCall. More...
 
u32 countIndices () const
 Counts the number of virtual indices of a DrawCall., i.e. More...
 
u32 countTriangles () const
 Counts the number of virtual triangles of a DrawCall., i.e. More...
 
virtual int instances () const
 Returns the number of instances for this set of primitives. More...
 
virtual bool primitiveRestartEnabled () const
 Returns whether the primitive-restart functionality is enabled or not. More...
 
virtual unsigned int primitiveRestartIndex ()
 Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported. More...
 
void setPatchParameter (PatchParameter *patch_param)
 Attach a PatchParameter to a DrawCall to be used when using primitive-type PT_PATCHES. More...
 
PatchParameterpatchParameter ()
 The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES. More...
 
const PatchParameterpatchParameter () const
 The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES. More...
 
- Public Member Functions inherited from vl::Object
 Object ()
 Constructor. More...
 
 Object (const Object &other)
 Copy constructor: copies the name, ref count mutex and user data. More...
 
Objectoperator= (const Object &other)
 Copy operator: copies the object's name, ref count mutex and user data. More...
 
const std::string & objectName () const
 The name of the object, by default set to the object's class name. More...
 
void setObjectName (const char *name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setObjectName (const std::string &name)
 The name of the object, by default set to the object's class name in debug builds. More...
 
void setRefCountMutex (IMutex *mutex)
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
IMutexrefCountMutex ()
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
const IMutexrefCountMutex () const
 The mutex used to protect the reference counting of an Object across multiple threads. More...
 
int referenceCount () const
 Returns the number of references of an object. More...
 
void incReference () const
 Increments the reference count of an object. More...
 
void decReference ()
 Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More...
 
void setAutomaticDelete (bool autodel_on)
 If set to true the Object is deleted when its reference count reaches 0. More...
 
bool automaticDelete () const
 If set to true the Object is deleted when its reference count reaches 0. More...
 
template<class T >
T * as ()
 Casts an Object to the specified class. More...
 
template<class T >
const T * as () const
 Casts an Object to the specified class. More...
 

Protected Member Functions

void applyPatchParameters () const
 
- Protected Member Functions inherited from vl::Object
virtual ~Object ()
 

Protected Attributes

ref< PatchParametermPatchParameter
 
EPrimitiveType mType
 
bool mEnabled
 
- Protected Attributes inherited from vl::Object
std::string mObjectName
 
IMutexmRefCountMutex
 
int mReferenceCount
 
bool mAutomaticDelete
 

Detailed Description

The base class of DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements.

which are used by Geometry to define a set of primitives to be rendered (see also Geometry::drawCalls()).

Overview

vl::DrawArrays wraps:

Supports:

vl::DrawElements wraps:

Supports:

vl::DrawRangeElements wraps:

Supports:

vl::MultiDrawElements wraps:

Supports:

DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements are used by Geometry to define a set of primitives to be rendered.

See also
Geometry::drawCalls(), DrawCall, DrawElements, MultiDrawElements, DrawRangeElements, Geometry, Actor

Definition at line 90 of file DrawCall.hpp.

Constructor & Destructor Documentation

◆ DrawCall()

vl::DrawCall::DrawCall ( )
inline

Constructor.

Definition at line 96 of file DrawCall.hpp.

Member Function Documentation

◆ applyPatchParameters()

void vl::DrawCall::applyPatchParameters ( ) const
inlineprotected

◆ clone()

virtual ref<DrawCall> vl::DrawCall::clone ( ) const
pure virtual

◆ countIndices()

u32 vl::DrawCall::countIndices ( ) const
inline

Counts the number of virtual indices of a DrawCall., i.e.

the number of indices you would retrieve by iterating over the iterator returned by indexIterator().

Definition at line 142 of file DrawCall.hpp.

References vl::IndexIterator::hasNext(), and indexIterator().

Referenced by vl::AdjacencyExtractor::extract().

◆ countTriangles()

u32 vl::DrawCall::countTriangles ( ) const
inline

Counts the number of virtual triangles of a DrawCall., i.e.

the number of triangles you would retrieve by iterating over the iterator returned by triangleIterator().

Definition at line 151 of file DrawCall.hpp.

References vl::TriangleIterator::hasNext(), and triangleIterator().

Referenced by vl::Geometry::fixTriangleWinding(), vl::Geometry::mergeDrawCallsWithTriangles(), and vl::Geometry::triangulateDrawCalls().

◆ deleteBufferObject()

virtual void vl::DrawCall::deleteBufferObject ( )
pure virtual

◆ indexIterator()

virtual IndexIterator vl::DrawCall::indexIterator ( ) const
pure virtual

◆ instances()

virtual int vl::DrawCall::instances ( ) const
inlinevirtual

Returns the number of instances for this set of primitives.

Reimplemented in vl::DrawArrays, and vl::DrawElementsBase.

Definition at line 160 of file DrawCall.hpp.

Referenced by vl::Geometry::shrinkDrawCalls(), and vl::Geometry::triangulateDrawCalls().

◆ isEnabled()

bool vl::DrawCall::isEnabled ( ) const
inline

True if the draw call is enabled.

Definition at line 128 of file DrawCall.hpp.

References indexIterator(), mEnabled, and triangleIterator().

Referenced by vlX::VLXClassWrapper_DrawCall::exportDrawCallBase().

◆ operator=()

DrawCall& vl::DrawCall::operator= ( const DrawCall other)
inline

Assignment operator.

Definition at line 99 of file DrawCall.hpp.

References mEnabled, and mType.

◆ patchParameter() [1/2]

PatchParameter* vl::DrawCall::patchParameter ( )
inline

The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES.

Definition at line 172 of file DrawCall.hpp.

References mPatchParameter.

Referenced by vlX::VLXClassWrapper_DrawCall::exportDrawCallBase().

◆ patchParameter() [2/2]

const PatchParameter* vl::DrawCall::patchParameter ( ) const
inline

The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES.

Definition at line 175 of file DrawCall.hpp.

References mPatchParameter.

◆ primitiveRestartEnabled()

virtual bool vl::DrawCall::primitiveRestartEnabled ( ) const
inlinevirtual

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

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

Reimplemented in vl::DrawRangeElementsBase, vl::DrawElementsBase, and vl::MultiDrawElementsBase.

Definition at line 163 of file DrawCall.hpp.

Referenced by vl::Geometry::shrinkDrawCalls(), and vl::Geometry::sortVertices().

◆ primitiveRestartIndex()

virtual unsigned int vl::DrawCall::primitiveRestartIndex ( )
inlinevirtual

◆ primitiveType()

EPrimitiveType vl::DrawCall::primitiveType ( ) const
inline

◆ render()

virtual void vl::DrawCall::render ( bool  use_bo = true) const
pure virtual

◆ setEnabled()

void vl::DrawCall::setEnabled ( bool  enable)
inline

Enables/disables the draw call.

Definition at line 125 of file DrawCall.hpp.

References mEnabled.

Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall(), and vl::Geometry::makeGLESFriendly().

◆ setPatchParameter()

void vl::DrawCall::setPatchParameter ( PatchParameter patch_param)
inline

Attach a PatchParameter to a DrawCall to be used when using primitive-type PT_PATCHES.

Definition at line 169 of file DrawCall.hpp.

References mPatchParameter.

◆ setPrimitiveType()

void vl::DrawCall::setPrimitiveType ( EPrimitiveType  type)
inline

Sets the draw call's primitive type.

Definition at line 107 of file DrawCall.hpp.

References mType.

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

◆ triangleIterator()

virtual TriangleIterator vl::DrawCall::triangleIterator ( ) const
pure virtual

◆ updateDirtyBufferObject()

virtual void vl::DrawCall::updateDirtyBufferObject ( EBufferObjectUpdateMode  )
pure virtual

Member Data Documentation

◆ mEnabled

bool vl::DrawCall::mEnabled
protected

Definition at line 197 of file DrawCall.hpp.

Referenced by isEnabled(), operator=(), and setEnabled().

◆ mPatchParameter

ref<PatchParameter> vl::DrawCall::mPatchParameter
protected

Definition at line 195 of file DrawCall.hpp.

Referenced by applyPatchParameters(), patchParameter(), and setPatchParameter().

◆ mType

EPrimitiveType vl::DrawCall::mType
protected

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