I wrote this mainly for my own benefit, but I figured it might be useful to someone else. It's a small program which generates opengl bindings for D directly from the specification.

https://github.com/Diggsey/OpenGL-D-Bindings

It generates a single file "gl.d" which by default will do no more or less than what you'd get by including "gl/gl.h". This will give you access to GL 1.1 functions.

You can then call "loadGL" passing in the opengl version and the names of any extensions you want to use and it will automatically load in the relevant functions. It does this at compile time so at runtime it just loads precisely those functions which you asked for.

It provides only the platform independent part of opengl - it expects wgl***/glX*** functions to be provided by the platform sdk. Unfortunately the built in windows bindings for D are fairly useless, but I've forked druntime and phobos to use the windows bindings from the dsource bindings project instead, which are far better:

https://github.com/Diggsey/druntime
https://github.com/Diggsey/phobos/tree/win32-bindings

Reply via email to