![]() |
![]() |
![]() |
A user-implemented method for opening and reading the contents of a shader #include file.
Syntax
HRESULT Open(
D3DXINCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes );
Parameters
- IncludeType
- [in] The location of the #include file. See D3DXINCLUDE_TYPE.
- pFileName
- [in] Name of the #include file.
- pParentData
- [in] Pointer to the container that includes the #include file.
- ppData
- [out] Pointer to the returned buffer that contains the include directives. This pointer remains valid until ID3DXInclude::Close is called.
- pBytes
- [out] Number of bytes returned in ppData.
Return Value
The user-implemented method should return S_OK. If the callback fails when reading the #include file, the application programming interface (API) that caused the callback to be called will fail. This is one of the following:
- The high-level shader language (HLSL) shader will fail one of the D3DXCompileShader*** functions.
- The assembly shader will fail one of the D3DXAssembleShader*** functions.
- The effect will fail one of the D3DXCreateEffect*** or D3DXCreateEffectCompiler*** functions.
Remarks
An example implementation of this method is shown in the EffectEdit Sample.
See Also
ID3DXInclude::Close