Microsoft DirectX 8.1 (Visual Basic)

Direct3D8.CheckDeviceMultiSampleType

Determines if a multisampling technique is available on this device.

object.CheckDeviceMultiSampleType( _ 
    Adapter As Long, _ 
    DeviceType As CONST_D3DDEVTYPE, _ 
    Format As CONST_D3DFORMAT, _ 
    Windowed As Long, _ 
    MultiSampleType As CONST_D3DMULTISAMPLE_TYPE) As Long

Parts

object
Object expression that resolves to a Direct3D8 object.
Adapter
Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns 0 (False) when this value equals or exceeds the number of display adapters in the system.
DeviceType
Member of the CONST_D3DDEVTYPE enumeration, identifying the device type.
Format
Member of the CONST_D3DFORMAT enumeration that specifies the format of the surface to be multisampled. For more information, see "Remarks."
Windowed
Specify 1 to inquire about windowed multisampling, and specify 0 to inquire about full-screen multisampling.
MultiSampleType
Member of the CONST_D3DMULTISAMPLE_TYPE enumeration, identifying the multisampling technique to test.

Return Values

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

If the method fails, one of the following values can be returned.

D3DERR_INVALIDCALL
D3DERR_INVALIDDEVICE
D3DERR_NOTAVAILABLE

Remarks

This method is intended for use with both render target and depth-stencil surfaces because you need to create both of them 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.

Dim Device As Direct3DDevice8
Dim Caps As D3DCAPS8
Dim Caps2 As CONST_D3DDEVTYPE
Dim FrontBuffer As CONST_D3DFORMAT
Dim BackBuffer As CONST_D3DFORMAT

If Device.CheckDeviceMultiSampleType(Caps.AdapterOrdinal, Caps2.DeviceType, _ 
                                     BackBuffer.Format, 0, D3DMULTISAMPLE_3_SAMPLES) And _
   Device.CheckDeviceMultiSampleType(Caps.AdapterOrdinal, Caps2.DeviceType, _ 
                                     FrontBuffer.Format, 0, D3DMULTISAMPLE_3_SAMPLES) Then
    ' things to do if D3DMULTISAMPLE_3_SAMPLES works in full screen mode
    ' with the specified surface format
End If

Error Codes

Err.Number is not set for this method.