Click to Rate and Give Feedback
MSDN
MSDN Library
DirectX SDK
Namespaces
Classes
Manager
Methods
 Manager.CheckDeviceMultiSampleType ...

  Switch on low bandwidth view
Language: Visual BasicC#C++JScript(Show All)
Manager.CheckDeviceMultiSampleType Method ()

Determines whether a multisampling technique is available on the current device.

Overload List

public static bool CheckDeviceMultiSampleType(int, DeviceType, Format, bool, MultiSampleType);
public static bool CheckDeviceMultiSampleType(int, DeviceType, Format, bool, MultiSampleType, out int, out int);

Remarks

This method is intended for use with both render-target and depth stencil surfaces because they must be created multisampled to be used together.

The following C# code fragment demonstrates the use of CheckDeviceMultiSampleType to test for devices that support a specific multisampling method.

              [C#]
              
public void Test_Manager_CheckDeviceMultiSampleType() { int result; // Test some formats IsDeviceMultiSampleOK(DepthFormat.D16, Format.A8R8G8B8, MultiSampleType.TwoSamples, out result); 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, out int result) { AdapterInformation ai = Manager.Adapters.Default; int qualityLevels = 0; // Verify that the render target surface supports the given multisample type if (Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Hardware, backbufferFmt, false, multisampleType, out result, ref qualityLevels)) { // Verify that the depth stencil surface supports the given multisample type if (Manager.CheckDeviceMultiSampleType(ai.Adapter, DeviceType.Hardware, (Format)depthFmt, false, multisampleType, out result, ref qualityLevels)) { return true; // if both calls succeed } } return false; // if either call fails. NOTE: HRESULT passed back in result }

The preceding code returns true if the device supports the full-screen MultiSampleType.TwoSamples multisampling method with the surface format.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker