Partager via


Implementing DDHAL Functionality (Windows CE 5.0)

Send Feedback

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 CE. For more information about performing that task, see DDHAL Porting from the Desktop.

The source code for Windows CE's sample display drivers 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.

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.

  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

DirectDraw Display Driver Creation | Driver Extension Using DDGPE | DDHAL Customization

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.