?/TD>
Microsoft DirectX 9.0

IDirect3DDevice9::CreateOffscreenPlainSurface Method


Create an off-screen surface.

Syntax

HRESULT CreateOffscreenPlainSurface(      

    UINT Width,     UINT Height,     D3DFORMAT Format,     DWORD Pool,     IDirect3DSurface9** ppSurface,     HANDLE* pHandle );

Parameters

Width
[in] Width of the surface.
Height
[in] Height of the surface.
Format
[in] Format of the surface. See D3DFORMAT.
Pool
[in] Surface pool type. See D3DPOOL.
ppSurface
[out, retval] Pointer to the IDirect3DSurface9 interface created.
pHandle
[in] Reserved. Set this parameter to NULL.

Return Value

If the method succeeds, the return value is D3D_OK.

If the method fails, the return value can be:

D3DERR_INVALIDCALLThe method call is invalid. For example, a method's parameter may have an invalid value.


Remarks

D3DPOOL_SCRATCH will return a surface that has identical characteristics to a surface created by the Microsoft?DirectX?8.x method CreateImageSurface.

D3DPOOL_DEFAULT is the appropriate pool for use with the IDirect3DDevice9::StretchRect and IDirect3DDevice9::ColorFill.

D3DPOOL_MANAGED is not allowed when creating an offscreen plain surface. For more information about memory pools, see D3DPOOL.

Off-screen plain surfaces are always lockable, regardless of their pool types.



© 2002 Microsoft Corporation. All rights reserved.