Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
BIAS::glfElementBuffer Class Reference

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 ()
 

Detailed Description

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.

Author
jkollmann
Examples:
ExampleRenderingContext.cpp.

Definition at line 40 of file glfElementBuffer.hh.

Constructor & Destructor Documentation

glfElementBuffer::glfElementBuffer ( )

Definition at line 31 of file glfElementBuffer.cpp.

glfElementBuffer::~glfElementBuffer ( )

Definition at line 40 of file glfElementBuffer.cpp.

Member Function Documentation

void glfElementBuffer::Create ( int  numIndices,
GLenum  type,
GLenum  mode,
const void *  indices 
)

Creates the element buffer for the given number of indices.

Parameters
numIndicesNumber of indices to fit into the buffer.
typeData type of indices. May be GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT.
modePrimitive 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.
indicesPointer to vertex indices.
Examples:
ExampleRenderingContext.cpp.

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_().

void BIAS::glfElementBuffer::Create ( const std::vector< unsigned char > &  indices,
GLenum  mode 
)
inline

Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_BYTE.

Definition at line 61 of file glfElementBuffer.hh.

void BIAS::glfElementBuffer::Create ( const std::vector< unsigned short > &  indices,
GLenum  mode 
)
inline

Secure convenience wrapper for glfElementBuffer::Create method with type = GL_UNSIGNED_SHORT.

Definition at line 69 of file glfElementBuffer.hh.

void BIAS::glfElementBuffer::Create ( const std::vector< unsigned int > &  indices,
GLenum  mode 
)
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.

Attention
Access is write-only!

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.


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