IDirect3DRM2::CreateDeviceFromClipper
Creates a Direct3DRMDevice2 Windows device by using a specified DirectDrawClipper object. An IDirect3DRMDevice2 interface works with an IDirect3DDevice2 Immediate-Mode device. The IDirect3DDevice2 device supports the DrawPrimitive interface as well as execute buffers, and is required for progressive meshes and for alpha blending and sorting of transparent objects.
HRESULT CreateDeviceFromClipper(
LPDIRECTDRAWCLIPPER lpDDClipper,
LPGUID lpGUID,
int width,
int height,
LPDIRECT3DRMDEVICE2 * lplpD3DRMDevice
);
Parameters
lpDDClipper
Address of a DirectDrawClipper object.
lpGUID
Address of a globally unique identifier (GUID). This parameter can be NULL.
width and height
Width and height of the device to be created.
lplpD3DRMDevice
Address that will be filled with a pointer to an IDirect3DRMDevice2 interface if the call succeeds.
Return Values
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained-Mode Return Values.
Remarks
If the lpGUID parameter is NULL, the system searches for a device with a default set of device capabilities. This is the recommended way to create a Retained-Mode device because it always works, even if the user installs new hardware.
The system describes the default settings by using the following flags from the D3DPRIMCAPS structure in internal device-enumeration calls:
D3DPSHADECAPS_ALPHAFLATSTIPPLED
D3DPTBLENDCAPS_COPY | D3DPTBLENDCAPS_MODULATE
D3DPMISCCAPS_CULLCCW
D3DPRASTERCAPS_FOGVERTEX
D3DPCMPCAPS_LESSEQUAL
D3DPTFILTERCAPS_NEAREST
D3DPTEXTURECAPS_PERSPECTIVE | D3DPTEXTURECAPS_TRANSPARENCY
D3DPTADDRESSCAPS_WRAP
If a hardware device is not found, the monochromatic (ramp) software driver is loaded. An application should enumerate devices instead of specifying NULL in the lpGUID parameter if it has special needs that are not met by this list of default settings.