Original Post
i have a multi api system set up that uses a pure base class that defines all the rendering functions that will be needed. there are some things performed in these functions that will be the same for every api implementation, so i was wondering if it would kill the performance too much to do this:
it also wouldn't really change how i wrote my code, but if someone downloaded it and decided to write a glide one or something like that, they wouldn't have to do that redundant stuff that the base class function does.
btw, i chose 'i' just for 'implementation' or something, it was random, it has no significance.
[edited by - billybob on January 27, 2003 4:49:55 AM]
class CBaseRenderer
{
virtual void iSomeRenderingFunction(...) = 0;
virtual void iSomeRedneringFunction2(...) = 0;
virtual void iSomeRenderingFunction3(...) = 0;
...
public:
CBaseRenderer();
virtual ~CBaseRenderer();
void SomeRenderingFunction(...)
{
//stuff thats performed no matter what the api
iSomeRenderingFunction(...);
}
void SomeRenderingFunction2(...)
{
//same stuff thats performed every api
iSomeRenderingFunction2(...);
}
...
};
how bad would that hurt performance? there is still only one virtual function call, but it would still be a huge pain to change it and see what happens, and it'd be a way bigger pain if it turned out bad