Microsoft SDK for Java

restore

This method of the DirectDrawSurface Class restores a surface that has been lost. This occurs when the surface memory associated with the DirectDrawSurface object has been freed.

Syntax

public int restore();

Return Value

Returns DD_OK is successful.

Remarks

Surfaces can be lost because the mode of the display card was changed or because an application received exclusive access to the display card and freed all the surface memory currently allocated on the card. When a DirectDrawSurface object loses its surface memory, many methods will return DDERR_SURFACELOST and perform no other function. The restore method will reallocate surface memory and reattach it to the DirectDrawSurface object.

A single call to this method will restore a DirectDrawSurface object's associated implicit surfaces (back buffers, and so on). An attempt to restore an implicitly created surface will result in an error. restore will not work across explicit attachments created by using the addAttachedSurface method—each of these surfaces must be restored individually.

See Also

isLost, addAttachedSurface

© 1999 Microsoft Corporation. All rights reserved. Terms of use.