Manager.CheckDeviceMultiSampleType, méthode
Mise à jour : novembre 2007
Détermine si une technique d'échantillonnage multiple est disponible sur le périphérique actuel.
Espace de noms : Microsoft.WindowsMobile.DirectX.Direct3D
Assembly : Microsoft.WindowsMobile.DirectX (dans Microsoft.WindowsMobile.DirectX.dll)
Syntaxe
'Déclaration
Public Shared Function CheckDeviceMultiSampleType ( _
adapter As Integer, _
deviceType As DeviceType, _
surfaceFormat As Format, _
windowed As Boolean, _
multiSampleType As MultiSampleType _
) As Boolean
'Utilisation
Dim adapter As Integer
Dim deviceType As DeviceType
Dim surfaceFormat As Format
Dim windowed As Boolean
Dim multiSampleType As MultiSampleType
Dim returnValue As Boolean
returnValue = Manager.CheckDeviceMultiSampleType(adapter, _
deviceType, surfaceFormat, windowed, _
multiSampleType)
public static bool CheckDeviceMultiSampleType(
int adapter,
DeviceType deviceType,
Format surfaceFormat,
bool windowed,
MultiSampleType multiSampleType
)
public:
static bool CheckDeviceMultiSampleType(
int adapter,
DeviceType deviceType,
Format surfaceFormat,
bool windowed,
MultiSampleType multiSampleType
)
public static function CheckDeviceMultiSampleType(
adapter : int,
deviceType : DeviceType,
surfaceFormat : Format,
windowed : boolean,
multiSampleType : MultiSampleType
) : boolean
Paramètres
adapter
Type : System.Int32Nombre ordinal qui dénote la carte vidéo à interroger. AdapterListCollection.Default est toujours la carte vidéo principale.
deviceType
Type : Microsoft.WindowsMobile.DirectX.Direct3D.DeviceTypeMembre de l'énumération DeviceType qui identifie le type de périphérique.
surfaceFormat
Type : Microsoft.WindowsMobile.DirectX.Direct3D.FormatMembre de l'énumération Format qui identifie la surface destinée à un échantillonnage multiple.
windowed
Type : System.BooleanAffectez la valeur true pour obtenir des informations sur l'échantillonnage multiple avec fenêtres. Affectez la valeur false pour obtenir des informations sur l'échantillonnage multiple plein écran.
multiSampleType
Type : Microsoft.WindowsMobile.DirectX.Direct3D.MultiSampleTypeMembre de l'énumération MultiSampleType qui identifie la technique d'échantillonnage multiple.
Valeur de retour
Type : System.Boolean
true si la méthode a réussi ; sinon false.
Notes
Cette méthode est destinée à une utilisation avec les surfaces du stencil de profondeur et les surfaces cibles de rendu, car elles doivent être créées en tant qu'échantillons multiples pour être utilisées conjointement.
Exemples
L'exemple de code suivant montre comment vérifier la prise en charge d'une méthode d'échantillonnage multiple spécifique.
Public Sub CheckDeviceMultiSampleType()
' Test some formats
IsDeviceMultiSampleOK(DepthFormat.D16, Format.A8R8G8B8, MultiSampleType.TwoSamples)
If result <> Fix(ResultCode.Success) Then
System.Windows.Forms.MessageBox.Show(String.Format("The multisample options are invalid: {0}", result))
End If
End Sub 'CheckDeviceMultiSampleType
Public Function IsDeviceMultiSampleOK(ByVal depthFmt As DepthFormat, ByVal backbufferFmt As Format, ByVal multisampleType As MultiSampleType) As Boolean
Dim ai As AdapterInformation = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default
Dim qualityLevels As Integer = 0
' Verify that the render target surface supports the given multisample type
If Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Default, backbufferFmt, False, multisampleType) Then
' Verify that the depth stencil surface supports the given multisample type
If Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Default, CType(depthFmt, Format), False, multisampleType) Then
Return True ' if both calls succeed
End If
End If
Return False
' if either call fails. NOTE: HRESULT passed back in result
End Function
public void CheckDeviceMultiSampleType()
{
// Test some formats
IsDeviceMultiSampleOK(DepthFormat.D16, Format.A8R8G8B8, MultiSampleType.TwoSamples);
if (result != (int)ResultCode.Success)
System.Windows.Forms.MessageBox.Show(String.Format("The multisample options are invalid: {0}", result));
}
public bool IsDeviceMultiSampleOK(DepthFormat depthFmt, Format backbufferFmt, MultiSampleType multisampleType)
{
AdapterInformation ai = Microsoft.WindowsMobile.DirectX.Direct3D.Manager.Adapters.Default;
int qualityLevels = 0;
// Verify that the render target surface supports the given multisample type
if (Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Default, backbufferFmt, false, multisampleType))
{
// Verify that the depth stencil surface supports the given multisample type
if (Microsoft.WindowsMobile.DirectX.Direct3D.Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Default, (Format)depthFmt, false, multisampleType))
{
return true; // if both calls succeed
}
}
return false; // if either call fails. NOTE: HRESULT passed back in result
}
Autorisations
- Confiance totale accordée à l'appelant immédiat. Ce membre ne peut pas être utilisé par du code d'un niveau de confiance partiel. Pour plus d'informations, consultez Utilisation de bibliothèques à partir de code d'un niveau de confiance partiel.
Plateformes
Windows CE, Windows Mobile pour Smartphone, Windows Mobile pour Pocket PC
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Compact Framework
Pris en charge dans : 3.5, 2.0