Condividi tramite


Device.Reset Method

Resets the presentation parameters for the current device.

Namespace: Microsoft.WindowsMobile.DirectX.Direct3D
Assembly: Microsoft.WindowsMobile.DirectX (in microsoft.windowsmobile.directx.dll)

Syntax

'Declaration
Public Sub Reset ( _
    presentationParameters As PresentParameters _
)
'Usage
Dim instance As Device
Dim presentationParameters As PresentParameters

instance.Reset(presentationParameters)
public void Reset (
    PresentParameters presentationParameters
)
public:
void Reset (
    PresentParameters^ presentationParameters
)
public void Reset (
    PresentParameters presentationParameters
)
public function Reset (
    presentationParameters : PresentParameters
)
Not applicable.

Parameters

  • presentationParameters
    A PresentParameters structure that describes the new presentation parameters. This value cannot be null.

Exceptions

Exception type Condition

InvalidCallException

The method call is invalid. For example, a parameter might contain an invalid value.

DriverInternalErrorException

Internal driver error. Applications should generally shut down when receiving this error.

OutOfMemoryException

Direct3D could not allocate sufficient memory to complete the call.

Remarks

When switching to full-screen mode, Direct3D tries to find a desktop format that matches the back buffer format so that back and front buffer formats are identical. This eliminates the need for color conversion.

If a call to Reset fails, the device is placed in the "lost" state as indicated by a return value of false from a call to CheckCooperativeLevel, unless it is already in the "not reset" state as indicated by a DeviceNotReset returned from the hResult parameter of the CheckCooperativeLevel method.

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

Swap chains are either full-screen or windowed. If the new swap chain is full-screen, the adapter is placed in the display mode that matches the new size.

A call to Reset fails if made on a different thread than the one used to create the device being reset.

You can specify "unknown" for the windowed mode back buffer format when you call Device, Reset, and SwapChain. This means that the application does not have to query the current desktop format before calling Device for windowed mode. For full-screen mode, you must specify the back buffer format. Setting BackBufferCount to 0 creates one back buffer.

When trying to reset more than one display adapter in a group, pass in an array of PresentParameters objects, one for each display in the adapter group.

Platforms

Windows CE, Windows Mobile for Pocket PC, Windows Mobile for Smartphone

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

Device Class
Device Members
Microsoft.WindowsMobile.DirectX.Direct3D Namespace