Re: [GD-General] Multiple Inheritance and RTTI
Brought to you by:
vexxed72
From: Peter D. <pd...@mm...> - 2003-02-05 21:25:01
|
Noel Llopis wrote: > On Wed, 05 Feb 2003 22:53:49 +0200 > Peter Dimov <pd...@mm...> wrote: > >> Out of curiosity, can someone post a real example of using the >> QueryInterface pattern (in performance-critical code)? > > Sure, we use it in MechAssault. > > Every frame we quickly cull out any scene nodes that are not visible > from a camera, and then for each scene node we query to see if they > implement the IRenderable interface. If they do, they get a render > call. Yes, I envisioned something like that. What are the advantages of this approach over just providing a (possibly empty) render() in every node type? A virtual call can never lose to a QI + test + potential call. |