ID3DInclude::Open method

A user-implemented method for opening and reading the contents of a shader #include file.

Syntax


HRESULT Open(
  [in]   D3D_INCLUDE_TYPE IncludeType,
  [in]   LPCSTR pFileName,
  [in]   LPCVOID pParentData,
  [out]  LPCVOID *ppData,
  [in]   UINT *pBytes
);

Parameters

IncludeType [in]

Type: D3D_INCLUDE_TYPE

A D3D_INCLUDE_TYPE-typed value that indicates the location of the #include file.

pFileName [in]

Type: LPCSTR

Name of the #include file.

pParentData [in]

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 [out]

Type: LPCVOID*

Pointer to the buffer that contains the include directives. This pointer remains valid until you callID3DInclude::Close.

pBytes [in]

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

Header

D3DCommon.h

Library

D3DCompiler.lib

DLL

D3DCompiler_47.dll

See also

ID3DInclude
ID3DInclude::Close

 

 

Community Additions

ADD
Show:
© 2014 Microsoft