Microsoft Windows CE 3.0  

AllocSurface

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 DDGPE AllocSurfaceroutines are extensions to its counterpart, the GPE AllocSurfacefunction. With the addition of the pixelFormat parameter or the pddgpeAllocSurfaceData, your driver can allocate many different types of surfaces, instead of being restricted to the limited number of GPEsurface types.

Your driver should override the first DDGPE AllocSurfacefunction below to perform the necessary allocation. Otherwise, the function merely wraps to the standard GPE AllocSurface, that you must define in your driver. In this case, the pixelFormat information is ignored. The default implementation of the second DDGPE AllocSurfaceroutine below just calls the first one, ignoring the information you might have in DDGPEStandardHeader. Your driver needs to override it in case you want to take advantage of DDGPEStandardHeader.

// Surface memory allocation virtual SCODE AllocSurface (
DDGPESurf **
ppSurf
,
int
width
,
int
height
,
EGPEFormat
format
,
EDDGPEPixelFormat
pixelFormat
,
int
surfaceFlags
);
virtual SCODE AllocSurface (
DDGPESurf **
ppSurf
,
DDGPEAllocSurfaceData *
pddgpeAllocSurfaceData
);

Parameters

ppSurf
Will contain a pointer to a new DDGPESurfobject.
width
The desired width of the surface.
height
The desired height of the surface.
format
The desired format of the surface.
pixelFormat
The desired pixel format 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.