Partager via


IDirect3DDevice9Ex Interface 

IDirect3DDevice9Ex Interface

Applications use the methods of the IDirect3DDevice9Ex interface to render primitives, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders.

The IDirect3DDevice9Ex interface derives from the IDirect3DDevice9 interface; therefore it inherits all the member functions of IDirect3DDevice9. To see more about IDirect3DDevice9, get the latest DirectX SDK documentation from the DirectX Developer Center.

CheckDeviceState Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.
CheckResourceResidency Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.
ComposeRect Sets the filter that the Device object uses to perform monochrome convolution filtering.
GetGPUThreadPriority Gets the current priority stored with the Direct3D device.
GetMaximumFrameLatency Retrieves the number of frames of data that the drivers are allowed to queue.
PresentEx Presents the contents of the next buffer in the sequence of back buffers owned by the device.
ResetEx Resets the type, size, and format of the swap chain.
SetConvolutionMonoKernel Sets the filter that the Device object uses to perform monochrome convolution filtering.
SetGPUThreadPriority Connects to a new kernel-mode entry point with the specified thread priority.
SetMaximumFrameLatency Sets the number of frames of data that the drivers are allowed to queue.
TestCooperativeLevel Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application. Deprecated
WaitForVBlank Allows applications to efficiently throttle their frame rate to that of the monitor associated with the device.

The IDirect3DDevice9Ex interface is obtained by calling IDirect3D9Ex::CreateDeviceEx. This interface, like all interfaces, inherits the IUnknown interface methods.

The LPDIRECT3DDEVICE9EX and PDIRECT3DDEVICE9EX types are defined as pointers to the IDirect3DDevice9Ex interface:

typedef struct IDirect3DDevice9Ex *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX;

Creating a Device

Follow these two steps to initialize a Direct3D device:

  1. Call Direct3DCreate9Ex to create the Direct3D object.
  2. Call CreateDeviceEx to create the Direct3D device.

Here is an example:

IDirect3D9Ex *pDirect3DEx;
LPDIRECT3DDEVICE9EX pDeviceEx;
DWORD behaviorFlags = D3DCREATE_HARDWARE_VERTEXPROCESSING;

Direct3DCreate9Ex(D3D_SDK_VERSION, &pDirect3DEx);
pDirect3DEx->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, behaviorFlags, &d3dpp, NULL, &pDeviceEx);