Creating a Direct3D Device

When creating a device, you must choose which style of Direct3D programming your application will use — execute buffers or the DrawPrimitive methods. This choice determines which type of interface pointer your application needs to obtain when it creates the device. If you elect to use execute buffers, your application must obtain a pointer to the IDirect3DDevice interface. If you choose to render with the DrawPrimitive methods, your application must obtain a pointer to the IDirect3DDevice3 interface.

The following topics provide details on how to create a device for your application's needs:

Note  Some popular hardware devices require that the render target and depth buffer surfaces use the same bit depth. On such hardware, if your application uses a 16-bit render target surface, the attached depth buffer must also be 16-bits. For a 32-bit render target surface, the depth buffer must be 32-bits, of which 8-bits can be used for stencil buffering (if needed).

If the hardware upon which your application is running has this requirement, and your application fails to meet it, any attempts to create a rendering device that uses the non-compliant surfaces will fail. You can use the DirectDraw method, IDirectDraw4::GetDeviceIdentifier to track hardware that imposes this limitation.