Microsoft DirectX 8.1 (Visual Basic)

Direct3DDevice8.Reset

Changes the type, size, and format of the swap chain.

object.Reset( _ 
    PresentationParameters As D3DPRESENT_PARAMETERS)

Parts

object
Object expression that resolves to a Direct3DDevice8 object.
PresentationParameters
A D3DPRESENT_PARAMETERS type, describing the new presentation parameters.

Error Codes

If the method fails, an error is raised and Err.Number can be set to one of the following values.

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY
E_OUTOFMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

If a call to Reset fails, the device will be placed in the "lost" state (as indicated by a return value of D3DERR_DEVICELOST from a call to TestCooperativeLevel) unless it is already in the "not reset" state (as indicated by a return value of D3DERR_DEVICENOTRESET from a call to TestCooperativeLevel). Refer to Direct3DDevice8.TestCooperativeLevel and Lost Devices for further information concerning the use of Reset in the context of lost devices.

Calling Reset causes all texture memory surfaces to be lost, managed textures to be flushed from video memory, and all state information to be lost. Before calling the Reset method for a device, an application should release any explicit render targets, depth stencil surfaces, additional swap chains and D3DPOOL_DEFAULT resources associated with the device.

The different types of swap chains are full-screen or windowed. If the new swap chain is full-screen, the adapter will be placed in the display mode that matches the new size.

When Reset fails, the only valid methods you can call are Reset and Direct3DDevice8.TestCooperativeLevel. Calling any other method may result in an exception.

Pixel shaders and vertex shaders survive Reset calls for Microsoft® DirectX® 8.1. They do not need to be recreated explicitly by the application.

See Also

CONST_D3DSWAPEFFECT, D3DPRESENT_PARAMETERS, Direct3DDevice8.Present