Moggle

moggle.core.gl

Gives you access to all glFunctions, GL_CONSTANTS and GLtypes.

In debug mode, glGetError() is automatically checked before and after all calls to all glFunctions (except glGetError). Any errors are then thrown as an moggle.core.gl.GLError.

When not in debug mode, moggle.core.gl simply publicly imports the Derelict OpenGL modules.

Don't forget to call loadOpenGL() after you created your OpenGL context, or some glFunctions will still be null.

The Derelict library is used for OpenGL bindings.

GLVersion loadOpenGL();
Call this after creating your OpenGL context.

class GLError: object.Exception;
The error that is thrown when glGetError() indicates an error.

template GL_type(T)
Get the GL_CONSTANT representing the type T.

This is an alias of one of GL_FLOAT, GL_DOUBLE, GL_UNSIGNED_INT, GL_INT, GL_UNSIGNED_SHORT, GL_SHORT, GL_UNSIGNED_BYTE, and GL_BYTE.

Examples:
assert(GL_type!float == GL_FLOAT);