Share via


Use of SurfaceHeap (Windows Embedded CE 6.0)

1/6/2010

Once you start implementing new display modes or different surface types, you may find that GPE's Node2D class does not meet your requirements. Although it is sufficient in situations where all surfaces, including the GDI primary surface, are exactly the same type, the Node2D class cannot properly handle a heap containing surfaces with different bit depths. The SurfaceHeap Class object is built for just this reason.

Your driver uses the SurfaceHeap object in much the same way that it uses the Node2D class. The SurfaceHeap and Node2D classes are very similar, and migration to this new heap management class is readily accomplished.

Support of multiple surface types is not a prerequisite for implementing the SurfaceHeap object. The first step for your existing driver's migration should be to support a single pixel format type with Node2D, and then move directly to SurfaceHeap before adding any new surface types or modes. Microsoft recommends that all DDGPE-based drivers move to the SurfaceHeap heap management class, and that all new DDGPE-based drivers be written to use SurfaceHeap. This practice will make future expansion much easier.

See Also

Concepts

Driver Extension Using DDGPE
DirectDraw Driver Samples