Microsoft DirectX 8.0 (C++)

D3DXCompileEffect

Compiles an ASCII effect description into a binary form usable by D3DXCreateEffect.

HRESULT WINAPI D3DXCompileEffect(
  LPCVOID       pSrcData,
  UINT          SrcDataSize,
  LPD3DXBUFFER* ppCompiledEffect,
  LPD3DXBUFFER* ppCompilationErrors
);

Parameters

pSrcData
[in] Pointer to source data, representing the effect to compile.
SrcDataSize
[in] Size of the source data, in bytes.
ppCompiledEffect
[out, retval] Address of a pointer to an ID3DXBuffer interface, containing the compiled effect.
ppCompilationErrors
[out, retval] Address of a pointer to an ID3DXBuffer interface, containing returned ASCII 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
D3DXERR_INVALIDDATA

Remarks

After an effect is compiled, use D3DXCreateEffect to obtain a pointer to a ID3DXEffect interface.

Requirements

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

See Also

D3DXCompileEffectFromFileA, D3DXCompileEffectFromFileW, D3DXCreateEffect