DirectX SDK |
The DirectDraw7.DuplicateSurface method duplicates a DirectDrawSurface7 object.
object.DuplicateSurface( _ ddIn As DirectDrawSurface7) As DirectDrawSurface7
If the method succeeds, it returns a newly duplicated DirectDrawSurface7 object.
If the method fails, it raises an error, and Err.Number can be set to one of the following values:
DDERR_CANTDUPLICATE |
DDERR_INVALIDOBJECT |
DDERR_INVALIDPARAMS |
DDERR_OUTOFMEMORY |
DDERR_SURFACELOST |
This method creates a new DirectDrawSurface7 object that points to the same surface memory as an existing DirectDrawSurface object. This duplicate can be used just like the original object. The surface memory is released after the last object that refers to it is released. A primary surface, 3-D surface or implicitly created surface cannot be duplicated.