Framework.CreateDevice Method

Language:

Creates a Microsoft Direct3D device.

Definition

Visual Basic Public Sub CreateDevice( _
    ByVal adapterOridinal As UInt32, _
    ByVal windowed As Boolean, _
    ByVal suggestedWidth As Integer, _
    ByVal suggestedHeight As Integer, _
    ByVal callback As IDeviceCreation _
)
C# public void CreateDevice(
    uint adapterOridinal,
    bool windowed,
    int suggestedWidth,
    int suggestedHeight,
    IDeviceCreation callback
);
C++ public:
void CreateDevice(
    unsigned int adapterOridinal,
    bool windowed,
    int suggestedWidth,
    int suggestedHeight,
    IDeviceCreationcallback
);
JScript public function CreateDevice(
    adapterOridinal : uint,
    windowed : boolean,
    suggestedWidth : int,
    suggestedHeight : int,
    callback : IDeviceCreation
);

Parameters

adapterOridinal System.Int32
The index of the desired adapter.
windowed System.Boolean
Set to true to start the application windowed. Set to false to start the application full-screen.
suggestedWidth System.Int32
The requested initial width of the application's back buffer.
suggestedHeight System.Int32
The requested initial height of the application's back buffer.
callback Microsoft.Samples.DirectX.UtilityToolkit.IDeviceCreation
An interface that the framework will use to determine if a device is acceptable.

Remarks

If CreateWindow or SetWindow has not already been called, this method will call CreateWindow with default parameters. Instead of calling CreateDevice, you can call SetDevice or CreateDeviceFromSettings.

The actual height and width may be adjusted to fit device and operating system constraints. The default value is 640x480.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center