Original Post
Hi.
I have a class that handles the creation of surfaces and puts them in a linked list with a structure as below. I know I do not need the surface description in the struct but convince me why not.
struct SurfList
{
LPDIRECTDRAWSURFACE7 lpddSurface;
DDSURFACEDESC2 ddSurfDesc2;
SurfList *lpNext;
SurfList *lpPrev;
};
As for the question:
When the class(g_cSurface) creates a new surface it returns LPDIRECTDRAWSURFACE7. I want to destroy this surface.
Since the surface is declared first in the struct, does the address of the surface correspond to the start of the structure (dumb question), I mean if I declare a new pointer of type SurfList in the delete function: could I use the same address as what the surface has? ie SurfList *lpCurrent=lpddSurfaceToDelete;
What should I do, please?
Edited by - clabinsky on December 18, 2001 10:13:11 PM
Edited by - clabinsky on December 18, 2001 10:14:09 PM
Edited by - clabinsky on December 18, 2001 10:39:51 PM