DerelictGLU



Introduction

DerelictGLU is a D binding to the OpenGL Utility Library (GLU).

Using

  1. Always make sure the DerelictGLU source modules are available on your import path.
  2. In modules that make use of DerelictGLU, you will need to import the derelict.opengl.glu module.
  3. Before calling any OpenGLU functions, you need to make a call to DerelictGLU.load(). This will load the shared library.

The following is a complete program that loads DerelictGLU:

import derelict.opengl.glu;

void main()
{
	DerelictGLU.load();
	
	// now you can call OpenGLU functions
}

From this point on, you may call GLU functions as normal.

Some GLU functions are not imported by DerelictGLU as they are not available on all GLU implementations. These are:

gluBuild2DMipmapLevels
gluBuild3DMipmapLevels
gluBuild3DMipmaps
gluCheckExtension
gluNurbsCallbackData
gluNurbsCallbackDataEXT
gluUnProject4

DerelictGLU may attempt to import these in the future, but for now it is easier to leave them out. Attempting to import them will either force the client to make use of selective loading to check in case any of the functions are missing, or would require internal use of selective loading which would open up the chance of bugs on some systems if the client attempts to call one of the missing functions. For now, if you wish to use any of these functions, you should look in glu.d and uncomment both the type declarations of the functions you wish to use (near the end of the file) and the lines in the private load() function where they are loaded.

As with other Derelict packages, DerelictGLU will throw an exception if an error occurs while loading the shared library. For more information on Derelict exceptions, see the documentation for Loading/Unloading Shared Libraries.

Finally, the method DerelictGLU.unload() is provided for convenience. In normal practice you do not need to call this function, as Derelict will unload the library automatically when the app exits. You generally should only use this function if you need to unload DerelictAL while the application is running.

Dependencies

DerelictUtil
DerelictGL