Compartir a través de


ID3D10Include::Open method

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

Syntax

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

Parameters

  • IncludeType [in]
    Type: D3D10_INCLUDE_TYPE

    The location of the #include file. See D3D10_INCLUDE_TYPE.

  • 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 returned buffer that contains the include directives. This pointer remains valid until ID3D10Include::Close is called.

  • pBytes [in]
    Type: UINT*

    Number of bytes returned in ppData.

Return value

Type: HRESULT

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 D3D10CompileShader*** functions.
  • The effect will fail one of the D3D10CreateEffect*** functions.

Remarks

The ID3D10Include interface is type defined in the D3D10Shader.h header file as a ID3DInclude interface, which is fully defined in the D3DCommon.h header file.

typedef interface ID3DInclude ID3D10Include;

Requirements

Header

D3D10Shader.h

See also

D3D10_INCLUDE_TYPE

ID3D10Include Interface

ID3D10Include::Close