gfm



class  OpenGLException: object.Exception;

The one exception type thrown in this wrapper.

A failing OpenGL function should always throw an  OpenGLException.


class  OpenGL;

This object is passed around to other  OpenGL wrapper objects

to ensure library loading.

Create one to use  OpenGL.


this(Logger logger);

Load OpenGL library, redirect debug output to our logger.

You can pass a null logger if you don't want logging.

Throws
OpenGLException on error.

bool  supportsExtension(string extension);

Returns
true if the OpenGL extension is supported.

void  reload();

Reload OpenGL function pointers.

Once a first OpenGL context has been created,

you should call  reload() to get the context you want.


Redirects OpenGL debug output to the Logger.

You still has to use glDebugMessageControl to set which messages are emitted.

For example, to enable all messages, use:

glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, null, GL_TRUE);


void  debugCheck();

Check for pending OpenGL errors, log a message if there is.

Only for debug purpose since this check will be disabled in a release build.


void  runtimeCheck();

Checks pending OpenGL errors.

Throws
OpenGLException if at least one OpenGL error was pending.

nothrow bool  runtimeCheckNothrow();

Checks pending OpenGL errors.

Returns
true if at least one OpenGL error was pending. OpenGL error status is cleared.

const(char)[]  getString(GLenum name);

Returns
OpenGL string returned by glGetString.
See Also
www.opengl.org/sdk/docs/man/xhtml/glGetString.xml

const(char)[]  getString(GLenum name, GLuint index);

Returns
OpenGL string returned by glGetStringi
See Also
www.opengl.org/sdk.docs/man/xhtml/glGetString.xml

const pure nothrow @nogc int  getMajorVersion();

Returns
OpenGL major version.

const pure nothrow @nogc int  getMinorVersion();

Returns
OpenGL minor version.

const(char)[]  getVersionString();

Returns
OpenGL version string, can be "major_number.minor_number" or

"major_number.minor_number.release_number", eventually

followed by a space and additional vendor informations.
See Also
www.opengl.org/sdk/docs/man/xhtml/glGetString.xml

const(char)[]  getVendorString();

Returns
The company responsible for this OpenGL implementation, so

that you can plant a giant toxic mushroom below their office.

Vendor  getVendor();

Tries to detect the driver maker.

Returns
Identified vendor.

const(char)[]  getRendererString();

Returns
Name of the renderer. This name is typically specific

to a particular configuration of a hardware platform.

const(char)[]  getGLSLVersionString();

Returns
GLSL version string, can be "major_number.minor_number" or

"major_number.minor_number.release_number".

pure nothrow @nogc string[]  getExtensions();

Returns
A slice made up of available extension names.

int  getInteger(GLenum pname);

Calls glGetIntegerv and gives back the requested integer.

Returns
true if glGetIntegerv succeeded.
See Also
www.opengl.org/sdk/docs/man4/xhtml/glGet.xml.
Note:
It is generally a bad idea to call glGetSomething since it might stall

the OpenGL pipeline.

float  getFloat(GLenum pname);

Returns
The requested float returned by glGetFloatv.
See Also
www.opengl.org/sdk/docs/man4/xhtml/glGet.xml.
Throws
OpenGLException if at least one OpenGL error was pending.

const pure nothrow int  maxColorAttachments();

Returns
Maximum number of color attachments. This is the number of targets a fragment shader can output to.

You can rely on this number being at least 4 if MRT is supported.

void  setActiveTexture(int texture);

Sets the "active texture" which is more precisely active texture unit.

Throws
OpenGLException on error.

package nothrow void  ensureNotInGC(string resourceName);

Crash if the GC is running.

Useful in destructors to avoid reliance GC resource release.