The IDirect3D3::CreateDevice method creates a Direct3D device to be used with the DrawPrimitive methods.
HRESULT CreateDevice(
REFCLSID rclsid,
LPDIRECTDRAWSURFACE4 lpDDS,
LPDIRECT3DDEVICE3 * lplpD3DDevice,
LPUNKNOWN pUnkOuter // See remarks
);
If the method succeeds, the return value is D3D_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.
In the IDirect3D2 interface, the CreateDevice method accepts only three parameters, which are identical to the first three parameters for the IDirect3D3::CreateDevice method.
When you call IDirect3D3::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/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3d.h.
Import Library: Use ddraw.lib.
IDirect3DDevice3, Creating a Direct3D Device, Direct3D Devices