Visualization Library v1.0.3A lightweight C++ OpenGL middleware for 2D/3D graphics |
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Wrapper for the OpenGL function glDrawRangeElements(). More...
#include <DrawRangeElements.hpp>
Classes | |
class | Triangle |
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. | |
DrawRangeElements (EPrimitiveType primitive=PT_TRIANGLES, int r_start=0, int r_end=primitive_restart_index) | |
DrawRangeElements & | operator= (const DrawRangeElements &other) |
virtual ref< DrawCall > | clone () const |
Returns a clone of the draw call. | |
void | setCount (i32 count) |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'. | |
i32 | count () const |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'. | |
void | setOffset (u32 offset) |
The offset in bytes from which the index buffer will be read. | |
u32 | offset () const |
The offset in bytes from which the index buffer will be read. | |
void | setIndexBuffer (arr_type *index_buffer) |
The BufferObject containing the indices used to render. | |
arr_type * | indexBuffer () |
The BufferObject containing the indices used to render. | |
const arr_type * | indexBuffer () const |
The BufferObject containing the indices used to render. | |
virtual void | updateDirtyBufferObject (EBufferObjectUpdateMode mode) |
Updates the index buffer's BufferObject if marked as dirty. | |
virtual void | deleteBufferObject () |
Deletes the index buffer's BufferObject. | |
virtual void | render (bool use_bo) const |
Executes the draw call. | |
TriangleIterator | triangleIterator () const |
Returns a TriangleIterator used to iterate through the triangles of a DrawCall. | |
IndexIterator | indexIterator () const |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall. | |
void | computeRange () |
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. */. | |
Protected Attributes | |
ref< arr_type > | mIndexBuffer |
i32 | mCount |
u32 | mOffset |
Wrapper for the OpenGL function glDrawRangeElements().
See also http://www.opengl.org/sdk/docs/man3/xhtml/glDrawRangeElements.xml for more information.
This class wraps the following OpenGL functions:
Supports:
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() 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/glDrawRangeElementsBaseVertex.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 120 of file DrawRangeElements.hpp.
typedef arr_type::scalar_type vl::DrawRangeElements< arr_type >::index_type |
Definition at line 125 of file DrawRangeElements.hpp.
vl::DrawRangeElements< arr_type >::DrawRangeElements | ( | EPrimitiveType | primitive = PT_TRIANGLES , |
int | r_start = 0 , |
||
int | r_end = primitive_restart_index |
||
) | [inline] |
Definition at line 156 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::clone().
virtual unsigned int vl::DrawRangeElements< arr_type >::primitiveRestartIndex | ( | ) | [inline, virtual] |
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 128 of file DrawRangeElements.hpp.
DrawRangeElements& vl::DrawRangeElements< arr_type >::operator= | ( | const DrawRangeElements< arr_type > & | other ) | [inline] |
Definition at line 169 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::operator=().
virtual ref<DrawCall> vl::DrawRangeElements< arr_type >::clone | ( | ) | const [inline, virtual] |
Returns a clone of the draw call.
Implements vl::DrawCall.
Definition at line 182 of file DrawRangeElements.hpp.
void vl::DrawRangeElements< arr_type >::setCount | ( | i32 | count ) | [inline] |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'.
Definition at line 190 of file DrawRangeElements.hpp.
i32 vl::DrawRangeElements< arr_type >::count | ( | ) | const [inline] |
The number of indices to render, default is -1 which means 'till the end of the indexBuffer() from offset()'.
Definition at line 193 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::setCount().
void vl::DrawRangeElements< arr_type >::setOffset | ( | u32 | offset ) | [inline] |
The offset in bytes from which the index buffer will be read.
Definition at line 196 of file DrawRangeElements.hpp.
u32 vl::DrawRangeElements< arr_type >::offset | ( | ) | const [inline] |
The offset in bytes from which the index buffer will be read.
Definition at line 199 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::setOffset().
void vl::DrawRangeElements< arr_type >::setIndexBuffer | ( | arr_type * | index_buffer ) | [inline] |
The BufferObject containing the indices used to render.
Definition at line 202 of file DrawRangeElements.hpp.
arr_type* vl::DrawRangeElements< arr_type >::indexBuffer | ( | ) | [inline] |
The BufferObject containing the indices used to render.
Definition at line 205 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::deleteBufferObject(), vl::DrawRangeElements< ArrayUShort1 >::operator=(), vl::DrawRangeElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::updateDirtyBufferObject().
const arr_type* vl::DrawRangeElements< arr_type >::indexBuffer | ( | ) | const [inline] |
The BufferObject containing the indices used to render.
Definition at line 208 of file DrawRangeElements.hpp.
virtual void vl::DrawRangeElements< arr_type >::updateDirtyBufferObject | ( | EBufferObjectUpdateMode | ) | [inline, virtual] |
Updates the index buffer's BufferObject if marked as dirty.
Implements vl::DrawCall.
Definition at line 210 of file DrawRangeElements.hpp.
virtual void vl::DrawRangeElements< arr_type >::deleteBufferObject | ( | ) | [inline, virtual] |
Deletes the index buffer's BufferObject.
Implements vl::DrawCall.
Definition at line 216 of file DrawRangeElements.hpp.
virtual void vl::DrawRangeElements< arr_type >::render | ( | bool | use_bo ) | const [inline, virtual] |
Executes the draw call.
Implements vl::DrawCall.
Definition at line 221 of file DrawRangeElements.hpp.
TriangleIterator vl::DrawRangeElements< arr_type >::triangleIterator | ( | ) | const [inline, virtual] |
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 294 of file DrawRangeElements.hpp.
IndexIterator vl::DrawRangeElements< arr_type >::indexIterator | ( | ) | const [inline, virtual] |
Returns a IndexIterator used to iterate through the virtual indices of a DrawCall.
This
Implements vl::DrawCall.
Definition at line 303 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::computeRange().
void vl::DrawRangeElements< arr_type >::computeRange | ( | ) | [inline] |
Definition at line 312 of file DrawRangeElements.hpp.
const index_type vl::DrawRangeElements< arr_type >::primitive_restart_index = index_type(~0) [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 127 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::computeRange(), vl::DrawRangeElements< ArrayUShort1 >::indexIterator(), vl::DrawRangeElements< ArrayUShort1 >::primitiveRestartIndex(), vl::DrawRangeElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::triangleIterator().
ref< arr_type > vl::DrawRangeElements< arr_type >::mIndexBuffer [protected] |
Definition at line 333 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::DrawRangeElements(), vl::DrawRangeElements< ArrayUShort1 >::indexBuffer(), vl::DrawRangeElements< ArrayUShort1 >::indexIterator(), vl::DrawRangeElements< ArrayUShort1 >::setIndexBuffer(), and vl::DrawRangeElements< ArrayUShort1 >::triangleIterator().
i32 vl::DrawRangeElements< arr_type >::mCount [protected] |
Definition at line 334 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::count(), vl::DrawRangeElements< ArrayUShort1 >::DrawRangeElements(), vl::DrawRangeElements< ArrayUShort1 >::operator=(), vl::DrawRangeElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::setCount().
u32 vl::DrawRangeElements< arr_type >::mOffset [protected] |
Definition at line 335 of file DrawRangeElements.hpp.
Referenced by vl::DrawRangeElements< ArrayUShort1 >::DrawRangeElements(), vl::DrawRangeElements< ArrayUShort1 >::offset(), vl::DrawRangeElements< ArrayUShort1 >::operator=(), vl::DrawRangeElements< ArrayUShort1 >::render(), and vl::DrawRangeElements< ArrayUShort1 >::setOffset().