ID3DInclude::Open method (d3dcommon.h)
A user-implemented method for opening and reading the contents of a shader #include file.
Syntax
HRESULT Open(
D3D_INCLUDE_TYPE IncludeType,
LPCSTR pFileName,
LPCVOID pParentData,
LPCVOID *ppData,
UINT *pBytes
);
Parameters
IncludeType
Type: D3D_INCLUDE_TYPE
A D3D_INCLUDE_TYPE-typed value that indicates the location of the #include file.
pFileName
Type: LPCSTR
Name of the #include file.
pParentData
Type: LPCVOID
Pointer to the container that includes the #include file. The compiler might pass NULL in pParentData. For more information, see the "Searching for Include Files" section in Compile an Effect (Direct3D 11).
ppData
Type: LPCVOID*
Pointer to the buffer that contains the include directives. This pointer remains valid until you callID3DInclude::Close.
pBytes
Type: UINT*
Pointer to the number of bytes that Open returns in ppData.
Return value
Type: HRESULT
The user-implemented method must return S_OK. If Open fails when it reads the #include file, the application programming interface (API) that caused Open to be called fails. This failure can occur in one of the following situations:
- The high-level shader language (HLSL) shader fails one of the D3D10CompileShader*** functions.
- The effect fails one of the D3D10CreateEffect*** functions.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d3dcommon.h |
Library | D3DCompiler.lib |
DLL | D3DCompiler_47.dll |