InitSurface method
Initializes a DXSurface object with the specified volume boundary and format from a Microsoft DirectDraw object.
Syntax
HRESULT retVal = object.InitSurface(pDirectDraw, pDDSurfaceDesc, pFormatID, pBounds, dwFlags);
Parameters
pDirectDraw [in]
Type: IUnknownRequired parameter for DXSurface objects. Pointer to the DirectDraw object to use to initialize the surface. Many procedural surfaces ignore this parameter.
pDDSurfaceDesc [in]
Type: const DDSURFACEDESCPointer to the DDSURFACEDESC structure describing the DirectDrawSurface object; can be NULL.
pFormatID [in]
Type: const GUIDPointer 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 pFormatID is equal to their CLSID.
pBounds [in]
Type: const DXBNDSPointer to the DXBNDS boundary structure that contains 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]
Type: DWORDOne 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.
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.