MRPT
1.9.9
|
A wrapper for an OpenGL buffer object.
Refer to docs for glGenBuffers() and glBufferData().
Definition at line 21 of file COpenGLBuffer.h.
#include <mrpt/opengl/COpenGLBuffer.h>
Classes | |
struct | RAII_Impl |
Public Types | |
enum | Type : unsigned int { Type::Vertex = 0x8892, Type::ElementIndex = 0x8893, Type::PixelPack = 0x88EB, Type::PixelUnpack = 0x88EC } |
enum | Usage : unsigned int { Usage::StreamDraw = 0x88E0, Usage::StreamRead = 0x88E1, Usage::StreamCopy = 0x88E2, Usage::StaticDraw = 0x88E4, Usage::StaticRead = 0x88E5, Usage::StaticCopy = 0x88E6, Usage::DynamicDraw = 0x88E8, Usage::DynamicRead = 0x88E9, Usage::DynamicCopy = 0x88EA } |
Public Member Functions | |
COpenGLBuffer (const Type type) | |
COpenGLBuffer () | |
~COpenGLBuffer ()=default | |
Type | type () const |
Usage | usage () const |
void | setUsage (const Usage u) |
void | create () |
Actually create the buffer, destroying any previously existing buffer. More... | |
void | createOnce () |
Calls create() only if the buffer has not been created yet. More... | |
bool | isCreated () const |
void | destroy () |
Automatically called upon destructor, no need for the user to call it in normal situations. More... | |
void | bind () |
void | release () |
unsigned int | bufferId () const |
void | allocate (const void *data, int byteCount) |
Reserves byteCount bytes in the buffer and copy to it the provided data. More... | |
Private Attributes | |
std::shared_ptr< RAII_Impl > | m_impl |
|
strong |
Enumerator | |
---|---|
Vertex | |
ElementIndex | |
PixelPack | |
PixelUnpack |
Definition at line 24 of file COpenGLBuffer.h.
|
strong |
Enumerator | |
---|---|
StreamDraw | |
StreamRead | |
StreamCopy | |
StaticDraw | |
StaticRead | |
StaticCopy | |
DynamicDraw | |
DynamicRead | |
DynamicCopy |
Definition at line 32 of file COpenGLBuffer.h.
|
explicit |
Definition at line 18 of file COpenGLBuffer.cpp.
References m_impl, and type().
|
inline |
Definition at line 46 of file COpenGLBuffer.h.
|
default |
|
inline |
Reserves byteCount bytes in the buffer and copy to it the provided data.
create() and bind() must be called before using this method.
Definition at line 78 of file COpenGLBuffer.h.
References mrpt::opengl::internal::data, and m_impl.
|
inline |
Definition at line 70 of file COpenGLBuffer.h.
References m_impl.
Referenced by mrpt::opengl::CRenderizableShaderWireFrame::render(), mrpt::opengl::CRenderizableShaderText::render(), mrpt::opengl::CRenderizableShaderTriangles::render(), and mrpt::opengl::CRenderizableShaderPoints::render().
|
inline |
Definition at line 73 of file COpenGLBuffer.h.
References m_impl.
|
inline |
Actually create the buffer, destroying any previously existing buffer.
Call after setting the type and usage.
Definition at line 57 of file COpenGLBuffer.h.
References m_impl.
Referenced by createOnce().
|
inline |
Calls create() only if the buffer has not been created yet.
Definition at line 60 of file COpenGLBuffer.h.
References create(), and isCreated().
|
inline |
Automatically called upon destructor, no need for the user to call it in normal situations.
Definition at line 68 of file COpenGLBuffer.h.
References m_impl.
Referenced by mrpt::opengl::COpenGLBuffer::RAII_Impl::create(), mrpt::opengl::CRenderizableShaderText::freeOpenGLResources(), mrpt::opengl::CRenderizableShaderTexturedTriangles::freeOpenGLResources(), mrpt::opengl::CRenderizableShaderTriangles::freeOpenGLResources(), mrpt::opengl::CRenderizableShaderWireFrame::freeOpenGLResources(), mrpt::opengl::CRenderizableShaderPoints::freeOpenGLResources(), and mrpt::opengl::COpenGLBuffer::RAII_Impl::~RAII_Impl().
|
inline |
Definition at line 64 of file COpenGLBuffer.h.
References m_impl.
Referenced by createOnce().
|
inline |
Definition at line 71 of file COpenGLBuffer.h.
References m_impl.
Referenced by mrpt::opengl::COpenGLBuffer::RAII_Impl::destroy().
|
inline |
Definition at line 52 of file COpenGLBuffer.h.
References m_impl.
|
inline |
Definition at line 49 of file COpenGLBuffer.h.
References m_impl.
Referenced by mrpt::opengl::COpenGLBuffer::RAII_Impl::allocate(), mrpt::opengl::COpenGLBuffer::RAII_Impl::bind(), COpenGLBuffer(), and mrpt::opengl::COpenGLBuffer::RAII_Impl::release().
|
inline |
Definition at line 51 of file COpenGLBuffer.h.
References m_impl.
Referenced by mrpt::opengl::COpenGLBuffer::RAII_Impl::allocate().
|
private |
Definition at line 102 of file COpenGLBuffer.h.
Referenced by allocate(), bind(), bufferId(), COpenGLBuffer(), create(), destroy(), isCreated(), release(), setUsage(), type(), and usage().
Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: c7a3bec24 Sun Mar 29 18:33:13 2020 +0200 at dom mar 29 18:50:38 CEST 2020 |