Skip to content

D For Games

The D Programming Language is a promising language being developed by Walter Bright of Digital Mars. Not yet at a 1.0 release, a steadily growing community has gathered around the language. There are a number of community projects in fields as diverse as cryptography and 3D graphics. While not yet ready for Prime Time, D is a pleasure to learn and use. And it’s great for games.

Japanese programmer Kenta Cho has several free games on his web site, some of which were programmed in D. The most well known of these is probably Gunroar. Other D programmers have begun D game or game-related projects as well, some of which can be found at DSource.org.

If you’d like to give D a whirl and use it for a game, you will need to make use of some external libraries. The Derelict project provides dynamic bindings to several game-related libraries, such as OpenGL, SDL, DevIL, and more. Alternatively, you can find static bindings to some of the same libraries here (though they may need tweaking to work with current versions of DMD). There are some differences between them. The latter bindings require you to link to the import library, meaning that on Windows you need to run the import library through the coffimplib tool (this works on DLL import libraries only - not on static libraries), but will work on Windows, Linux and Mac with DMD or GDC. Derelict has bindings to more libraries and does not require you to link to any import libraries as it loads the shared libraries dynamically through the operating system’s API (so that you can do things like hot swap). Derelict is currently only implemented on Windows and Linux, and has not been tested with GDC (that I know of).

Once you’ve chosen which bindings you want to use, you might consider checking out some of the game-related projects at DSource, such as Fragbots, Warbots, or the Velocity Engine. Those projects can be used as a starting point to help get you going in the right direction.

If you need help getting up to speed with D, be sure to check out my D blog for tips on how to get started.

Post a Comment

Your email is never published nor shared. Required fields are marked *