Jump to content
  • Advertisement

Archived

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

johnnyBravo

Writing class wrappers for direct3D

This topic is 5294 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i''ve been writing a class wrapper for directx for a while now, and ive encompassed most of the easy stuff eg vertexbuffers,font,indexbuffers,sprite,texture,d3d But then i''m realising, somethings dont even need wrappers. eg sprite. And d3d is a bit hard to encompass, as the intialisation code can require alot of variables that arnt used for everything so basically im just thinking of making and keeping things that are a bit hard to keep in perspective, eg vertex/index buffers, font which require more than a few lines of code and some variables that i wouldnt change Basically what i''m asking do you think its just better to only wrap up the hard parts of directx instead of everything? thanks,

Share this post


Link to post
Share on other sites
Advertisement
I''m starting to write a wrapper just now. At the moment i have Vertex and Index buffers wrapped up, so you just call CRender::AllocateStaticVB(int nNumVerts) and it''ll allocate a region of a VB (so you can stick several objects in one VB). I intend to write very simple wrappers around ID3DXFont and ID3DXSprint just to encapsulate the loading / saving, and to allow me to change to OpenGL or whatever slightly easier if i feel the need.
Its a matter of personal preference really, the overhead of a wrapper shouldbe minimal anyway.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!