Basic Image AlgorithmS Library
2.8.0
|
An element buffer contains vertex indices that form primitives. More...
#include <OpenGLFramework/Base/glfElementBuffer.hh>
Public Member Functions | |
void | Create (int numIndices, GLenum type, GLenum mode, const void *indices) |
Creates the element buffer for the given number of indices. More... | |
void | Create (const std::vector< unsigned char > &indices, GLenum mode) |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_BYTE. More... | |
void | Create (const std::vector< unsigned short > &indices, GLenum mode) |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_SHORT. More... | |
void | Create (const std::vector< unsigned int > &indices, GLenum mode) |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_INT;. More... | |
void | Draw (int first=0, int count=-1) const |
Draw elements from the buffer. More... | |
glfElementBuffer () | |
void * | Map () |
Maps the element buffer to system memory, so it can be modified after creation. More... | |
void | Unmap () |
Unmaps the element buffer. More... | |
~glfElementBuffer () | |
An element buffer contains vertex indices that form primitives.
With element buffers, a single vertex can be used by multiple primitives, although it is only stored once in the vertex buffer.
Definition at line 40 of file glfElementBuffer.hh.
glfElementBuffer::glfElementBuffer | ( | ) |
Definition at line 31 of file glfElementBuffer.cpp.
glfElementBuffer::~glfElementBuffer | ( | ) |
Definition at line 40 of file glfElementBuffer.cpp.
void glfElementBuffer::Create | ( | int | numIndices, |
GLenum | type, | ||
GLenum | mode, | ||
const void * | indices | ||
) |
Creates the element buffer for the given number of indices.
numIndices | Number of indices to fit into the buffer. |
type | Data type of indices. May be GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT. |
mode | Primitive type. May be GL_POINTS, GL_LINE_STRIP, GL_LINE_LOOP, GL_LINES, GL_TRIANGLE_STRIP, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_QUAD_STRIP, GL_QUADS, or GL_POLYGON. |
indices | Pointer to vertex indices. |
Definition at line 58 of file glfElementBuffer.cpp.
Referenced by BIAS::Primitives::AddRelativeQuadPatches(), BIAS::Primitives::AddRelativeQuadPatchOverImageLine(), BIAS::Primitives::LocalNormalizedPointCloud(), BIAS::Primitives::LocalNormalizedTriangleMesh(), BIAS::Primitives::LocalNormalizedTriangleStrip(), BIAS::Primitives::LocalPerspectivePatches(), BIAS::Primitives::LocalPerspectivePatchOverLine(), BIAS::Primitives::LocalPerspectiveQuad(), BIAS::Primitives::PlainQuad2DWithTexture2D(), and BIAS::PMDWarp::SetupDefaultPrimitiveRendering_().
|
inline |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_BYTE.
Definition at line 61 of file glfElementBuffer.hh.
|
inline |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_SHORT.
Definition at line 69 of file glfElementBuffer.hh.
|
inline |
Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_INT;.
Definition at line 77 of file glfElementBuffer.hh.
void glfElementBuffer::Draw | ( | int | first = 0 , |
int | count = -1 |
||
) | const |
Draw elements from the buffer.
Definition at line 138 of file glfElementBuffer.cpp.
Referenced by BIAS::glfBatch::Draw().
void * glfElementBuffer::Map | ( | ) |
Maps the element buffer to system memory, so it can be modified after creation.
Definition at line 109 of file glfElementBuffer.cpp.
void glfElementBuffer::Unmap | ( | ) |
Unmaps the element buffer.
Must be called after glfElementBuffer::Map and before the element buffer is used for rendering again.
Definition at line 123 of file glfElementBuffer.cpp.