Getting going with D/OpenGL

Anders F Björklund afb at
Mon Oct 23 00:34:08 PDT 2006

Bill Baxter wrote:

> What's the easiest way to get going with OpenGL under D?

Use either e.g. Derelict's loaders, or the OpenGL import modules:

One approach uses function pointers and loads symbols at runtime,
while the other links directly to the libraries (as in C or C++).

I will be bundling my modules for SDL and GL with my GDC builds,
and wxD now has preliminary samples for using SDL and GL, as well.

import sdl.sdl;

> It seems like Derelict has OpenGL support using SDL, but I don't really 
> like SDL's single-window limitation or draconian approach to window 
> resizing (i.e. trash all your textures).

You don't have to use SDL to use GL, but you can if you like.
(i.e. SDL can use GL, but you can go directly to GL instead...)

> Are there other options?  What's the best supported / actively developed?

Both of the two approaches mentioned above are still supported.

> I was considering working on a GLUI-alike library.  GLUI is a simple, 
> easy to use GUI library based on OpenGL.  It's pretty popular in the 
> graphics research community just because it's so brain-dead easy to use, 
> is very lightweight, and has very few dependencies.  Perfect for 
> slapping a few buttons and sliders up on the screen to control your 
> OpenGL program.  I think it could be very nice for D, since D is also 
> all about ease-of-use.

Yes, GLUI would work fine for D. And GLUT can also be used,
if you only need a simple GL window and not a full "GUI" ?

There is also the GLFW project:


More information about the Digitalmars-d-learn mailing list