Microsoft DirectX 8.0 (C++) |
Compiles an effect from a file specified by an ANSI string.
HRESULT WINAPI D3DXCompileEffectFromFileA( LPCSTR pSrcFile, LPD3DXBUFFER* ppCompiledEffect, LPD3DXBUFFER* ppCompilationErrors );
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 |
After an effect is compiled, use D3DXCreateEffect to obtain a pointer to a ID3DXEffect interface.
D3DXCompileEffectFromFile maps to either D3DXCompileEffectFromFileA or D3DXCompileEffectFromFileW, depending on the inclusion or exclusion of the #define UNICODE switch. Include or exclude the #define UNICODE switch to specify whether your application expects Unicode or ANSI strings. The following code fragment shows how D3DXCompileEffectFromFile is defined.
#ifdef UNICODE #define D3DXCompileEffectFromFile D3DXCompileEffectFromFileW #else #define D3DXCompileEffectFromFile D3DXCompileEffectFromFileA #endif
Header: Declared in D3dx8effect.h.
Import Library: Use D3dx8.lib.
D3DXCompileEffect, D3DXCompileEffectFromFileW, D3DXCreateEffect