This method determines if a multisampling technique is available on this device.

HRESULT CheckDeviceMultiSampleType(
  UINT Adapter,
  D3DDEVTYPE DeviceType,
  D3DFORMAT SurfaceFormat,
  BOOL Windowed,


  • Adapter
    [in] Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns FALSE when this value equals or exceeds the number of display adapters in the system. See Remarks.
  • DeviceType
    [in] Member of the D3DDEVTYPE enumerated type, identifying the device type.
  • SurfaceFormat
    [in] Member of the D3DFORMAT enumerated type that specifies the set of multisampling types requested for the surface. See Remarks.
  • Windowed
    [in] Boolean value. Specify TRUE to inquire about windowed multisampling, and specify FALSE to inquire about full-screen multisampling.
  • MultiSampleType
    [in] Member of the D3DMULTISAMPLE_TYPE ** enumerated type, identifying the multisampling technique to test.

Return Values

If the device can perform the specified multisampling method, this method returns D3D_OK.

D3DERR_INVALIDCALL is returned if the Adapter or MultiSampleType parameters are invalid. This method returns D3DERR_NOTAVAILABLE if the queried multisampling technique is not supported by this device. D3DERR_INVALIDDEVICE is returned if DeviceType does not apply to this adapter.


This method is intended for use with both render-target and depth-stencil surfaces because you must create both surfaces multisampled if you want to use them together.

The following code fragment shows how you could use CheckDeviceMultiSampleType to test for devices that support a specific multisampling method.

if( SUCCEEDED(pDevice->CheckDeviceMultiSampleType( pCaps->AdapterOrdinal,
                                pCaps->DeviceType, pMode->Format, 
                                FALSE, D3DMULTISAMPLE_3_SAMPLES ) ) )
    return S_OK;

The preceding code will return S_OK if the device supports the full-screen D3DMULTISAMPLE_3_SAMPLES multisampling method with the surface format.


OS Versions: Windows CE .NET 4.0 and later.
Header: D3d8.h.
Link Library: D3d8.lib.

See Also


 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.