Writing class wrappers for direct3D

Started by
0 comments, last by johnnyBravo 19 years, 11 months ago
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,
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.

This topic is closed to new replies.

Advertisement