Share via


Implementing DDHAL Functionality (Windows Embedded CE 6.0)

1/6/2010

This topic describes the steps required to implement minimal DirectDraw hardware abstraction layer (DDHAL) functionality in your display driver, and assumes that you do not want to move an existing DDHAL from the Windows desktop to Windows Embedded CE.

The source code for sample display drivers for Windows Embedded CE is located in driver-specific subdirectories of %_WINCEROOT\Public\Common\OAK\Drivers\Display. The HAL source code is located in the %_WINCEROOT\Public\Common\OAK\Drivers\Display\DDGPE directory. For information about the basic DDGPE header and library files, see DirectDraw Driver Samples.

The following list shows the items you need to implement a simple DDHAL in your display driver:

  • The build files used to export functions from your compiled code. This usually has the name of your compiled binary, as defined in the TARGETNAME=BINARYNAME section of your sources file, and ends with the .def extension.
  • The build files used to define include paths, and to attach source code and libraries to your project, usually called sources.

To implement DDHAL functionality

  1. Modify the file used to export functions from your compiled binary.

    It should export the HALInit function. To see how this is done, you can consult the sample driver source code file DDI.def. The HALInit function is part of the Ddgpe.lib. This should already be linked to your project.

  2. Modify your include path to include directory for DDHFuncs.h.

    This is a public header file that can be used by any display driver and should not be modified. For more information, see DirectDraw Driver Samples.

  3. Copy the Ddgpeusr.h header file from one of the sample driver's source directories, such as %_WINCEROOT%\Public\Common\OAK\Drivers\Display\VGAFlat, into an appropriate location inside your display driver's build directory.

    This header file is private to your display driver and can be modified. You must customize this file to implement the IN_VBLANK and IS_BUSY macros because they are required by the sample DDHAL implementation.

  4. Using the sample display driver that most closely matches the architecture of your display driver, copy the following source code files from the basic HAL source code in the sample display drivers into your display driver's build directory, and add them to the appropriate build files:

    • HalCaps.cpp
    • HalDD.cpp
    • HalSurf.cpp
    • HalPalette.cpp
  5. Compile and build your display driver and ensure that it continues to work properly.

    Once you verify that it is still functional, your driver is ready to be tested with DirectDraw programs. Keep in mind that the code is not in an optimized state and will require some customization to improve performance.

See Also

Concepts

DirectDraw Display Driver Creation
Driver Extension Using DDGPE
DDHAL Customization