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 function Device(
adapter : int,
deviceType : DeviceType,
renderWindow : Control,
behaviorFlags : CreateFlags,
presentationParameters : PresentParameters
)
Parameters
adapter
Type: System.Int32An 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.
deviceType
Type: Microsoft.WindowsMobile.DirectX.Direct3D.DeviceTypeA member of the DeviceType enumerated type that denotes the desired device type. If the desired device type is not available, the method fails.
renderWindow
Type: System.Windows.Forms.ControlA 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
Type: Microsoft.WindowsMobile.DirectX.Direct3D.CreateFlagsA combination of one or more options that control device creation.
presentationParameters
Type: Microsoft.WindowsMobile.DirectX.Direct3D.PresentParametersA 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 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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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