Microsoft DirectX 8.1 (C++)

D3DXCreateEffectFromFile

Creates an effect from an effect file. An effect file is a text file.

HRESULT WINAPI D3DXCreateEffectFromFile(
  LPDIRECT3DDEVICE8 pDevice,
  LPCTSTR           pSrcFile,
  LPD3DXEFFECT*     ppEffect,
  LPD3DXBUFFER*     ppCompilationErrors
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device to be associated with the effect.
pSrcFile
[in] Pointer to a string that contains the name of the effect file.
ppEffect
[out, retval] Address of a pointer to an ID3DXEffect interface containing 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
D3DXERR_INVALIDDATA

Remarks

This functions supports both Unicode and ANSI strings.

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

Requirements

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

See Also

D3DXCreateEffect, D3DXCreateEffectFromResource, Effect File Format