IDXARGBSurfaceInit Interface

The IDXARGBSurfaceInit interface is used to initialize a DXSurface object created from a DirectDrawSurface or a buffer. This is usually done for the user by IDXSurfaceFactory methods. This should only need to be done directly for custom surface implementations based on application-supplied memory.

This interface derives from the IDXSurfaceInit interface.

IDXARGBSurfaceInit Methods

InitFromDDSurface Initializes a DXSurface from an existing DirectDrawSurface.
InitFromRawSurface Initializes a DXSurface object from a client-created object that supports the IDXRawSurface interface.

IDXARGBSurfaceInit::InitFromDDSurface

IDXARGBSurfaceInit Interface

Initializes a DXSurface from an existing DirectDrawSurface.

Syntax

HRESULT InitFromDDSurface(
	IUnknown *pDDrawSurface,
	const GUID *pFormatID,
	DWORD dwFlags
);

Parameters

pDDrawSurface
[in] Pointer to the DirectDrawSurface object to use to initialize the DXSurface. Specify NULL for this parameter to uninitialize a surface previously initialized by a call to this method.
pFormatID
[in] Pointer to the pixel format. If NULL, the pixel format of the DirectDrawSurface is used. Otherwise, the DirectDrawSurface will be operated on as a surface of the specified pixel format, regardless of the DirectDraw pixel format. This is used to support surfaces with an alpha channel on versions of DirectDraw that do not support alpha.
dwFlags
[in] Unused; must be zero.

Return Value

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

Remarks

Usually you would use the IDXSurfaceFactory::CreateFromDDSurface instead of calling this method directly.

See Also

IDXSurfaceInit::InitSurface, IDXSurfaceInit::CreateFromDDSurface

IDXARGBSurfaceInit::InitFromRawSurface

IDXARGBSurfaceInit Interface

Initializes a DXSurface object from a client-created object that supports the IDXRawSurface interface.

Syntax

HRESULT InitFromDDSurface(
	IDXRawSurface *pRawSurface
);

Parameters

pRawSurface
[in] Pointer to an IDXRawSurface interface; if NULL, the surface releases any existing surface memory and becomes uninitialized.

Return Value

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

Remarks

The IDXRawSurface interface is used by the DXSurface to obtain a pointers to the surface memory, the pitch, pixel format, color key, and a handle to a device context. Clients that need to perform operations directly on memory buffers or DIB Sections can use this mechanism to create DXSurface objects that operate directly on their data.

Raw surface objects are wrappers for application-supplied pixel buffers, such as a GDI DIB sections or application-defined memory objects.


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