RE: [GD-General] Overhead of RTTI
Brought to you by:
vexxed72
From: <ce...@ce...> - 2002-12-24 13:26:21
|
Hey, It might be a bad design, but now that I've hit this problem, I'd also like to know why it happens and how much RTTI would *really* hurt. The class hierarchy in discussion has a base Obect class that has a name field and is virtually inherited by all the other classes in the hierarchy. Now I have a Texture class and a RenderTarget class (buth abstract), and in the implementation I have a (say) D3DTexture class that inherits both Texture and RenderTarget. The problem is that the RenderSystem class (the one that does the actual rendering) is pretty abstracted itself so it works with Textures and renderTargets. At some point I have to cast from Object to D3DTexture and there's where all hell brakes loose. I can't even cast from void * to D3DTexture for that matter (well, the void * was initially a RenderTarget cast of D3DTexture, so yes, it is a whole madness). My bet is on dynamic_cast or modifying the design (I'll probably choose the latter eventually). Seems like hard abstraction would be way easier (and safer) with RTTI enabled. Thanks again, Adrian -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Tom Forsyth Sent: Tuesday, December 24, 2002 3:02 PM To: gam...@li... Subject: RE: [GD-General] Overhead of RTTI It's usually far quicker and easier to code it yourself with a few helper functions, unless you actually need the full madness of RTTI. Tom Forsyth - Muckyfoot bloke and Microsoft MVP. This email is the product of your deranged imagination, and does not in any way imply existence of the author. > -----Original Message----- > From: Adrian Cearnau [mailto:ce...@ce...] > Sent: 24 December 2002 12:50 > To: gam...@li... > Subject: [GD-General] Overhead of RTTI > > > Hey everyone and merry X-Mas, > > I'd like to know what the realistic overhead of enabling RTTI in a C++ > project is. Any opinions are welcome. > > Thank you, > Adrian 'cearny' Cearnau ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Gamedevlists-general mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-general Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=557 |