Share via


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
);

Parameter

  • IncludeType [in]
    Typ: D3D_INCLUDE_TYPE

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

  • pFileName [in]
    Typ: LPCSTR

    Name of the #include file.

  • pParentData [in]
    Typ: 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]
    Typ: LPCVOID*

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

  • pBytes [in]
    Typ: UINT*

    Pointer to the number of bytes that Open returns in ppData.

Rückgabewert

Typ: 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.

Anforderungen

Header

D3DCommon.h

Bibliothek

D3dcompiler.lib or D3dcompiler_nn.dll

Siehe auch

ID3DInclude

ID3DInclude::Close