🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

How do you create a DirectX7 wrapper in C++

Started by
0 comments, last by GameDev.net 24 years, 8 months ago
Can it be done without writing a function for every DirectX function, or can you use some COM trick to make it easier?
Advertisement
Yep, wrap every function.

You can't "derive" anything from COM, regardless of language, because COM has no support for virtual functions. To get true C++ style objects, make a new class, wrap all the DirectX calls into similarly named functions, then derive / make virtual whatever you want.

Or, be lazy and just expose the interface directly in your base class.

Mason McCuskey
Spin Studios
www.spin-studios.com

Founder, Cuttlefish Industries
The Cuttlefish Engine lets anyone develop great games for iPad, iPhone, Android, WP7, the web, and more!

This topic is closed to new replies.

Advertisement