Share via


D3dContextCreate

This function creates a context.

DWORD (*APIENTRY *LPD3DHAL_CONTEXTCREATECB)(
  LPD3DHAL_CONTEXTCREATEDATA pccd
);

Parameters

  • pccd
    [in] Points to a D3DHAL_CONTEXTCREATEDATA structure that contains the information required to create a context. It also contains the data that the driver should store in the new context.

Return Values

The D3dContextCreate function returns one of the following callback codes:

Remarks

You must implement the D3dContextCreate function in a driver that supports Direct3D. The following list shows the steps the driver should perform:

  • Initialize the driver's context with the information required by the driver to perform rendering. This includes associating the rendering target and depth buffer that the lpDDSLcl and lpDDSZLcl members of the D3DHAL_CONTEXTCREATEDATA point to, respectively, with the context.
  • Generate a unique context identifier for this new context and return it in the dwhContext member of the D3DHAL_CONTEXTCREATEDATA structure. Direct3D will use this context identifier in every subsequent callback it makes to this Direct3D device. The driver must never create a context handle of zero.
  • Set the ddrval member of the D3DHAL_CONTEXTCREATEDATA structure to DD_OK upon success and to D3DHAL_OUTOFCONTEXTS if it cannot create the context.
  • Return DDHAL_DRIVER_HANDLED upon return.

Contexts do not share states; therefore, the driver must maintain full state information for each context. This state will change due to any subsequent calls to the D3dDrawPrimitives2 function.

The driver must reference all texture handles that are created within the created context. By referencing these handles, the driver can remove driver-specific data related to textures created within this context when a D3dContextDestroy function call is made.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Proto.h.
Link Library: Developer implemented.

See Also

D3dContextDestroy | D3dDrawPrimitives2 | D3DHAL_CONTEXTCREATEDATA | Direct3D Driver Functions

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.