![]() |
Kale
|
#include <Buffer.hpp>
Public Member Functions | |
void | allocBuffer (BufferUsage usage) |
void | updateBuffer () |
Buffer (BufferType type) | |
template<size_t N> | |
Buffer (BufferType type, BufferUsage usage, const std::array< T, N > &data) | |
Buffer (BufferType type, BufferUsage usage, const std::vector< T > &dat) | |
Buffer (BufferType type, BufferUsage usage, std::vector< T > &&dat) | |
Buffer (BufferType type, BufferUsage usage, const T *arr, size_t n) | |
Buffer (const Buffer &other)=delete | |
void | operator= (const Buffer &other)=delete |
~Buffer () | |
size_t | size () const |
const T & | operator[] (size_t i) const |
T & | operator[] (size_t i) |
std::vector< T >::iterator | begin () |
std::vector< T >::iterator | end () |
std::vector< T >::const_iterator | cbegin () const |
std::vector< T >::const_iterator | cend () const |
void | bind () const |
template<size_t N> | |
void | modify (size_t i, const std::array< T, N > &val) |
void | modify (size_t i, const std::vector< T > &val) |
void | modify (size_t i, const T *arr, size_t n) |
void | modify (size_t i, T val) |
void | resize (BufferUsage usage, size_t newSize) |
template<size_t N> | |
void | resize (BufferUsage usage, const std::array< T, N > &arr) |
void | resize (BufferUsage usage, const std::vector< T > &vec) |
void | resize (BufferUsage usage, std::vector< T > &&vec) |
void | resize (BufferUsage usage, const T *arr, size_t n) |
Public Attributes | |
std::vector< T > | data |
Private Attributes | |
unsigned int | buffer |
BufferType | type |
Represents a block of data on the GPU
Definition at line 52 of file Buffer.hpp.
|
inline |
|
inline |
Creates a buffer from an array
type | The type of buffer |
usage | The usage of the buffer |
data | The data to create the buffer from |
Definition at line 104 of file Buffer.hpp.
|
inline |
Creates a buffer from a vector
type | The type of buffer |
usage | The usage of the buffer |
dat | The data to create the buffer from |
Definition at line 116 of file Buffer.hpp.
|
inline |
Creates a buffer from a vector
type | The type of buffer |
usage | The usage of the buffer |
dat | The data to create the buffer from |
Definition at line 127 of file Buffer.hpp.
|
inline |
Creates a buffer from a C array
type | The type of buffer |
usage | The usage of the buffer |
arr | The data to create the buffer from |
n | The length of the array |
Definition at line 139 of file Buffer.hpp.
|
delete |
Buffers do not support copying
|
inline |
Destroys the buffer and frees resources from the GPU
Definition at line 157 of file Buffer.hpp.
|
inline |
Reallocates the buffer on the GPU to the data within the vector
usage | The usage of the buffer |
Definition at line 76 of file Buffer.hpp.
|
inline |
Gets the beginning iterator of the data
Definition at line 189 of file Buffer.hpp.
|
inline |
Binds the buffer for use directly with opengl commands
Definition at line 217 of file Buffer.hpp.
|
inline |
Gets the beginning iterator of the data
Definition at line 203 of file Buffer.hpp.
|
inline |
Gets the beginning iterator of the data
Definition at line 210 of file Buffer.hpp.
|
inline |
Gets the beginning iterator of the data
Definition at line 196 of file Buffer.hpp.
|
inline |
modifies the buffer
i | The index to begin modifying at |
val | The data to modify and replace with |
Definition at line 226 of file Buffer.hpp.
|
inline |
modifies the buffer
i | The index to begin modifying at |
val | The data to modify and replace with |
Definition at line 237 of file Buffer.hpp.
|
inline |
modifies the buffer
i | The index to begin modifying at |
arr | The data to modify and replace with |
n | The length of the array/val data |
Definition at line 249 of file Buffer.hpp.
|
inline |
Modifies the buffer
i | The index to modify |
val | The data to replace the existing data at the index with |
Definition at line 260 of file Buffer.hpp.
|
delete |
Buffers do not support copying
|
inline |
Retrieves the value in the buffer at a certain index
i | The index |
Definition at line 182 of file Buffer.hpp.
|
inline |
Retrieves the value in the buffer at a certain index
i | The index |
Definition at line 173 of file Buffer.hpp.
|
inline |
Resizes the buffer to a given array and replaces the data
usage | The usage for the buffer |
arr | the array to resize to and replace with |
Definition at line 281 of file Buffer.hpp.
|
inline |
Resizes the buffer to a given vector and replaces the data
usage | The usage for the buffer |
vec | the vector to resize to and replace with |
Definition at line 292 of file Buffer.hpp.
|
inline |
Resizes the buffer to a given c array and replaces the data
usage | The usage for the buffer |
arr | the c array to resize to and replace with |
n | The length of the c array |
Definition at line 313 of file Buffer.hpp.
|
inline |
Resizes the buffer to a given new size
usage | The usage for the buffer |
newSize | the new size of the buffer |
Definition at line 271 of file Buffer.hpp.
|
inline |
Resizes the buffer to a given vector and replaces the data
usage | The usage for the buffer |
vec | the vector to resize to and replace with |
Definition at line 302 of file Buffer.hpp.
|
inline |
Returns the length of the data
Definition at line 164 of file Buffer.hpp.
|
inline |
Updates the buffer on the GPU to the data within the vector, if the vector has been resized this will crash.
Definition at line 84 of file Buffer.hpp.
|
private |
The location of the buffer for opengl accessing
Definition at line 58 of file Buffer.hpp.
std::vector<T> Kale::OpenGL::Buffer< T >::data |
The data this buffer holds
Definition at line 70 of file Buffer.hpp.
|
private |
The type of buffer this is
Definition at line 63 of file Buffer.hpp.