The IDirect3D2::CreateDevice method creates a Direct3D device to be used with the DrawPrimitive methods.
HRESULT CreateDevice(
REFCLSID rclsid,
LPDIRECTDRAWSURFACE lpDDS,
LPDIRECT3DDEVICE2 * lplpD3DDevice2
);
If the method succeeds, the return value is DD_OK.
If the method fails, the return value is an error. The method returns DDERR_INVALIDPARAMS if one of the arguments is invalid.
This method was introduced with the IDirect3D2 interface. In previous versions of Direct3D, devices could be created only by calling the IDirectDrawSurface::QueryInterface method; devices created in this manner can only be used with execute buffers.
When you call IDirect3D2::CreateDevice, you create a device object that is separate from a DirectDraw surface object. This device uses a DirectDraw surface as a rendering target.
Windows NT: Use version 5.0 or later.
Windows: Use Windows 95 or later. Available as a redistributable for Windows 95.
Windows CE: Unsupported.
Header: Declared in ddraw.h.
Import Library: Use ddraw.lib.