Freigeben über


Device Constructor (Int32, DeviceType, Control, CreateFlags, PresentParameters)

Initializes a new instance of the Device structure.

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

Syntax

'Declaration
Public Sub New ( _
    adapter As Integer, _
    deviceType As DeviceType, _
    renderWindow As Control, _
    behaviorFlags As CreateFlags, _
    presentationParameters As PresentParameters _
)
'Usage
Dim adapter As Integer
Dim deviceType As DeviceType
Dim renderWindow As Control
Dim behaviorFlags As CreateFlags
Dim presentationParameters As PresentParameters

Dim instance As New Device(adapter, deviceType, renderWindow, behaviorFlags, presentationParameters)
public Device (
    int adapter,
    DeviceType deviceType,
    Control renderWindow,
    CreateFlags behaviorFlags,
    PresentParameters presentationParameters
)
public:
Device (
    int adapter, 
    DeviceType deviceType, 
    Control^ renderWindow, 
    CreateFlags behaviorFlags, 
    PresentParameters^ presentationParameters
)
public Device (
    int adapter, 
    DeviceType deviceType, 
    Control renderWindow, 
    CreateFlags behaviorFlags, 
    PresentParameters presentationParameters
)
public function Device (
    adapter : int, 
    deviceType : DeviceType, 
    renderWindow : Control, 
    behaviorFlags : CreateFlags, 
    presentationParameters : PresentParameters
)

Parameters

  • adapter
    An ordinal number that identifies which physical device the object represents. Device 0 is the default device. The highest value that can be used in this parameter is one less than the total number of physical devices.
  • deviceType
    A member of the DeviceType enumerated type that denotes the desired device type. If the desired device type is not available, the method fails.
  • renderWindow
    A handle to a Form or any other Control derived class. This parameter indicates the surface to bind to the device.

    The specified window must be a top-level window. Null values are not supported.

  • behaviorFlags
    A combination of one or more options that control device creation.
  • presentationParameters
    A PresentParameters object that describes the presentation parameters for the device to create.

Remarks

This constructor creates a fully functional device object that is set to the required display mode (or windowed mode) and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer.

Back buffers created as part of the device are lockable only if LockableBackBuffer is specified in PresentParameters. Multisampled back buffers and depth surfaces are never lockable.

The Reset and TestCooperativeLevel methods must be called from the same thread that used this method to create a device.

The Unknown type can be specified for the windowed mode back-buffer format when calling Device, Reset, and SwapChain (the constructor override for creating a new swap chain). This means the application does not have to query the current desktop format before calling Device for windowed mode. For full-screen mode, the back-buffer format must be specified.

You cannot create a device on a child window or on a 0x0-sized window.

.NET Framework Security

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

Platforms

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Version Information

.NET Compact Framework

Supported in: 2.0

See Also

Reference

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