Microsoft DirectX 8.1 (C++)

D3DXCreateEffect

Create an effect from a sequence of text strings. Each string contains an effect instruction.

HRESULT WINAPI D3DXCreateEffect(
  LPDIRECT3DDEVICE8 pDevice,
  LPCVOID           pSrcData,
  UINT              SrcDataSize,
  LPD3DXEFFECT*     ppEffect,
  LPD3DXBUFFER*     ppCompilationErrors
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device to be associated with the effect.
pSrcData
[in] Pointer to a sequence of text strings that contain effect instructions. Each string contains a single instruction. Each string must be delimited by quotes. The end of each string must contain a new line character (\n).
SrcDataSize
[in] Size of the effect data, in bytes. Use the sizeof Microsoft® Win32® method to specify the size of the effect.
ppEffect
[out, retval] Address of a pointer to an ID3DXEffect interface, representing the created effect.
ppCompilationErrors
[out, retval] Address of a pointer to an ID3DXBuffer interface, containing any error messages that occurred during compilation. This parameter can be set to NULL to ignore error messages.

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

Effects can be created from a sequence of instructions in text strings, an effect file, or a Microsoft Windows® resource. D3DXCreateEffect creates effect files from text strings and is illustrated in the cubemap sample.

Requirements

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

See Also

D3DXCreateEffectFromFile, D3DXCreateEffectFromResource