Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wrapper for the OpenGL function glDrawElements(). More...
#include <DrawElements.hpp>
Public Types | |
typedef arr_type::scalar_type | index_type |
Public Member Functions | |
virtual unsigned int | primitiveRestartIndex () |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported. More... | |
DrawElements (EPrimitiveType primitive=PT_TRIANGLES, int instances=1) | |
Constructor. More... | |
DrawElements & | operator= (const DrawElements &other) |
Assign operator. More... | |
virtual ref< DrawCall > | clone () const |
Returns a clone of this DrawCall. More... | |
void | setCount (i32 count) |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'. More... | |
i32 | count () const |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'. More... | |
void | setOffset (u32 offset) |
The offset in bytes from which the index buffer will be read. More... | |
u32 | offset () const |
The offset in bytes from which the index buffer will be read. More... | |
void | setIndexBuffer (arr_type *index_buffer) |
The BufferObject containing the indices used to render. More... | |
arr_type * | indexBuffer () |
The BufferObject containing the indices used to render. More... | |
const arr_type * | indexBuffer () const |
The BufferObject containing the indices used to render. More... | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode mode) |
Updates the index buffer's BufferObject if marked as dirty. More... | |
virtual void | deleteBufferObject () |
Deletes the index buffer's BufferObject. More... | |
virtual void | render (bool use_bo) const |
Executes the draw call. 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::DrawElementsBase | |
virtual bool | primitiveRestartEnabled () const |
Returns whether the primitive-restart functionality is enabled or not (requires OpenGL 3.1). More... | |
void | setPrimitiveRestartEnabled (bool enabled) |
Enables the primitive-restart functionality (requires OpenGL 3.1). 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... | |
void | setBaseVertex (int base_vertex) |
If base_vertx is != 0 glDrawElementsBaseVertex/glDrawElementsInstancedBaseVertex will be used instead of their non *BaseVertx counterparts. More... | |
int | baseVertex () const |
Returns the currently used base vertex. 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... | |
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... | |
Static Public Attributes | |
static const index_type | primitive_restart_index = index_type(~0) |
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for GLubyte, GLushort, GLuint index types. */. More... | |
Protected Attributes | |
ref< arr_type > | mIndexBuffer |
i32 | mCount |
u32 | mOffset |
Protected Attributes inherited from vl::DrawElementsBase | |
int | mInstances |
bool | mPrimitiveRestartEnabled |
GLuint | mBaseVertex |
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 () |
Wrapper for the OpenGL function glDrawElements().
See vl::DrawCall for an overview of the different draw call methods.
This class wraps the following OpenGL functions:
Supports:
Use the functions setInstances() and instances() to use the Multi instancing functionality. (requires OpenGL 3.1). For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glDrawElementsInstanced.xml
Use the functions setPrimitiveRestartIndex() and setPrimitiveRestartEnabled() to use the primitive restart functionality (requires OpenGL 3.1). For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glPrimitiveRestartIndex.xml
Use the function setBaseVertex() with a non zero argument to use the base vertex functionality. Requires OpenGL 3.2 or GL_ARB_draw_elements_base_vertex. For more information see http://www.opengl.org/sdk/docs/man3/xhtml/glDrawElementsBaseVertex.xml
DrawElements, MultiDrawElements, DrawRangeElements, DrawArrays are used by Geometry to define a set of primitives to be rendered, see Geometry::drawCalls(). The indices are stored in a BufferObject and thus they can be stored locally or on the GPU. To gain direct access to the BufferObject use the indexBuffer() function.
DrawArrays, DrawElements, MultiDrawElements and DrawRangeElements are used by Geometry to define a set of primitives to be rendered.
Definition at line 118 of file DrawElements.hpp.
typedef arr_type::scalar_type vl::DrawElements< arr_type >::index_type |
Definition at line 123 of file DrawElements.hpp.
|
inline |
Constructor.
Definition at line 155 of file DrawElements.hpp.
|
inlinevirtual |
Returns a clone of this DrawCall.
Implements vl::DrawCall.
Definition at line 181 of file DrawElements.hpp.
|
inline |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'.
Definition at line 192 of file DrawElements.hpp.
|
inlinevirtual |
Deletes the index buffer's BufferObject.
Implements vl::DrawCall.
Definition at line 215 of file DrawElements.hpp.
|
inline |
The BufferObject containing the indices used to render.
Definition at line 204 of file DrawElements.hpp.
Referenced by vlX::VLXClassWrapper_DrawCall::exportDrawCall(), vl::Extrusions::extrude(), vl::Extrusion::extrude(), vl::load3DS(), vl::loadAC3D(), vl::loadMD2(), vl::PlyLoader::loadPly(), vl::makeCapsule(), vl::makeCone(), vl::makeCylinder(), vl::makeGrid(), vl::makeIcosahedron(), vl::makeIcosphere(), vl::makeTorus(), vl::makeUVSphere(), vl::Geometry::mergeDrawCallsWithPrimitiveRestart(), vl::Geometry::mergeDrawCallsWithTriangles(), vl::Geometry::mergeTriangleStrips(), vl::DrawElements< ArrayUShort1 >::operator=(), vl::PolygonSimplifier::outputSimplifiedGeometry(), vl::RaycastVolume::RaycastVolume(), vl::DoubleVertexRemover::removeDoubles(), vl::Geometry::shrinkDrawCalls(), vl::Geometry::sortVertices(), vl::TriangleStripGenerator::stripfy(), vl::Geometry::triangulateDrawCalls(), and vl::BezierSurface::updateBezierSurface().
|
inline |
The BufferObject containing the indices used to render.
Definition at line 207 of file DrawElements.hpp.
|
inlinevirtual |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
This
Implements vl::DrawCall.
Definition at line 357 of file DrawElements.hpp.
|
inline |
The offset in bytes from which the index buffer will be read.
Definition at line 198 of file DrawElements.hpp.
|
inline |
Assign operator.
Definition at line 168 of file DrawElements.hpp.
|
inlinevirtual |
Returns the primitive restart index used by the draw call or 0 if primitive restart is not supported.
Reimplemented from vl::DrawCall.
Definition at line 126 of file DrawElements.hpp.
|
inlinevirtual |
|
inline |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'.
Definition at line 189 of file DrawElements.hpp.
|
inline |
The BufferObject containing the indices used to render.
Definition at line 201 of file DrawElements.hpp.
Referenced by vl::DaeLoader::generateGeometry().
|
inline |
The offset in bytes from which the index buffer will be read.
Definition at line 195 of file DrawElements.hpp.
|
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 348 of file DrawElements.hpp.
|
inlinevirtual |
Updates the index buffer's BufferObject if marked as dirty.
Implements vl::DrawCall.
Definition at line 209 of file DrawElements.hpp.
|
protected |
Definition at line 368 of file DrawElements.hpp.
Referenced by vl::DrawElements< ArrayUShort1 >::operator=().
|
protected |
Definition at line 367 of file DrawElements.hpp.
|
protected |
Definition at line 369 of file DrawElements.hpp.
Referenced by vl::DrawElements< ArrayUShort1 >::operator=().
|
static |
The special index which identifies a primitive restart. By default it is set to ~0 that is 0xFF, 0xFFFF, 0xFFFFFFFF respectively for GLubyte, GLushort, GLuint index types. */.
Definition at line 125 of file DrawElements.hpp.
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:07.
© Copyright Michele Bosi. All rights reserved.