Resources | developer.brewmp.com Resources | developer.brewmp.com

Developer

resources

Application access to the display

The Brew MP display system provides access to one or more displays through IDisplay objects. (Clamshell devices typically have a secondary display on the outside of the device.)

Brew MP applications access a display by creating a Brew MP display object, obtaining the IDisplay interface, and calling IDisplay functions. The IDisplay interface provides functions for getting display metrics, drawing rectangles, drawing bitmaps, and so forth.

In Brew MP, each display has a pixel buffer, which is called the device bitmap buffer. To manipulate the device bitmap buffer, Brew MP wraps a device bitmap object around the device bitmap buffer. A device bitmap object is a Brew MP bitmap that implements the IBitmap interface. It implements other interfaces as well, including the IBitmapRot, IBitmapDev2, IBitmapDisplay, and IDIB interfaces. The device bitmap object is created when the application creates the IDisplay object.

Each application has one device bitmap object for each display. When there are multiple applications running that access the display, there are multiple device bitmap objects. Each device bitmap object points to the device bitmap buffer for the display, as shown in following figure:

A Brew MP IDisplay object is not associated directly with the device bitmap buffer. An IDisplay object has a reference to a device bitmap object. A display object delegates some of the function calls to the device bitmap object where the device bitmap buffer is manipulated, for example drawing a rectangle on the device bitmap buffer.

Back buffering

When an application uses back buffering, or double buffering, it uses two or more device bitmap buffers. One device bitmap buffer is created when the Display object is created. The application calls IDevBitmapFactory_CreateBitmap() to obtain a second device bitmap buffer. While one buffer is displayed to the screen, the second buffer can be used for drawing. The buffers are swapped when the content of the second buffer is displayed, and the first buffer can be used for drawing.