Original Post
I've been developing for a while and have written many objects.
Somehow I became very uncomfortable with the way I use them.
I create pointer of everyone of it in my main CDirect3D class,
instantiate them in OnCreate() method and use their Render()
methods in main CDirect3D::Render method.
Since I used only one of each object it wasn't hard,
but now I'm starting to use more objects, and editing becomes a pain...
Since I written them in a way, that they all have almost the same methods
I decided to derive them from one base class and put instantiated objects
to pointer-to-pointer-to-base class. This way all I'll need will be to run through cycle and use same method on everyone of them. Would this be the
right way? How do you manage many objects?
I also wanted to ask about Release() method of COM objects.
Is it hard to implement? Do I only need to delete every single variable in object which is pointed to by a pointer? Or should I also use something like delete this and stuff?
Somehow I became very uncomfortable with the way I use them.
I create pointer of everyone of it in my main CDirect3D class,
instantiate them in OnCreate() method and use their Render()
methods in main CDirect3D::Render method.
Since I used only one of each object it wasn't hard,
but now I'm starting to use more objects, and editing becomes a pain...
Since I written them in a way, that they all have almost the same methods
I decided to derive them from one base class and put instantiated objects
to pointer-to-pointer-to-base class. This way all I'll need will be to run through cycle and use same method on everyone of them. Would this be the
right way? How do you manage many objects?
I also wanted to ask about Release() method of COM objects.
Is it hard to implement? Do I only need to delete every single variable in object which is pointed to by a pointer? Or should I also use something like delete this and stuff?