SimpleGL
1.1.0
A framework for platform independent rendering
|
This class wraps an OpenGL buffer object. More...
#include <vertex_buffer_object.hpp>
Public Member Functions | |
Buffer (void) | |
Generates a new buffer object. More... | |
~Buffer (void) | |
Deletes the buffer object. More... | |
GLuint | getHandle () |
Returns the handle of the buffer object. More... | |
void | bind (BufferTarget target) |
Binds the buffer object with the specified target. More... | |
void | uploadData (BufferTarget target, long size, float *data, BufferUsage usage) |
Uploads the specified data to the buffer object. More... | |
void | uploadData (BufferTarget target, long size, std::vector< float > data, BufferUsage usage) |
Uploads the specified data to the buffer object. More... | |
void | uploadData (BufferTarget target, long size, std::vector< glm::vec2 > data, BufferUsage usage) |
Uploads the specified data to the buffer object. More... | |
void | uploadData (BufferTarget target, long size, std::vector< glm::vec3 > data, BufferUsage usage) |
Uploads the specified data to the buffer object. More... | |
void | uploadData (BufferTarget target, long size, std::vector< glm::vec4 > data, BufferUsage usage) |
Uploads the specified data to the buffer object. More... | |
void | uploadData (BufferTarget target, long size, BufferUsage usage) |
Uploads NULL data to the buffer object to allocate memory. More... | |
void | uploadSubData (BufferTarget target, long offset, long size, float *data) |
Uploads the specified data to the buffer object starting at the offset. More... | |
void | uploadSubData (BufferTarget target, long offset, long size, std::vector< float > data) |
Uploads the specified data to the buffer object starting at the offset. More... | |
void | uploadSubData (BufferTarget target, long offset, long size, std::vector< glm::vec2 > data) |
Uploads the specified data to the buffer object starting at the offset. More... | |
void | uploadSubData (BufferTarget target, long offset, long size, std::vector< glm::vec3 > data) |
Uploads the specified data to the buffer object starting at the offset. More... | |
void | uploadSubData (BufferTarget target, long offset, long size, std::vector< glm::vec4 > data) |
Uploads the specified data to the buffer object starting at the offset. More... | |
void * | map (BufferTarget target, MapAccess access) |
Maps the buffer object. More... | |
void * | mapRange (BufferTarget target, long offset, long length, MapRangeAccess access) |
Maps the buffer object starting at the offset. More... | |
void | unmap (BufferTarget target) |
Unmaps the buffer object. More... | |
This class wraps an OpenGL buffer object.
Definition at line 106 of file vertex_buffer_object.hpp.
sgl::Buffer::Buffer | ( | void | ) |
Generates a new buffer object.
Definition at line 17 of file vertex_buffer_object.cpp.
sgl::Buffer::~Buffer | ( | void | ) |
Deletes the buffer object.
Definition at line 21 of file vertex_buffer_object.cpp.
void sgl::Buffer::bind | ( | BufferTarget | target | ) |
Binds the buffer object with the specified target.
target | Target to bind. |
Definition at line 34 of file vertex_buffer_object.cpp.
GLuint sgl::Buffer::getHandle | ( | ) |
Returns the handle of the buffer object.
Definition at line 30 of file vertex_buffer_object.cpp.
void * sgl::Buffer::map | ( | BufferTarget | target, |
MapAccess | access | ||
) |
Maps the buffer object.
target | Target to map. |
access | Access policy of the mapping. |
Definition at line 89 of file vertex_buffer_object.cpp.
void * sgl::Buffer::mapRange | ( | BufferTarget | target, |
long | offset, | ||
long | length, | ||
MapRangeAccess | access | ||
) |
Maps the buffer object starting at the offset.
target | Target to map. |
offset | Offset where the mapping should start. |
length | Length of the mapping in bytes. |
access | Access policy of the mapping. |
Definition at line 93 of file vertex_buffer_object.cpp.
void sgl::Buffer::unmap | ( | BufferTarget | target | ) |
Unmaps the buffer object.
target | Target to unmap. |
Definition at line 97 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
float * | data, | ||
BufferUsage | usage | ||
) |
Uploads the specified data to the buffer object.
target | Target to upload. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
usage | Usage of the data. |
Definition at line 45 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
std::vector< float > | data, | ||
BufferUsage | usage | ||
) |
Uploads the specified data to the buffer object.
target | Target to upload. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float vector. |
usage | Usage of the data. |
Definition at line 49 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
std::vector< glm::vec2 > | data, | ||
BufferUsage | usage | ||
) |
Uploads the specified data to the buffer object.
target | Target to upload. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float vector. |
usage | Usage of the data. |
Definition at line 53 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
std::vector< glm::vec3 > | data, | ||
BufferUsage | usage | ||
) |
Uploads the specified data to the buffer object.
target | Target to upload. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float vector. |
usage | Usage of the data. |
Definition at line 57 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
std::vector< glm::vec4 > | data, | ||
BufferUsage | usage | ||
) |
Uploads the specified data to the buffer object.
target | Target to upload. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float vector. |
usage | Usage of the data. |
Definition at line 61 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadData | ( | BufferTarget | target, |
long | size, | ||
BufferUsage | usage | ||
) |
Uploads NULL data to the buffer object to allocate memory.
target | Target to upload. |
size | Size in bytes of the data store. |
usage | Usage of the data. |
Definition at line 65 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadSubData | ( | BufferTarget | target, |
long | offset, | ||
long | size, | ||
float * | data | ||
) |
Uploads the specified data to the buffer object starting at the offset.
target | Target to upload. |
offset | Offset where the data should get uploaded in bytes. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
Definition at line 69 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadSubData | ( | BufferTarget | target, |
long | offset, | ||
long | size, | ||
std::vector< float > | data | ||
) |
Uploads the specified data to the buffer object starting at the offset.
target | Target to upload. |
offset | Offset where the data should get uploaded in bytes. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
Definition at line 73 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadSubData | ( | BufferTarget | target, |
long | offset, | ||
long | size, | ||
std::vector< glm::vec2 > | data | ||
) |
Uploads the specified data to the buffer object starting at the offset.
target | Target to upload. |
offset | Offset where the data should get uploaded in bytes. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
Definition at line 77 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadSubData | ( | BufferTarget | target, |
long | offset, | ||
long | size, | ||
std::vector< glm::vec3 > | data | ||
) |
Uploads the specified data to the buffer object starting at the offset.
target | Target to upload. |
offset | Offset where the data should get uploaded in bytes. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
Definition at line 81 of file vertex_buffer_object.cpp.
void sgl::Buffer::uploadSubData | ( | BufferTarget | target, |
long | offset, | ||
long | size, | ||
std::vector< glm::vec4 > | data | ||
) |
Uploads the specified data to the buffer object starting at the offset.
target | Target to upload. |
offset | Offset where the data should get uploaded in bytes. |
size | Size in bytes of the data to upload. |
data | The data to upload as a float array. |
Definition at line 85 of file vertex_buffer_object.cpp.