Microsoft DirectX 8.1 (C++)

D3DXCreateEffectFromResource

Creates an effect from a Microsoft® Windows® resource.

HRESULT WINAPI D3DXCreateEffectFromResource(
  LPDIRECT3DDEVICE8 pDevice,
  HMODULE           hSrcModule, 
  LPCTSTR           pSrcresource,
  LPD3DXEFFECT*     ppEffect,
  LPD3DXBUFFER*     ppCompilationErrors
);

Parameters

pDevice
[in] Pointer to an IDirect3DDevice8 interface, representing the device to be associated with the effect.
hSrcModule
[in] Handle to the module that contains the effect.
pSrcresource
[in] Pointer to a string that specifies the Windows resource from which to create the effect.
ppEffect
[out, retval] Address of a pointer to an ID3DXEffect interface, containing the create 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 function supports both Unicode and ANSI strings.

Effects can be created from a sequence of instructions in text strings, an effect file, or a Windows resource.

Requirements

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

See Also

D3DXCreateEffect, D3DXCreateEffectFromFile