GLBuffer

OpenGL Buffer wrapper.

Constructors

this
this(GLuint target, GLuint usage)

Creates an empty buffer.

this
this(GLuint target, GLuint usage, T[] buffer)

Creates a buffer already filled with data.

Destructor

~this
~this()

Releases the OpenGL buffer resource.

Members

Functions

bind
void bind()

Binds this buffer.

getBytes
ubyte[] getBytes()

Gets the whole buffer content in a newly allocated array. <b>This is intended for debugging purposes.</b>

getSubData
void getSubData(size_t offset, size_t size, void* data)

Gets a sub-part of a buffer.

handle
GLuint handle()
setData
void setData(T[] buffer)
setData
void setData(size_t size, void* data)
setSubData
void setSubData(size_t offset, size_t size, void* data)

Copies bytes to a sub-part of the buffer. You can't adress data beyond the buffer's size.

unbind
void unbind()

Unbinds this buffer.

Properties

size
size_t size [@property getter]

Meta