Microsoft DirectX 8.0 (C++)

D3DXCreateEffect

Creates an effect using a compiled source data.

HRESULT WINAPI D3DXCreateEffect(
  LPDIRECT3DDEVICE8 pDevice,
  LPCVOID           pCompiledEffect,
  UINT              CompiledEffectSize,
  DWORD             Usage,
  LPD3DXEFFECT*     ppEffect
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device to be associated with the effect.
pCompiledEffect
[in] Pointer to the compiled source data from which to create the effect.
CompiledEffectSize
[in] Size of the compiled data, in bytes.
Usage
[in] Usage control for this effect. The following flag can be set:
D3DUSAGE_SOFTWAREPROCESSING
Set to indicate that the effect will be rendered using software processing.
ppEffect
[out, retval] Address of a pointer to an ID3DXEffect interface, representing the created effect.

Return Values

If the function succeeds, the return value is D3D_OK.

If the function fails, the return value can be one of the following values.

D3DERR_INVALIDCALL
E_OUTOFMEMORY

Remarks

Before using CreateEffect, an effect must be compiled by using any of the following functions:

Requirements

  Header: Declared in D3dx8effect.h.
  Import Library: Use D3dx8.lib.

See Also

D3DXCompileEffect, D3DXCompileEffectFromFileA, D3DXCompileEffectFromFileW