
nonagon: DirectX 9 Engine for D
This is my current main project. This actually started, in an entirely different form altogether, in the fall of 2002. Since then, it has progressed through almost three rewrites and a translation from C++ to D, as well as going from nothing more than a basic test of DirectX functionality to almost a functional 3D engine. The most recent update to nonagon is Release 4, which includes the following features:
- Easy to set up a window and start using the 3D engine
- Clean, object-oriented syntax
- Very little for the user to keep track of or do to make the engine run correctly
- Hierarchical node-based scene graph - attach nodes of any type to other nodes, and the child node will be positioned and rotated relative to its parent
- Automatic resource reacquisition after a lost device
- Two separate 3D rendering pipelines: fixed-function for making simpler games, developing for older computers, and for beginners; programmable for developing for newer cards and taking advantage of customizable vertex and pixel shaders
- Fixed-function pipeline allows for fine control over texture blending modes, texture transformation, various object colors and object blending modes, camera-relative cubemapping, and transparent objects are sorted back-to-front for proper rendering
- Programmable pipeline has a system to automatically pass internal engine data into HLSL effects, such as various matrices and the camera's position; effects are "instanced," meaning that each instance refers to the same effect but with different parameters; effects can have "static" parameters which are shared across all instances of that effect; multi-pass effects are supported
- Load static meshes in the .X model file format with all materials
- Sprite-based 2D-in-3D system for making HUDs, GUIs, and 2D games
- Complete input system based on DirectInput, allowing for keyboard, mouse, and joystick input; helper functions to ease construction of control customization systems
Soon to come in Release 5 are:
- Rendering to textures (for things like dynamic cubemapping)
- Dynamically created and editable meshes
- Spheremapping in the fixed-function pipeline
- Animated meshes (using the .X model file format)
- Picking of objects (by screen coordinates or using a vector in world space)
This entire engine is written in D for use with D. It is not yet open source, but that may change after Release 5. nonagon is currently based on the June 2005 DirectX 9 SDK.
You can download the headers, libraries, and (rather extensive) documentation for nonagon here: nonagon base files (~680KB)
Chances are, you won't have the d3dx9_26.dll necessary to run nonagon or any nonagon samples. d3dx9_26.dll is a part of DirectX, but for some reason, Microsoft has decided not to include the file in its DirectX redistribution package. Instead, developers are forced to redistribute the file. So you can download the installer here: d3dx9_26.dll installer (~1.4MB)
You can download a small demo of the new Programmable Pipeline here: nonagon shader demo (~470KB). You must have a video card capable of Shader Model 2 (ATi Radeon 9500 and up; nVidia GeForce FX and up) in order to run the demo correctly.
If you've never heard of the D programming language, I really recommend you check it out. Think of the best features of Java, C#, and C++ and put them together into one language, and you come pretty close to D. You can find the D language spec, as well as download the compiler, here: Digital Mars
BlitzBasic Text Entry Userlib
W00t finally, real keyboard text entry, without any crappy user-made functions that don't work as well as the real thing!
There is only one caveat - you must end your program with an End command, or else you will get an "Unknown Runtime Exception" error.
It also now supports B3D and B+ 1.34 and higher. You just set the type with the BeginEntry command. It also now supports special keys (up, down, left, right, ins, del, home, end, pgup, pgdn). The old problems it had with forgetting to uninitialize and crashing on a program error are gone. Lastly I fixed a problem where it was possible to initialize more than once, causing a crash. You can download BBEntry here: