|
Documentation
|
The GAPI in GapiDrawThis document has been updated for use with GapiDraw 3.0 or later. |
IntroductionThis document highlights the mappings in GapiDraw to the library gx.dll for display and key access. It is useful for hardware manufacturers that want to provide maximum graphics performance and high application compatibility for their devices. The first Windows CE device with a color display was released by Casio in early 2000. The "Palm-Sized PC" Cassiopeia E-105 was running Windows CE 2.11 and had a 16-bit color TFT display. Developers immediately wanted to explore this new device for gaming, but since the operating system Windows CE 2.11 did not provide sufficient support for drawing graphics to the display they had to work around the Windows CE system to draw the graphics themselves. One of the first arcade-action games running on Windows CE devices was the game Jimmy Ark (by Jimmy Software), which drew its graphics directly to the frame buffer of the device, bypassing the operating system. Later that year (in July), Microsoft released the runtime module "gx.dll" for Pocket PCs, which was meant to be used to retrieve the address of the frame buffer and lock the keys of the device. The gx.dll library is commonly referred to as "Microsoft GAPI". GapiDraw uses the frame buffer pointer returned by the gx.dll to draw its graphics. GapiDraw also uses the key lock functionality of "gx.dll" to lock all keys upon request. The following sections outline how this connection is implemented so that hardware manufacturers can use it to improve graphics performance on their devices.
Dynamic linkageGapiDraw will link to the DLL "gx.dll" dynamically, using LoadLibrary(TEXT("gx.dll")). If the DLL was found (it should reside in the application folder or the "Windows" folder), its functions will be mapped using either GetProcAddress (if GapiDraw runs on a stationary PC), or reinterpret_cast (if GapiDraw runs on a Pocket PC).
Unsupported devicesToday there are some devices that return incorrect values in their GAPI calls (such as the IPAQ 38xx series and some of the Palmax @migo devices). On such devices GapiDraw will not use gx.dll but instead access the display frame buffer directly, using a surface created in system memory as a backbuffer.
Display pitch valuesGapiDraw supports all pitch values with unaffected performance. Some examples are:
GapiDraw will always (a) flip xPitch and yPitch so that xPitch is always the smallest value, and (b) invert xPitch so that it always is +1. Hardware manufacturers are encouraged to expose the display in its native rotation, and not try to rotate the backbuffer as it is being copied to the display if double buffered access is used.
CGapiDisplay mappingsCGapiDisplay::OpenDisplay
CGapiDisplay::CloseDisplay
CGapiDisplay::Flip
Please note that GapiDraw supports relocation of the frame buffer address returned by GXBeginDraw(). CGapiDisplay::SuspendDisplay
CGapiDisplay::ResumeDisplay
CGapiInput mappingsCGapiInput::OpenInput
CGapiInput::CloseInput
Hardware design guidesThe following are a quick list of features to consider when designing a gx.dll interface:
|