Microsoft Windows CE 3.0  

WrapSurface

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

The WrapSurfacefunction creates a DDGPESurf-based object based on a pointer to an existing block of memory. The new object can optionally be associated with a DirectDraw surface.

You would normally use this function to wrap a surface around surface memory you have created manually, either in video or system memory. If a pointer to allocated surface memory is not supplied, the WrapSurfacefunction will result in a call to AllocSurface, which is implemented by the driver. Your driver is responsible for allocating video memory for these surfaces, if possible, and for requesting that DDGPESurfallocate system memory, if necessary.

virtual SCODE WrapSurface ( LPDDRAWI_DDRAWSURFACE_GBL
lpDDSurface
,
int
width
,
int
height
,
EGPEFormat
format
,
EDDGPEPixelFormat
pixelFormat
,
int
stride
,
int
surfaceFlags
);
virtual
SCODE WrapSurface (
DDGPESurf **
ppSurf
,
int
width
,
int
height
,
EGPEFormat
format
,
EDDGPEPixelFormat
pixelFormat
,
unsigned char *
pBits
,
int
stride
);
virtual SCODE WrapSurface (
LPDDRAWI_DDRAWSURFACE_GBL
lpDDSurface
,
int
width
,
int
height
,
EGPEFormat
format
,
EDDGPEPixelFormat
pixelFormat
,
unsigned char *
pBits
,
int
stride
);
virtual SCODE WrapSurface (
DDGPESurf **
ppSurf
,
DDGPEAllocSurfaceData*
pddgpeAllocSurfaceData
);
virtual SCODE WrapSurface (
LPDDRAWI_DDRAWSURFACE_GBL
lpDDSurface
,
DDGPEAllocSurfaceData*
pddgpeAllocSurfaceData
);

Parameters

ppSurf
Will contain a pointer to a new DDGPESurfobject.
lpDDSurface
A pointer to an existing DirectDraw surface. A new DDGPESurfobject will be attached to it. Any existing DDGPESurfobject attached to this surface will be replaced. The driver is responsible for management of surfaces replaced in this manner.
width
The width of the surface.
height
The height of the surface.
format
The format of the surface.
pixelFormat
The display mode's pixel format.
pBits
A pointer to an existing block of video or system memory that will be used to store the surface's data.
stride
The stride of the surface.
surfaceFlags
GPE surface flags for the surface.

GPE_REQUIRE_VIDEO_MEMORY: Surface memory must be allocated in video memory.

GPE_PREFER_VIDEO_MEMORY: Surface memory should be allocated in video memory if possible, but can be allocated in system memory, if necessary.

If no flags are set (i.e. surfaceFlags is set to zero (0)), the surface will be allocated in system memory.

pddgpeAllocSurfaceData
See DDGPEAllocSurfaceData.

Return Values

The return value is S_OK if the function is successful. Otherwise an error code is returned.



 Last updated on Tuesday, July 13, 2004

© 2004 Microsoft Corporation. All rights reserved.