gfm



class  GLBuffer;

OpenGL Buffer wrapper.


this(OpenGL gl, GLuint target, GLuint usage);

Creates an empty buffer.

Throws
OpenGLException on error.

this(T)(OpenGL gl, GLuint target, GLuint usage, T[] buffer);

Creates a buffer already filled with data.

Throws
OpenGLException on error.

const pure nothrow @property size_t  size();

Returns
Size of buffer in bytes.

void  setData(T)(T[] buffer);

Returns
Copy bytes to the buffer.
Throws
OpenGLException on error.

void  setData(size_t size, void* data);

Returns
Copy bytes to the buffer.
Throws
OpenGLException on error.

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.

Throws
OpenGLException on error.

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

Gets a sub-part of a buffer.

Throws
OpenGLException on error.

ubyte[]  getBytes();

Gets the whole buffer content in a newly allocated array.

This is intended for debugging purposes.

Throws
OpenGLException on error.

void  bind();

Binds this buffer.

Throws
OpenGLException on error.

void  unbind();

Unbinds this buffer.

Throws
OpenGLException on error.

const pure nothrow GLuint  handle();

Returns
Wrapped OpenGL resource  handle.