IDXSurfaceInit Interface

The IDXSurfaceInit interface is used to initialize a DXSurface object of the specified bounding volume and pixel format created with the CoCreateInstance Component Object Model (COM) method. You should only need to use this interface if you plan to create a DXSurface that either aggregates onto a DirectDrawSurface or is a custom surface built on top of a DXSurface.

IDXSurfaceInit Method

InitSurface Initializes a DXSurface.

IDXSurfaceInit::InitSurface

IDXSurfaceInit Interface

Initializes a DXSurface object with the specified volume boundary and format from a DirectDraw object.

Syntax

HRESULT InitSurface(
    IUnknown *pDirectDraw,
    const DDSURFACEDESC *ppDDSurfaceDesc,
    const GUID *pFormatID,
    const DXBNDS *pBounds,
    DWORD dwFlags
);

Parameters

pDirectDraw
[in] Required parameter for CLSID_DXSurface objects. Pointer to the DirectDraw object to use to initialize the surface. Many procedural surfaces will ignore this parameter.
ppDDSurfaceDesc
[in] Pointer to the DDSURFACEDESC structure describing the DirectDrawSurface; can be NULL.
pFormatID
[in] Pointer to the pixel format. If NULL, the default format for the surface can be used, or the pixel format in the DDSurfaceDesc can be used. For procedural surfaces, the FormatID will be equal to their CLSID.
pBounds
[in] Pointer to the DXBNDS boundary structure containing this surface's bounding volume. This parameter is optional for standard DXSurfaces because the bounds of the surface are already defined. It is required, however, for procedural surfaces.
dwFlags
[in] One or more of the DDSURFACEDESC flags that are passed to the IDXSurfaceFactory::CreateSurface method. These are DXSF_FORMAT_IS_CLSID and DXSF_NO_LAZY_DDRAW_LOCK. Procedural surfaces can ignore these flags.

Return Value

Returns an HRESULT value that depends on the implementation of the interface.

Remarks

The CDXBaseSurface base class implements this method for procedural surfaces. DXSurfaces that are created through CoCreateInstance must either be initialized through this interface or through one of the methods in the IDXARGBSurfaceInit interface before the surface can be used.

See Also

IDXARGBSurfaceInit::InitFromDDSurface


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.