UGDK
0.5.0
|
#include <ugdk/graphic/opengl/vertexbuffer.h>
Public Member Functions | |
VertexArray (size_t size, GLenum target, GLenum usage) | |
virtual | ~VertexArray () |
virtual void * | map () |
virtual void | unmap () |
virtual void | bind () const |
virtual void | unbind () const |
virtual void | fill (size_t offset, size_t size, const void *data) |
virtual const void * | getPointer (size_t offset) const |
![]() | |
VertexBuffer (size_t size, GLenum target, GLenum usage) | |
virtual | ~VertexBuffer () |
size_t | getSize () const |
GLenum | getTarget () const |
GLenum | getUsage () const |
Additional Inherited Members | |
![]() | |
static VertexBuffer * | Create (size_t size, GLenum target, GLenum usage) |
static std::shared_ptr< const VertexBuffer > | CreateDefaultShared () |
static const VertexBuffer * | CreateDefault () |
Implementation of VertexBuffer which uses plain arrays to store the data.
This implementation should be supported everywhere, and acts as a fallback on systems which do not support VBOs.
ugdk::graphic::opengl::VertexArray::VertexArray | ( | size_t | size, |
GLenum | target, | ||
GLenum | usage | ||
) |
|
virtual |
Frees the data we've allocated.
|
virtual |
Bind the VertexBuffer to the specified target. (GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER).
target | GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER. |
Implements ugdk::graphic::opengl::VertexBuffer.
|
virtual |
Fill a portion of the buffer with data.
The VertexBuffer must be bound to use this function.
offset | The offset in the VertexBuffer to store the data. |
size | The size of the incoming data. |
data | Pointer to memory to copy data from. |
Implements ugdk::graphic::opengl::VertexBuffer.
|
virtual |
Get a pointer which represents the specified byte offset.
offset | The byte offset. (0 is first byte). |
Implements ugdk::graphic::opengl::VertexBuffer.
|
virtual |
Map the VertexBuffer to client memory.
This can be faster for large changes to the buffer. For smaller changes, see fill().
The VertexBuffer must be bound to use this function.
Implements ugdk::graphic::opengl::VertexBuffer.
|
virtual |
Unbind a prevously bound VertexBuffer.
Implements ugdk::graphic::opengl::VertexBuffer.
|
virtual |
Unmap a previously mapped VertexBuffer. The buffer must be unmapped when used to draw elements.
The VertexBuffer must be bound to use this function.
Implements ugdk::graphic::opengl::VertexBuffer.