In article <200303102028.32650.osuchj@avalon.net>, Jonathan Osuch <osuchj@avalon.net> writes:
I would like to get away from all the 'ifdef XFRACT' statements (or anyth= ing=20 similar) scattered throughout the code.
I think the way to minimize the extent of #defines throughout the code base is to localize them to a 'platform' layer. (Note that the 'driver' layer I've done is only concerned with keyboard/mouse input and video display.) The 'platform' layer handles all the weird platform stuff that has so far been lumped into #ifdef XFRACT; things like interacting with the file system, interacting with floating-point errors, interacting with variations in include files and system call function prototypes. If you localize all this stuff in a platform layer, then the rest of the code just calls the platform layer for these things instead of having to deal with the variations. That localizies the variations to one place at least. This has been successful in minimizing the #ifdefs on previous projects on which I've worked. -- "The Direct3D Graphics Pipeline"-- code samples, sample chapter, FAQ: <http://www.xmission.com/~legalize/book/> izfree: Open source tools for Windows Installer <http://izfree.sourceforge.net>