2 Sep 2002 13:30
RE: [Algorithms] abstracting platforms
Nick Pelling <NPelling <at> climax.co.uk>
2002-09-02 11:30:05 GMT
2002-09-02 11:30:05 GMT
Hi Shawn, Surely virtual functions - at the high level of abstraction you describe - are likely to make up less than 0.1% of overhead? :-9 Personally, I'd prefer my high level game loop code not to be inlined... :-9 Cheers, .....Nick Pelling..... -----Original Message----- From: Shawn Hargreaves [mailto:shargreaves <at> climax.co.uk] Sent: 02 September 2002 11:45 To: 'Yordan Gyurchev'; Algorithms Subject: RE: [Algorithms] abstracting platforms Yordan Gyurchev writes: > I've been trying to make some fundamental stuff (as game > loop, input system, file system, timer support, rendering...) > conform abstract interfaces so I can quickly switch between > platforms using abstract factories to crate the platform > dependent concrete objects. I think abstract base classes are the wrong way to go for this. They are a great way to make code that can choose between different implementations of a subsystem at runtime, but when moving between platforms, you already know at compile time exactly which implementation you are going to be using. So why bother with the hassle of maintaining multiple layers of classes, and the cost of doing everything through virtual functions? (sure, they aren't all that expensive, but they do cost a bit(Continue reading)
RSS Feed