[Plib-users] ssgaShape subclass -- how to handle ssgaType*?
Brought to you by:
sjbaker
From: Daniel S. <djs...@uc...> - 2005-01-04 19:37:00
|
I have been subclassing ssgaShapes to customize the shapes I am drawing. I need to implement ssgaShape::getTypeName() -- should I do this with my own name or one of the existing ssg shape names? What are the implications of using my own name? In a similar vein, my shapes implement a "Type" function, like this #define _SSGA_TYPE_RECT 0x00200000 inline int ssgaTypeRect () { return _SSGA_TYPE_RECT | ssgaTypeShape ();} This simply follows the example of the shapes defined in ssg. I'm not comfortable doing this, as it may be incompatible with future additions to the ssg shape collection. At the same time, I don't see where this type is used after I initialize the 'type' member in my class's constructor. Can anyone educate me on this? Is there a cleaner way to do this, so that I won't have trouble if/when ssg adds new shape def's? Dan |