This class represents the Buffer class in GPU memory.
More...
#include <Luminous/BufferGL.hpp>
|
| LUMINOUS_API void | bind (Buffer::Type type) |
| | Bind the buffer to the specified type. More... |
| |
| LUMINOUS_API | BufferGL (StateGL &state, const Buffer &buffer) |
| | Constructor. More... |
| |
| LUMINOUS_API | BufferGL (BufferGL &&t) |
| | Move constructor. More... |
| |
| LUMINOUS_API void * | map (Buffer::Type type, int offset, std::size_t length, Radiant::FlagsT< Buffer::MapAccess > access) |
| | Map a range of the buffer data store. More... |
| |
| LUMINOUS_API BufferGL & | operator= (BufferGL &&t) |
| | Move assignment operator. More... |
| |
| LUMINOUS_API void | unmap (Buffer::Type type, int offset=0, std::size_t length=std::size_t(-1)) |
| | Unmaps a buffer range. More... |
| |
| LUMINOUS_API void | upload (const Buffer &buffer, Buffer::Type type) |
| | Specify buffer data. More... |
| |
| LUMINOUS_API void | upload (Buffer::Type type, int offset, std::size_t length, const void *data) |
| | Specify buffer data. More... |
| |
|
LUMINOUS_API | ~BufferGL () |
| | Destructor. |
| |
Public Member Functions inherited from Luminous::ResourceHandleGL |
| bool | expired () const |
| | Check if the resource has expired. More... |
| |
| GLuint | handle () const |
| | Get the raw OpenGL handle for the resource. More... |
| |
| ResourceHandleGL & | operator= (ResourceHandleGL &&r) |
| | Move assignment operator. More... |
| |
| | ResourceHandleGL (StateGL &state) |
| | Constructor. More... |
| |
| | ResourceHandleGL (ResourceHandleGL &&r) |
| | Move constructor. More... |
| |
| void | setExpirationSeconds (unsigned int secs) |
| | Set the expiration time in seconds for the resource. More... |
| |
| void | touch () |
| | Update the last used timestamp to current frame-time. More... |
| |
This class represents the Buffer class in GPU memory.
- See Also
- Buffer
| LUMINOUS_API Luminous::BufferGL::BufferGL |
( |
StateGL & |
state, |
|
|
const Buffer & |
buffer |
|
) |
| |
Constructor.
- Parameters
-
| state | OpenGL state |
| buffer | buffer object in CPU memory |
| LUMINOUS_API Luminous::BufferGL::BufferGL |
( |
BufferGL && |
t | ) |
|
Move constructor.
- Parameters
-
| LUMINOUS_API void Luminous::BufferGL::bind |
( |
Buffer::Type |
type | ) |
|
Bind the buffer to the specified type.
- Parameters
-
Map a range of the buffer data store.
This functions maps the buffer address space to GPU. The contents of the buffer can then directly be read/written to relative to the returned pointer.
- Parameters
-
| type | buffer type |
| offset | offset in bytes to start the mapping from |
| length | number of bytes to map |
| access | access flags |
Move assignment operator.
- Parameters
-
| LUMINOUS_API void Luminous::BufferGL::unmap |
( |
Buffer::Type |
type, |
|
|
int |
offset = 0, |
|
|
std::size_t |
length = std::size_t(-1) |
|
) |
| |
Unmaps a buffer range.
- Parameters
-
| type | buffer type |
| offset | offset in bytes to start unmapping from |
| length | number of bytes to unmap |
Specify buffer data.
This function will upload the contents of the CPU buffer to GPU memory if needed.
- Parameters
-
| LUMINOUS_API void Luminous::BufferGL::upload |
( |
Buffer::Type |
type, |
|
|
int |
offset, |
|
|
std::size_t |
length, |
|
|
const void * |
data |
|
) |
| |
Specify buffer data.
This function can be used to upload data to the GPU.
- Parameters
-
| type | buffer type |
| offset | offset in bytes to start uploading from |
| length | number of bytes to upload |
| data | pointer to data to upload from |