Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wraps the OpenGL function glDrawArrays(). More...
#include <DrawArrays.hpp>
Public Member Functions | |
DrawArrays () | |
DrawArrays (EPrimitiveType primitive, int start, int count, int instances=1) | |
DrawArrays & | operator= (const DrawArrays &other) |
virtual ref< DrawCall > | clone () const |
Returns a clone of the draw call. More... | |
virtual void | deleteBufferObject () |
Deletes the index buffer's BufferObject. More... | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode) |
Updates the index buffer's BufferObject if marked as dirty. More... | |
virtual void | render (bool) const |
Executes the draw call. More... | |
void | setStart (int start) |
sets the starting vertex for the rendering. More... | |
int | start () const |
returns the starting vertex for the rendering. More... | |
void | setCount (int count) |
sets the number of vertices to be rendered. More... | |
int | count () const |
returns the number of vertices to be rendered. More... | |
void | setInstances (int instances) |
Sets the number of instances for this set of primitives. More... | |
int | instances () const |
Returns the number of instances for this set of primitives. More... | |
TriangleIterator | triangleIterator () const |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall. More... | |
IndexIterator | indexIterator () const |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall. More... | |
Public Member Functions inherited from vl::DrawCall | |
DrawCall () | |
Constructor. More... | |
DrawCall & | operator= (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... | |
void | setEnabled (bool enable) |
Enables/disables the draw call. More... | |
bool | isEnabled () const |
True if the draw call is enabled. 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 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... | |
PatchParameter * | patchParameter () |
The PatchParameter attached to a DrawCall to be used when using primitive-type PT_PATCHES. More... | |
const PatchParameter * | patchParameter () 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... | |
Object & | operator= (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... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () 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 Attributes | |
int | mStart |
int | mCount |
int | mInstances |
Protected Attributes inherited from vl::DrawCall | |
ref< PatchParameter > | mPatchParameter |
EPrimitiveType | mType |
bool | mEnabled |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::DrawCall | |
void | applyPatchParameters () const |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
Wraps the OpenGL function glDrawArrays().
See vl::DrawCall for an overview of the different draw call methods.
This class wraps the following OpenGL functions:
Supports:
DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements are used by Geometry to define a set of primitives to be rendered.
Definition at line 57 of file DrawArrays.hpp.
|
inline |
Definition at line 62 of file DrawArrays.hpp.
References mInstances, vl::DrawCall::mType, and vl::PT_TRIANGLES.
Referenced by clone().
|
inline |
Definition at line 69 of file DrawArrays.hpp.
References instances(), mInstances, and vl::DrawCall::mType.
Returns a clone of the draw call.
Implements vl::DrawCall.
Definition at line 86 of file DrawArrays.hpp.
References count(), DrawArrays(), instances(), vl::DrawCall::primitiveType(), and start().
|
inline |
returns the number of vertices to be rendered.
Definition at line 129 of file DrawArrays.hpp.
References mCount.
Referenced by clone(), vlX::VLXClassWrapper_DrawCall::exportDrawCall(), render(), and setCount().
|
inlinevirtual |
Deletes the index buffer's BufferObject.
Implements vl::DrawCall.
Definition at line 91 of file DrawArrays.hpp.
|
inlinevirtual |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
This
Implements vl::DrawCall.
Definition at line 144 of file DrawArrays.hpp.
References vl::ref< T >::get(), vl::IndexIterator::initialize(), mCount, and mStart.
|
inlinevirtual |
Returns the number of instances for this set of primitives.
Reimplemented from vl::DrawCall.
Definition at line 135 of file DrawArrays.hpp.
References mInstances.
Referenced by clone(), DrawArrays(), vlX::VLXClassWrapper_DrawCall::exportDrawCall(), render(), and setInstances().
|
inline |
Definition at line 77 of file DrawArrays.hpp.
References mCount, mInstances, and mStart.
|
inlinevirtual |
Executes the draw call.
Implements vl::DrawCall.
Definition at line 94 of file DrawArrays.hpp.
References vl::DrawCall::applyPatchParameters(), count(), vl::Log::error(), vl::getGLErrorString(), instances(), vl::DrawCall::primitiveType(), start(), VL_CHECK_OGL, VL_TRAP, and vl::Log::warning().
|
inline |
sets the number of vertices to be rendered.
Definition at line 126 of file DrawArrays.hpp.
References count(), and mCount.
Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall().
|
inline |
Sets the number of instances for this set of primitives.
Definition at line 132 of file DrawArrays.hpp.
References instances(), and mInstances.
Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall().
|
inline |
sets the starting vertex for the rendering.
Definition at line 120 of file DrawArrays.hpp.
References mStart, and start().
Referenced by vlX::VLXClassWrapper_DrawCall::importDrawCall().
|
inline |
returns the starting vertex for the rendering.
Definition at line 123 of file DrawArrays.hpp.
References mStart.
Referenced by clone(), vlX::VLXClassWrapper_DrawCall::exportDrawCall(), render(), and setStart().
|
inlinevirtual |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall.
Basically the iterator tesselates in triangles any DrawCall of type: PT_TRIANGLES, PT_TRIANGLE_STRIP PT_TRIANGLE_FAN, PT_POLYGON, PT_QUADS, PT_QUAD_STRIP.
Implements vl::DrawCall.
Definition at line 137 of file DrawArrays.hpp.
References vl::ref< T >::get(), mCount, mStart, and vl::DrawCall::primitiveType().
|
inlinevirtual |
Updates the index buffer's BufferObject if marked as dirty.
Implements vl::DrawCall.
Definition at line 92 of file DrawArrays.hpp.
|
protected |
Definition at line 155 of file DrawArrays.hpp.
Referenced by count(), indexIterator(), operator=(), setCount(), and triangleIterator().
|
protected |
Definition at line 156 of file DrawArrays.hpp.
Referenced by DrawArrays(), instances(), operator=(), and setInstances().
|
protected |
Definition at line 154 of file DrawArrays.hpp.
Referenced by indexIterator(), operator=(), setStart(), start(), and triangleIterator().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:07.
© Copyright Michele Bosi. All rights reserved.