Manager.CheckDeviceType 메서드
업데이트: 2007년 11월
하드웨어 가속 장치 유형을 현재 어댑터에서 사용할 수 있는지 여부를 지정합니다.
네임스페이스: 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 function CheckDeviceType(
adapter : int,
checkType : DeviceType,
displayFormat : Format,
backBufferFormat : Format,
windowed : boolean
) : boolean
매개 변수
adapter
형식: System.Int32쿼리할 디스플레이 어댑터를 나타내는 서수입니다. AdapterListCollection.Default는 항상 기본 디스플레이 어댑터입니다.
checkType
형식: Microsoft.WindowsMobile.DirectX.Direct3D.DeviceType장치 유형을 식별하는 DeviceType 열거형의 멤버입니다.
displayFormat
형식: Microsoft.WindowsMobile.DirectX.Direct3D.Format장치 유형이 확인되는 어댑터 디스플레이 모드의 형식을 나타내는 Format 열거형의 멤버입니다. 예를 들어, 일부 장치는 16비트/픽셀 모드에서만 작동합니다.
backBufferFormat
형식: Microsoft.WindowsMobile.DirectX.Direct3D.Format백 버퍼 형식입니다. 형식에 대한 자세한 내용은 형식을 참조하십시오. 이 값은 렌더링 대상 형식 중 하나여야 합니다. Device의 DisplayMode 속성을 사용하여 현재 형식을 가져올 수 있습니다. 창 있는 응용 프로그램의 경우 하드웨어에서 색 변환을 지원하면 백 버퍼 형식이 디스플레이 모드 형식과 일치할 필요가 없습니다. 가능한 백 버퍼 형식의 집합은 제한되지만 런타임에 유효한 백 버퍼 형식을 바탕 화면 형식으로 제공할 수 있습니다. 또한 장치는 대개 8비트/픽셀 모드에서는 작동하지 않으므로 바탕 화면 모드에서 작동해야 합니다.
전체 화면 응용 프로그램에서는 색 변환을 수행할 수 없습니다. 창 모드의 경우 Format의 Unknown을 지정할 수 있습니다.
windowed
형식: System.Boolean창 있는 다중 샘플링에 대해 조회하려면 true로 설정하고, 전체 화면 다중 샘플링에 대해 조회하려면 false로 설정합니다.
반환 값
형식: System.Boolean
메서드가 성공하고 이 어댑터에서 장치를 사용할 수 있으면 true이고, 그렇지 않으면 false입니다.
설명
HAL(Hardware Abstraction Layer) 장치 유형에는 하드웨어 가속이 필요합니다. CheckDeviceType 메서드를 사용하여 HAL 장치를 지원할 수 있는 응용 프로그램이 있습니다.
전체 화면 응용 프로그램에서는 알파 채널이 포함된 displayFormat을 지정하지 않아야 합니다. 지정하면 호출에 실패합니다. 알파 채널이 백 버퍼에 있을 수 있지만 두 표시 형식이 다른 모든 면에서 동일해야 합니다. 예를 들어, 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
}
권한
- 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.
플랫폼
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
.NET Framework 및 .NET Compact Framework에서 모든 플랫폼의 전체 버전을 지원하지는 않습니다. 지원되는 버전의 목록을 보려면 .NET Framework 시스템 요구 사항을 참조하십시오.
버전 정보
.NET Compact Framework
3.5, 2.0에서 지원