Archived

This topic is now archived and is closed to further replies.

Alex5

DX7 Question

Recommended Posts

I am using DX 7 to make a 2D game. I am using D3D for some special effects. I was wondering if I should make a special class as a ddraw and d3d "wrapper", that way I could have a simple function call for my special effects, such as alpha blending, and it would all be centralized in one class. The reason I ask this is because I was wondering if having a seperate class for ddraw and d3d would slow down normal blt''ing. I could access ddraw in one of two ways:
  
hRet = ddwrapper.dd->blt(...);
if (hRet != DD_OK)
{
...
}
  
or I could put this as a function in the class. Even if I made the function inline, do you think this would slow the program down too much? Please reply! Thanks!

Share this post


Link to post
Share on other sites
I''ve done it both ways. Not much difference in speed either way, since the blt itself takes the majority of the time (at least the setup for it does).
That being said, an extra function call always (unless it''s inlined) takes up a little extra time, just not very much unless you call it a billion times (:

I found it was kind of nice to have everything in one place, but at the same time having all those "DXWrapper->" strings can add up and hurt code readability somewhat.



-ns-

Share this post


Link to post
Share on other sites