Partager via


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

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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
)
new : 
        adapter:int * 
        deviceType:DeviceType * 
        renderWindow:Control * 
        behaviorFlags:CreateFlags * 
        presentationParameters:PresentParameters -> Device

Parameters

  • adapter
    Type: System.Int32
    An ordinal number that identifies the 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.
  • renderWindow
    Type: System.Windows.Forms.Control
    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.

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 that 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

Platforms

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

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

Version Information

.NET Compact Framework

Supported in: 3.5, 2.0

See Also

Reference

Device Class

Device Members

Device Overload

Microsoft.WindowsMobile.DirectX.Direct3D Namespace