After a couple of false starts (and more than a week of not updating this journal), I think I have a decent skeleton for my graphics code. I've done everything using virtual classes (essentially interfaces), mostly so that I don't have to put the member variables for the classes into the header files (that way, classes that I overhaul internally don't require me to rebuild anything except for that object's file itself).
A breakdown of (some of) the specifics of the graphics "engine" for those who care (if such a person truly exists):
- Everything in the actual world is going to be an Object.
- An Object is an instance of a Model with positional information (i.e. a world matrix)
- A Model is a Mesh combined with Materials
- A Mesh contains static vertex/index buffers and attribute tables to split it into different material "slots" (that the Model can fill in with materials)
- Consequently, all of the world data will be static (in buffer only - things can animate, but it will be done completely in-shader)
- A Mesh can also hold different index sets for different LODs (but a Mesh at a lower LOD does not use any different vertices than a higher-LOD mesh - the LODs all use the same vertices)
- The game can add and remove objects to/from the renderer. Then the game can update the position of the objects, and changes will be reflected on-screen, with no more external effort
- The renderer will handle visibility determination for all objects (with different methods being used for "mostly static" and "fully dynamic" objects)
- The effects will be handled using (After much effort to do it a different way) DirectX .fx files. System parameters will be used via semantics. Any parameters without semantics should be set by the material
- Post-process filters will be simple effects, with a different set of usable semantics which refer to the texture to use. The render target will be set via an annotation on the pass
- The UI code will be a very simple windowing system (i.e. pretty much buttons/text/sliders/maybe a text edit box or two). I haven't looked into DirectX's new UI utilities, but I might use them, if they're easy
Hopefully in the next few days I'll have the skeleton filled in with actual code. Code that produces screenshots. Screenshots that don't suck. Until then, I'll try to update this more often (and preferably make it more interesting).