This class represents a general unformatted linear memory stored on the graphics card. More...
#include <Luminous/Buffer.hpp>
Public Types | |
| enum | MapAccess { MAP_READ = GL_MAP_READ_BIT, MAP_WRITE = GL_MAP_WRITE_BIT, MAP_READ_WRITE = MAP_READ | MAP_WRITE, MAP_INVALIDATE_RANGE = GL_MAP_INVALIDATE_RANGE_BIT, MAP_INVALIDATE_BUFFER = GL_MAP_INVALIDATE_BUFFER_BIT, MAP_FLUSH_EXPLICIT = GL_MAP_FLUSH_EXPLICIT_BIT, MAP_UNSYNCHRONIZED = GL_MAP_UNSYNCHRONIZED_BIT } |
| Map access modifiers. | |
| enum | Type { UNKNOWN = 0, VERTEX = GL_ARRAY_BUFFER, INDEX = GL_ELEMENT_ARRAY_BUFFER, UNIFORM = GL_UNIFORM_BUFFER } |
| Buffer object type. | |
| enum | Usage { STATIC_DRAW = GL_STATIC_DRAW, STATIC_READ = GL_STATIC_READ, STATIC_COPY = GL_STATIC_COPY, STREAM_DRAW = GL_STREAM_DRAW, STREAM_READ = GL_STREAM_READ, STREAM_COPY = GL_STREAM_COPY, DYNAMIC_DRAW = GL_DYNAMIC_DRAW, DYNAMIC_READ = GL_DYNAMIC_READ, DYNAMIC_COPY = GL_DYNAMIC_COPY } |
| Hint indicating the expected application usage pattern of the buffer. More... | |
Public Types inherited from Luminous::RenderResource | |
| typedef uint64_t | Id |
| Id of a resource. | |
| enum | Type { VertexArray, Buffer, Program, Texture, RenderBuffer, FrameBuffer } |
| Different types of render resources. More... | |
Public Member Functions | |
| LUMINOUS_API | Buffer () |
| Constructor. | |
| LUMINOUS_API | Buffer (const Buffer &b) |
| Copy constructor. More... | |
| LUMINOUS_API | Buffer (Buffer &&b) |
| Move constructor. More... | |
| LUMINOUS_API const void * | data () const |
| Get a pointer to the buffer data. More... | |
| LUMINOUS_API Buffer & | operator= (const Buffer &b) |
| Assignment operator. More... | |
| LUMINOUS_API Buffer & | operator= (Buffer &&b) |
| Move assignment operator. More... | |
| LUMINOUS_API void | setData (const void *data, size_t size, Usage usage) |
| Set the buffer contents. More... | |
| LUMINOUS_API size_t | size () const |
| Get the size of the buffer. More... | |
| LUMINOUS_API Usage | usage () const |
| Get the usage hints for the buffer. More... | |
| LUMINOUS_API | ~Buffer () |
| Destructor. | |
Public Member Functions inherited from Luminous::RenderResource | |
| unsigned int | expiration () const |
| Returns resource expiration time. More... | |
| int | generation () const |
| Returns generation of this resource. More... | |
| void | invalidate () |
| Invalidates correspondent GPU objects and forces uploading of data to GPU. | |
| RenderResource & | operator= (RenderResource &&rr) |
| Move assignment operator. More... | |
| RenderResource (Type type) | |
| Constructor of RenderResource. More... | |
| RenderResource (RenderResource &&rr) | |
| Move constructor. More... | |
| Id | resourceId () const |
| Returns identifier of resource. More... | |
| Type | resourceType () const |
| Returns type of the resource. More... | |
| void | setExpiration (unsigned int seconds) |
| Set resource expiration time. More... | |
| void | setGeneration (int generation) |
| Sets generation for this resource. More... | |
| virtual | ~RenderResource () |
| Destructor of RenderResource. | |
Friends | |
| class | VertexArray |
Additional Inherited Members | |
Protected Member Functions inherited from Luminous::RenderResource | |
| RenderResource & | operator= (const RenderResource &rr) |
| Assignment operator. More... | |
| RenderResource (const RenderResource &rr) | |
| Copy constructor. More... | |
This class represents a general unformatted linear memory stored on the graphics card.
It can be used to store vertex data, pixel data retrieved from images or the framebuffer, etc. GPU correspondent of this class is BufferGL.
Hint indicating the expected application usage pattern of the buffer.
A buffers data store is sourced when it is read from as a result of OpenGL commands which specify images, or invoke shaders accessing buffer data as a result of drawing commands or compute shader dispatch.
| LUMINOUS_API Luminous::Buffer::Buffer | ( | const Buffer & | b | ) |
Copy constructor.
| b | buffer to copy |
| LUMINOUS_API Luminous::Buffer::Buffer | ( | Buffer && | b | ) |
Move constructor.
| b | buffer to move |
| LUMINOUS_API const void* Luminous::Buffer::data | ( | ) | const |
Get a pointer to the buffer data.
Assignment operator.
| b | buffer to copy |
Move assignment operator.
| b | buffer to move |
| LUMINOUS_API void Luminous::Buffer::setData | ( | const void * | data, |
| size_t | size, | ||
| Usage | usage | ||
| ) |
Set the buffer contents.
Does not copy the data. The pointer must remain valid as long as the buffer is in use.
| data | pointer to data |
| size | size of the data in bytes |
| usage | usage hint |
| LUMINOUS_API size_t Luminous::Buffer::size | ( | ) | const |
Get the size of the buffer.
| LUMINOUS_API Usage Luminous::Buffer::usage | ( | ) | const |
Get the usage hints for the buffer.