Share via


Extending a Display Driver with the DDGPE Classes (Windows Embedded CE 6.0)

1/6/2010

This topic describes the steps required to extend your display driver using the DirectDraw Graphics Primitive Engine (DDGPE) C++ classes. The DDGPE C++ classes allow the Graphics Primitive Engine (GPE) to include a DirectDraw hardware abstraction layer (DDHAL). To add this functionality, you will need to make some minor changes to your source code.

For information about the basic DDGPE header and library files, see DirectDraw Driver Samples. The source code for DDGPE is at %_WINCEROOT%\Public\Common\OAK\Drivers\Display\DDGPE.

Before you begin, you need to know the location of the following:

  • The build file, usually called Sources, that contains information to link your device driver to Gpe.lib.
  • The header file that contains your device-specific declaration of a GPE-derived class.
  • The source code file that contains the constructor of the device-specific derivation of the GPE class, along with any other files that include the Gpe.h header file.
  • Any header files that contain the device-specific derivation of the DDGPESurf Class.
  • Any source code files that reference the GPESurf class directly, for example, constructors for any derived classes.

To extend a display driver with the DDGPE classes

  1. Place Ddgpe.lib in the appropriate library directory path for your display driver, and put Ddgpe.h in the appropriate header directory path.

    Make the changes in your build file to link to Ddgpe.lib and to Gpe.lib, which should already exist. Depending on your build environment, you may need to add Ddgpe.lib as one of your SOURCELIBS entries so your linker can export HALInit properly.

  2. Modify your display driver's .def file to include HALInit so DirectDraw can find the entry point to the display driver.

  3. Change the header file that defines your device-specific class to derive directly from DDGPE instead of from GPE.

    Make any necessary changes to your constructors or other functions to accommodate this change of base class. Change the files that include Gpe.h to include Gdgpe.h.

  4. Change any header files that derive from the GPESurf class to derive from DDGPESurf. These may or may not be present in your display driver.

    Modify your source code to accommodate this change of base class. You should be sure that your code always refers to DDGPESurf where it would normally refer to GPESurf.

    The primary surface of an object must be created as a DDGPESurf object, not a GPESurf object. DDGPE typecasts this object, and the typecast will fail if the original object was not a DDGPESurf.

  5. (Optional) You must provide support for VidMemBase in your display driver to dynamically change video display resolution. To do this, handle GUID_GetDriverInfo_VidMemBase in the implementation of the method DDGPE::HalGetDriverInfo and also set the ddwVidMemTotal parameter in DDCAPS appropriately.

  6. Recompile your display driver and test it to be sure that it still works properly.

    When you have verified that it is working, continue to the next topic, Implementing DDHAL Functionality.

See Also

Concepts

DirectDraw Display Driver Creation