Object handle for OpenGL Buffer Object (VBO, PBO, VAO, ...).
More...
#include <HdlGeBO.hpp>
|
| HdlGeBO (GLsizeiptr _size, GLenum infoTarget, GLenum infoUsage) |
| HdlGeBO Construtor. More...
|
|
| HdlGeBO (GLuint id, GLsizeiptr _size, GLenum infoTarget, GLenum infoUsage) |
| HdlGeBO Construtor. More...
|
|
GLsizeiptr | getSize (void) |
| Get the size of the Buffer Object. More...
|
|
GLuint | getID (void) |
| Get the ID of the Buffer Object. More...
|
|
GLenum | getTarget (void) |
| Get the target of the Buffer Object. More...
|
|
GLenum | getUsage (void) |
| Get the usage of the Buffer Object. More...
|
|
void | bind (GLenum target=GL_NONE) |
| Bind the Buffer Object to target. More...
|
|
void * | map (GLenum access=GL_NONE, GLenum target=GL_NONE) |
| Map the Buffer Object into the CPU memory. More...
|
|
void | write (const void *data) |
| Write data to a Buffer Object with classical glBufferData method. More...
|
|
void | subWrite (const void *data, GLsizeiptr size, GLintptr offset) |
| Write data to a Buffer Object with classical glBufferSubData method. More...
|
|
|
static void | unbind (GLenum target) |
| Unbind any Buffer Object. More...
|
|
static void | unmap (GLenum target) |
| Unmap any Buffer Object. More...
|
|
static bool | isBound (GLenum target) |
| Test if the target is bound. More...
|
|
static bool | isMapped (GLenum target) |
| Test if the target is mapped. More...
|
|
Object handle for OpenGL Buffer Object (VBO, PBO, VAO, ...).
HdlGeBO::HdlGeBO |
( |
GLsizeiptr |
_size, |
|
|
GLenum |
infoTarget, |
|
|
GLenum |
infoUsage |
|
) |
| |
HdlGeBO Construtor.
- Parameters
-
_size | Size of the buffer, in bytes. |
infoTarget | Target kind, among GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB. |
infoUsage | Usage kind among GL_STATIC_DRAW_ARB, GL_STATIC_READ_ARB, GL_STATIC_COPY_ARB, GL_DYNAMIC_DRAW_ARB, GL_DYNAMIC_READ_ARB, GL_DYNAMIC_COPY_ARB, GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, GL_STREAM_COPY_ARB. |
HdlGeBO::HdlGeBO |
( |
GLuint |
id, |
|
|
GLsizeiptr |
_size, |
|
|
GLenum |
infoTarget, |
|
|
GLenum |
infoUsage |
|
) |
| |
HdlGeBO Construtor.
- Parameters
-
id | GL id of the Buffer Object to be mapped in. |
_size | Size of the buffer, in bytes. |
infoTarget | Target kind, among GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB. |
infoUsage | Usage kind among GL_STATIC_DRAW_ARB, GL_STATIC_READ_ARB, GL_STATIC_COPY_ARB, GL_DYNAMIC_DRAW_ARB, GL_DYNAMIC_READ_ARB, GL_DYNAMIC_COPY_ARB, GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, GL_STREAM_COPY_ARB. |
void HdlGeBO::bind |
( |
GLenum |
target = GL_NONE | ) |
|
Bind the Buffer Object to target.
- Parameters
-
target | The target (GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB), default is the target specified for this object. |
GLuint HdlGeBO::getID |
( |
void |
| ) |
|
Get the ID of the Buffer Object.
- Returns
- ID of the Buffer Object
GLsizeiptr HdlGeBO::getSize |
( |
void |
| ) |
|
Get the size of the Buffer Object.
- Returns
- Size of the BO in bytes.
GLenum HdlGeBO::getTarget |
( |
void |
| ) |
|
Get the target of the Buffer Object.
- Returns
- Target of the Buffer Object, among : GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB.
GLenum HdlGeBO::getUsage |
( |
void |
| ) |
|
Get the usage of the Buffer Object.
- Returns
- ID of the usage, among : GL_STATIC_DRAW_ARB, GL_STATIC_READ_ARB, GL_STATIC_COPY_ARB, GL_DYNAMIC_DRAW_ARB, GL_DYNAMIC_READ_ARB, GL_DYNAMIC_COPY_ARB, GL_STREAM_DRAW_ARB, GL_STREAM_READ_ARB, GL_STREAM_COPY_ARB.
bool HdlGeBO::isBound |
( |
GLenum |
target | ) |
|
|
static |
Test if the target is bound.
- Parameters
-
target | The target (GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB). |
- Returns
- true if the target is bound.
bool HdlGeBO::isMapped |
( |
GLenum |
target | ) |
|
|
static |
Test if the target is mapped.
- Parameters
-
target | The target (GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB). |
- Returns
- true if the target is mapped.
void * HdlGeBO::map |
( |
GLenum |
target = GL_NONE , |
|
|
GLenum |
access = GL_NONE |
|
) |
| |
Map the Buffer Object into the CPU memory.
- Parameters
-
access | Kind of access, among GL_READ_ONLY_ARB, GL_WRITE_ONLY_ARB, GL_READ_WRITE_ARB, default can be used is target is GL_PIXEL_UNPACK_BUFFER_ARB or GL_PIXEL_PACK_BUFFER_ARB (will use respectively GL_WRITE_ONLY_ARB or GL_READ_ONLY_ARB). Will raise an exception otherwise. |
target | Target mapping point, among GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB, default is the target specified for this object. |
- Returns
- Pointer in CPU memory.
void HdlGeBO::subWrite |
( |
const void * |
data, |
|
|
GLsizeiptr |
size, |
|
|
GLintptr |
offset |
|
) |
| |
Write data to a Buffer Object with classical glBufferSubData method.
- Parameters
-
data | The data to write. |
size | Size, in bytes, of the subset. |
offset | Offset to apply, in bytes, before writting. |
void HdlGeBO::unbind |
( |
GLenum |
target | ) |
|
|
static |
Unbind any Buffer Object.
- Parameters
-
target | Target binding point, among GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB. |
void HdlGeBO::unmap |
( |
GLenum |
target | ) |
|
|
static |
Unmap any Buffer Object.
- Parameters
-
target | Target binding point, among GL_ARRAY_BUFFER_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB, GL_PIXEL_UNPACK_BUFFER_ARB, GL_PIXEL_PACK_BUFFER_ARB. |
void HdlGeBO::write |
( |
const void * |
data | ) |
|
Write data to a Buffer Object with classical glBufferData method.
- Parameters
-
data | The data to write (must be the same size than the GeBO). |
The documentation for this class was generated from the following files: