DDGPE::AllocSurface

The DDGPE AllocSurface routines are extensions to its counterpart, the GPE::AllocSurface method. 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 GPE surface types.

// 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
    Contains a pointer to a new DDGPESurf object.

  • 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.

    Flag Description
    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, for example, 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.

Remarks

Your driver should override the first DDGPE AllocSurface function that follows 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 AllocSurface routine that follows calls the first one, ignoring the information you might have in DDGPEStandardHeader. Your driver needs to override it if you want to take advantage of DDGPEStandardHeader.

Requirements

OS Versions: Windows CE 2.12 and later. Version 2.12 requires DXPAK 1.0 or later.
Header: Ddgpe.h.
Link Library: Ddgpe.lib.

See Also

GPE::AllocSurface | DDGPEAllocSurfaceData | DDGPE Class | DDGPE Class Definition

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.