Original Post
I've read somewhere on this site that: What new's something should also delete it.. is this true? could any of you direct me to a tutorial dealing with object design?
Lets say I got this Mouse class which have an update function.. for it to update its cursor it will need to blit it to the screen.. I just wrote this mouse class and found out I did this:
I have a CSurface class wrapping directdraw surfaces.. my mouse class uses this to blit the mousepointer.. in the mouse class I had a pointer CSurface *MousePointer.. I set it using the constructer and in the destructor I delete it (but it is new'ed in the main program).. and in my main program I only created it and handed to pointer to the class.. this is bad design right? I should either pass the pointer and delete the mousepouinter surface from the main program or let the mouse class create the mousepointer surface and delete it.. Am I right? or I have just misunderstood the concept? :-).. I am rewriting my 2d engine.. I want it done right this time.. but haven't found any resources on the net teaching good object/code design..any of you know some?
im sorry for the rather confusing title.. makes this post sound a lot more exciting than it is :-)
* just edited this post.. Was obviosly pretty tired last night
[edited by - smokes on May 30, 2002 6:19:31 AM]