Support for DirectDraw by wince5.0 display driver
Author: Lai yuping (auly) aulyp@163.com
Block diagram:
Both DDI and Hal units are components of the display device driver.
The export function of the DDI unit is drvenabledriver, and the export function of the Hal unit is halinit. DDI units provide services for GDI, while Hal units and Windows CE bring up the DirectDraw service by means of software simulation. Both GDI and DirectDraw are components of the GWES subsystem of the Windows CE operating system, the former is mainly responsible for drawing simple geometric diagrams such as rectangles, straight lines, and circles, as well as relatively simple block transmission and linear hardware acceleration, the latter can draw complex 2D patterns and more advanced hardware acceleration.
1 another important export function of the LCD controller driver dynamic link library is halinit, which is called by DirectDraw during driver initialization. All the implementation code of the halinit function is to construct a ddhalinfo struct that provides Function Support Information for DirectDraw.
2HalinitFunction execution mainly calls two functions:
FillhelcapsThe function initializes the ddhelcaps Member of the ddhalinfo struct. It is the DirectDraw capability supported by software simulation for device drivers. Because it is irrelevant to the hardware of specific display devices, the work of filling ddhelcaps members is done by Microsoft,
BuildddhalinfoThe function initializes the hardware-related data of the ddhalinfo struct pointed to by the lpddhi pointer. This part records the DirectDraw support capability of the Hal unit, the Hal unit is an integral part of the display device driver and must be implemented by the user.
3. In buildddhalinfo, use a global structure g_pgpe to obtain the initialization information (sunsamg2450bsp ).
In halcaps. cpp
Lpddhi-> vmidata. ddpfdisplay. dwrgbbitcount return LCD digits
CreatesurfaceYesMember function of the ddhal_ddcallbacks struct, which is the container of the DirectDraw object callback function. These are hardware-related functions that must be implemented.
Ddhal_ddcallbacks,
Ddhal_ddcolorcontrolcallbacks
Ddhal_ddexebufcallbacks
Ddhal_ddkernelcallbacks
Ddhal_ddmiscellaneouscallbacks
Ddhal_ddpalettecallbacks
Ddhal_ddsurfacecallbacks
Ddhal_ddhalmemorycallbacks
Ddhal_ddvideoportcallbacks
Ddkernelcaps
The above struct implements interaction with the operating system and defines various information in these structures. The system calls the driver through the interface defined here.
For details, see Li Dawei's book, chapter 14
In the Display Device Driver of the Windows CE operating system, the DirectDraw display surface is usedDdgpesurfClass. The so-called
The DirectDraw display surface is a display surface that supports the DirectDraw function. DirectDraw display surface and general display
Shows the relationship between a specific and abstract surface,DdgpesurfIs a subclass of the gpesurf class.
DdgpesurfClass member:
M_epixelformat member records the pixel format in the DirectDraw display table