Language
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Direct3DCreate9Ex
Create an IDirect3D9Ex object and return an interface to it.
HRESULT Direct3DCreate9Ex( UINT SDKVersion, LPDIRECT3D9 * ppD3D );
Parameters
- SDKVersion
[in] The value of this parameter should be D3D_SDK_VERSION. See Remarks. - ppD3D
[out] Address of a pointer to an IDirect3D9Ex interface, representing the created Direct3D9Ex object. If the function fails, NULL will be placed here.
Return Values
- D3DERR_NOTAVAILABLE when D3D9L features are not supported (no WDDM driver installed) or when the SDKVersion does not match the version of the DLL.
- D3DERR_OUTOFMEMORY when out of memory conditions are detected when creating the enumerator object.
- S_OK when the creation of the enumerator object was successful.
Remarks
The Direct3DEx object is the first object that your application creates and the last object that your application releases. Functions for enumerating and retrieving capabilities of a device are accessible through the Direct3DEx object. This enables applications to select devices without creating them.
Create an IDirect3D9Ex object as shown here:
LPDIRECT3D9EX g_pD3D = NULL;
if( FAILED(Direct3DCreate9Ex(D3D_SDK_VERSION, &g_pD3D)))
return E_FAIL;
The IDirect3D9Ex interface supports enumeration of active display adapters and allows the creation of IDirect3DDevice9Ex Interface objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new IDirect3D9Ex interface will expose the new devices.
D3D_SDK_VERSION is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime DLL's that are installed on the machine. D3D_SDK_VERSION is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version. See GetDXVer Sample for help checking the version of the runtime that is installed on your machine.
Requirements
Header: Declared in D3d9.h.