C++ wrapper for an OpenGL buffer object.
More...
#include <Buffer.hpp>
|
|
| Buffer () |
| | Construct and allocate an OpenGL buffer object.
|
| |
|
| ~Buffer () |
| | Destroy the buffer object.
|
| |
| void | set_buffer_data (GLenum target, GLenum usage, const void *ptr, size_t size) |
| | Set the buffer's data, target, and usage. More...
|
| |
| void | set_buffer_data (GLenum target, GLenum usage, std::initializer_list< GLfloat > data) |
| | Set the buffer's data, target, and usage. More...
|
| |
| void | set_buffer_data_d (GLenum target, GLenum usage, std::initializer_list< GLdouble > data) |
| | Set the buffer's data, target, and usage. More...
|
| |
| GLuint | id () const |
| | Get the buffer object's ID. More...
|
| |
|
void | bind () const |
| | Bind the buffer object.
|
| |
|
| static std::shared_ptr< Buffer > | create () |
| | Factory method to construct a Buffer. More...
|
| |
| static std::shared_ptr< Buffer > | create (GLenum target, GLenum usage, const void *ptr, size_t size) |
| | Factory method to construct a Buffer and fill it with data. More...
|
| |
| static std::shared_ptr< Buffer > | create (GLenum target, GLenum usage, std::initializer_list< GLfloat > data) |
| | Factory method to construct a Buffer and fill it with data. More...
|
| |
| static std::shared_ptr< Buffer > | create_d (GLenum target, GLenum usage, std::initializer_list< GLdouble > data) |
| | Factory method to construct a Buffer and fill it with data. More...
|
| |
|
|
void | allocate () |
| | Allocate the OpenGL buffer object.
|
| |
|
|
GLuint | m_id |
| | The buffer object's ID.
|
| |
|
GLenum | m_target |
| | The target for binding the buffer.
|
| |
C++ wrapper for an OpenGL buffer object.
| static std::shared_ptr<Buffer> glcxx::Buffer::create |
( |
| ) |
|
|
inlinestatic |
Factory method to construct a Buffer.
This method does not fill the buffer with any data.
- Returns
- std::shared_ptr to the created Buffer.
| static std::shared_ptr<Buffer> glcxx::Buffer::create |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
const void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
inlinestatic |
Factory method to construct a Buffer and fill it with data.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| ptr | Pointer to data to load in buffer. |
| size | Length of the data to load in buffer. |
- Returns
- std::shared_ptr to a Buffer.
| static std::shared_ptr<Buffer> glcxx::Buffer::create |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
std::initializer_list< GLfloat > |
data |
|
) |
| |
|
inlinestatic |
Factory method to construct a Buffer and fill it with data.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| data | Data to load in buffer. |
| static std::shared_ptr<Buffer> glcxx::Buffer::create_d |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
std::initializer_list< GLdouble > |
data |
|
) |
| |
|
inlinestatic |
Factory method to construct a Buffer and fill it with data.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| data | Data to load in buffer. |
| GLuint glcxx::Buffer::id |
( |
| ) |
const |
|
inline |
Get the buffer object's ID.
- Returns
- The buffer object's ID.
| void glcxx::Buffer::set_buffer_data |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
const void * |
ptr, |
|
|
size_t |
size |
|
) |
| |
Set the buffer's data, target, and usage.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| ptr | Pointer to data to load in buffer. |
| size | Length of the data to load in buffer. |
| void glcxx::Buffer::set_buffer_data |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
std::initializer_list< GLfloat > |
data |
|
) |
| |
|
inline |
Set the buffer's data, target, and usage.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| data | Data to load in buffer. |
| void glcxx::Buffer::set_buffer_data_d |
( |
GLenum |
target, |
|
|
GLenum |
usage, |
|
|
std::initializer_list< GLdouble > |
data |
|
) |
| |
|
inline |
Set the buffer's data, target, and usage.
- Parameters
-
| target | Buffer target (e.g. GL_ARRAY_BUFFER). |
| usage | Buffer usage hint (e.g. GL_STATIC_DRAW). |
| data | Data to load in buffer. |
The documentation for this class was generated from the following files: