Archived

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

Ejaz

A new-bie question about IDirectPlay8Peer & Object Orientation

Recommended Posts

Hi All, I''m trying to create an object oriented model for my game. I''m new to game programming as well. I would like to ask a question. What is the way to inherit IDirectPlay8Peer into my class. I''m trying, but can''t get success till yet. Any help in this matter will be highly appriciated & thanx in advance. Regards, Ejaz.

Share this post


Link to post
Share on other sites
I wouldn''t try to ineirt any DirectX interfaces into your class, instead make an instance of the interface a member of your class. This will be far simpler I believe.

Share this post


Link to post
Share on other sites
Dear Illumini,

Thanx for the response. I have figure out that too, otherwise it is making things a little more complicated and the point to create classes stuff is to make things simpler.

Share this post


Link to post
Share on other sites
Well I''ve never tried inheriting a DX interface, but the problems I see with it on the surface include having all the DX interfaces accessable through your class because of inheritance. Unless you use protected/privated inheritance, but that just might get messy..

The only thin you really gain is calling SendTo() from within your class instead of m_DP->SendTo()

Not a big difference, plus there is the initlzation issues and such

Share this post


Link to post
Share on other sites