Basic Image AlgorithmS Library
2.8.0
|
A vertex buffer contains an array of vertices that can be used for rendering. More...
#include <OpenGLFramework/Base/glfVertexBuffer.hh>
Public Member Functions | |
void | Bind () const |
Binds the vertex buffer in OpenGL. More... | |
void | Create (int numVertices, const glfVertexFormat &format, const void *data=NULL, bool useBufferIfPossible=true) |
Creates the vertex buffer for the given number of vertices and vertex format. More... | |
template<class T > | |
void | Create (const std::vector< T > &vertices, const glfVertexFormat &format) |
Secure convenience wrapper for other glfVertexBuffer::Create method. More... | |
int | GetBufferID () const |
glfVertexFormat | GetFormat () const |
int | GetNumVertices () const |
Returns the number of vertices in the vertex buffer. More... | |
glfVertexBuffer () | |
void * | Map () |
Maps the vertex buffer to system memory, so it can be modified after creation. More... | |
void | Unmap () |
Unmaps the vertex buffer. More... | |
~glfVertexBuffer () | |
A vertex buffer contains an array of vertices that can be used for rendering.
If possible, the buffer is stored in the video memory.
Definition at line 38 of file glfVertexBuffer.hh.
glfVertexBuffer::glfVertexBuffer | ( | ) |
Definition at line 31 of file glfVertexBuffer.cpp.
glfVertexBuffer::~glfVertexBuffer | ( | ) |
Definition at line 40 of file glfVertexBuffer.cpp.
void glfVertexBuffer::Bind | ( | ) | const |
Binds the vertex buffer in OpenGL.
Definition at line 133 of file glfVertexBuffer.cpp.
References BIAS::glfVertexFormat::Bind().
void glfVertexBuffer::Create | ( | int | numVertices, |
const glfVertexFormat & | format, | ||
const void * | data = NULL , |
||
bool | useBufferIfPossible = true |
||
) |
Creates the vertex buffer for the given number of vertices and vertex format.
If the given data is non-NULL
, it will be uploaded to the vertex buffer. It must contain numVertices
vertices of the given format
. The size of the given data buffer must be numVertices * format.GetVertexSize()
bytes.
Definition at line 59 of file glfVertexBuffer.cpp.
References BIAS::glfVertexFormat::GetVertexSize().
Referenced by BIAS::Primitives::AddRelativeQuadPatches(), BIAS::Primitives::AddRelativeQuadPatchOverImageLine(), BIAS::clfTrimmedICP::clfTrimmedICP(), BIAS::Primitives::LocalNormalizedVertexCloud(), BIAS::Primitives::LocalPerspectivePatches(), BIAS::Primitives::LocalPerspectivePatchOverLine(), BIAS::Primitives::LocalPerspectiveQuad(), BIAS::Primitives::PlainQuad2DWithTexture2D(), and BIAS::PMDWarp::SetupDefaultPrimitiveRendering_().
|
inline |
Secure convenience wrapper for other glfVertexBuffer::Create method.
T is the vertex structure in C++ that is described by format
.
Definition at line 58 of file glfVertexBuffer.hh.
References BIAS::glfVertexFormat::GetVertexSize().
|
inline |
Definition at line 85 of file glfVertexBuffer.hh.
Referenced by BIAS::clfBuffer::AllocateFromVertexBuffer().
|
inline |
Definition at line 87 of file glfVertexBuffer.hh.
Referenced by BIAS::clfBuffer::AllocateFromVertexBuffer().
int glfVertexBuffer::GetNumVertices | ( | ) | const |
Returns the number of vertices in the vertex buffer.
Definition at line 128 of file glfVertexBuffer.cpp.
Referenced by BIAS::clfBuffer::AllocateFromVertexBuffer(), and BIAS::glfBatch::Draw().
void * glfVertexBuffer::Map | ( | ) |
Maps the vertex buffer to system memory, so it can be modified after creation.
Definition at line 99 of file glfVertexBuffer.cpp.
Referenced by BIAS::clfTrimmedICP::setFromDepthMap_().
void glfVertexBuffer::Unmap | ( | ) |
Unmaps the vertex buffer.
Must be called after glfVertexBuffer::Map and before the vertex buffer is used for rendering again.
Definition at line 113 of file glfVertexBuffer.cpp.
Referenced by BIAS::clfTrimmedICP::setFromDepthMap_().