Original Post
When dealing with Direct Draw surfaces (in C++), Let's say there's a class, and inside the class is the variable LPDIRECTDRAWSURFACE7 ClassSurface. Now, in the class's constructor function one of the variables passed into it is (LPDIRECTDRAWSURFACE7 SomeSurface). Your goal is to have "ClassSurface" point to whatever surface is supplied by the user (via "SomeSurface")in the creation of the class. For instance, you might supply the primary surface to the function. So, inside the constructer function you have a line like:
ClassSurface = SomeSurface;
Now, my question is A) is this proper? B) should the "ClassSurface" be in some way released or destroyed in the destructor (in a similar way that you would with the primary surface before your program exits)? "ClassSurface" seems to be a pointer-to-a-pointer, or a second pointer to the same surface, or something in this case and my fear is that if "ClassSurface" is made to point to the primary surface (which already has a pointer somewhere else), and is released, it will cause problems when you try to use the primary surface elsewhere with the original primary surface pointer. Whew, ok, did I make my question clear? If not let me know. I hope I made sense - thanks in advance.
Edited by - WhiteRaptor on December 10, 2001 2:27:02 AM