From: Andrew M. <am...@mc...> - 2006-02-23 06:52:17
|
On Wed, Feb 22, 2006 at 11:31:57PM -0500, brlcad wrote: > Regardless, it's not preferable to have either/or. Given exactly what > you wrote, you'd probably test for both, i.e. "if (!headless && > display)" since you are dereferencing display and should check whether > it is null, and you don't want to make the display->something() call > without implementing a NullDisplay or HeadlessDisplay subclass of some > parent class. >=20 > In short, good direction though I would suggest focusing on refactoring= =20 > it early to eliminate the if-tests before you go too far down that=20 > road. Wrapping every single call to the portions in BZ that make=20 > OpenGL or other display-specific calls is going to lead to a lot of=20 > if-testing without polymorphism. >=20 I really like the inheritance idea, so I'm going to start focusing on that and doing one thing at a time. I'm sure I'll have plenty of questions as I go. --=20 Andrew McNabb http://www.mcnabbs.org/andrew/ PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868 |