Manager.CheckDeviceType メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Manager.CheckDeviceType メソッドの意味・解説 

Manager.CheckDeviceType メソッド

現在のアダプタで、ハードウェア アクセラレータ デバイスが使用できるかどうかを指定します。

名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (microsoft.windowsmobile.directx.dll 内)
構文構文

Public Shared Function CheckDeviceType
 ( _
    adapter As Integer, _
    checkType As DeviceType, _
    displayFormat As Format, _
    backBufferFormat As Format, _
    windowed As Boolean _
) As Boolean
Dim adapter As Integer
Dim checkType As DeviceType
Dim displayFormat As Format
Dim backBufferFormat As Format
Dim windowed As Boolean
Dim returnValue As Boolean

returnValue = Manager.CheckDeviceType(adapter, checkType, displayFormat, backBufferFormat,
 windowed)
public static bool CheckDeviceType
 (
    int adapter,
    DeviceType checkType,
    Format displayFormat,
    Format backBufferFormat,
    bool windowed
)
public:
static bool CheckDeviceType (
    int adapter, 
    DeviceType checkType, 
    Format displayFormat, 
    Format backBufferFormat, 
    bool windowed
)
public static boolean CheckDeviceType (
    int adapter, 
    DeviceType checkType, 
    Format displayFormat, 
    Format backBufferFormat, 
    boolean windowed
)
public static function CheckDeviceType
 (
    adapter : int, 
    checkType : DeviceType, 
    displayFormat : Format, 
    backBufferFormat : Format, 
    windowed : boolean
) : boolean

パラメータ

adapter

照会するディスプレイ アダプタを示す序数。AdapterListCollection.Default は、常にプライマリ ディスプレイ アダプタです。

checkType

デバイスの種類を識別する DeviceType 列挙体のメンバ。

displayFormat

デバイスの種類が確認されるアダプタの、表示モードの形式を示す Format 列挙体のメンバ。たとえば、一部のデバイスは、16 ビット/ピクセルのモードでのみ動作します。

backBufferFormat

バック バッファ形式。形式の詳細については、Format に関する説明を参照してください。この値は、レンダリング先形式のいずれかであることが必要です。Device の DisplayMode プロパティを使用すると、現在の形式を取得できます。ウィンドウ表示のアプリケーションについては、そのハードウェアでカラー変換がサポートされていれば、バック バッファ形式が表示モード形式と一致していなくてもかまいません。バック バッファ形式に使用できるセットには制約がありますが、ランタイムで、任意の有効なバック バッファ形式をデスクトップ形式に表示できます。また、デバイスは、通常 8 ビット/ピクセルのモードでは動作しないため、デスクトップ モードで動作することが必要です。

全画面表示アプリケーションでは、カラー変換を実行できません。ウィンドウ モードに Format の Unknown を指定できます。

windowed

ウィンドウ表示のマルチサンプリングを照会する場合は true に設定します。全画面表示のマルチサンプリングを照会する場合は false に設定します。

戻り値
メソッドが正常に実行されて、デバイスがこのアダプタで使用できる場合は true。それ以外の場合は false。

解説解説

HAL (Hardware Abstraction Layer) 対応の種類のデバイスではハードウェア アクセラレータが必要です。CheckDeviceType メソッドを使用して HAL デバイスをサポートできるアプリケーションがあります。

全画面表示アプリケーションでは、アルファ チャネルを含む displayFormat を指定しないでください。指定すると呼び出しが失敗します。アルファ チャネルはバック バッファには指定できますが、この 2 つの表示形式は他のすべての点では一致している必要があります。たとえば、displayFormat = X1R5G5B5 の場合、backBufferFormat の有効値には X1R5G5B5 や A1R5G5B5 などがありますが、R5G6B5 は有効ではありません。

使用例使用例

特定の種類のデバイスがアダプタで使用できるかどうかを確認するコード例を次に示します。

Public Sub CheckDeviceType()

    ' Test some formats
    IsDeviceTypeOK(Format.X8R8G8B8, Format.A8R8G8B8)

    If result <> Fix(ResultCode.Success) Then
        System.Windows.Forms.MessageBox.Show(String.Format("The
 device check failed:  {0}", result))
    End If

End Sub

Public Function IsDeviceTypeOK(ByVal
 displayFmt As Format, ByVal backbufferFmt
 As Format) As Boolean
    Dim ai As AdapterInformation = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default

    ' Verify that the device can be used on the default adapter with
 the given surface format
    If Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceType(ai.Adapter,
 DeviceType.Default, displayFmt, backbufferFmt, False) Then
        Return True ' if the call
 succeeds
    End If

    Return False
    ' otherwise fail.  NOTE: HRESULT passed back in result
End Function
public void CheckDeviceType()
{

    // Test some formats
    IsDeviceTypeOK(Format.X8R8G8B8, Format.A8R8G8B8);

    if (result != (int)ResultCode.Success)
        System.Windows.Forms.MessageBox.Show(String.Format("The device check
 failed:  {0}", result));
}

public bool IsDeviceTypeOK(Format displayFmt,
 Format backbufferFmt)
{
    AdapterInformation ai = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default;

    // Verify that the device can be used on the default adapter with
 the given surface format
    if (Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceType(ai.Adapter,
 DeviceType.Default, displayFmt, backbufferFmt, false))
    {
        return true;    // if
 the call succeeds
    }

    return false;   // otherwise
 fail.  NOTE: HRESULT passed back in result
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
Manager クラス
Manager メンバ
Microsoft.WindowsMobile.DirectX.Direct3D 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

Manager.CheckDeviceType メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Manager.CheckDeviceType メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS