Graphics Patterns

Graphics applications are concurrent and distributed systems, and many patterns of concurrent and distributed programming apply to interactive graphical programs.

Architecture of A Graphics System

Modern graphical computer systems are organised as a display manager that shares the display surface between multiple client applications. Clients communicate with the display manager by message passing, sending drawing requests or queries and receiving replies or user-input events. Some graphics systems, such as X11 (XwindowProtocol,,, NetworkExtensibleWindowSystem, QNX's Photon microGUI ( or OpenGL/GLX (, can pass the messages over the network. Others, such as the GUI components of Windows NT, pass the messages between processes on the same host. Either way, communication costs are a bottleneck in graphics applications and must be minimised to achieve acceptable interactive performance.

The display manager runs concurrently with the display hardware and communicates with it via the graphics card. The display manager writes to the the display memory in the card, and the hardware reads the display memory as the scanline moves down the monitor. The display manager and the display hardware must synchronise to avoid flicker and tearing in the generated graphics. These synchronisation costs must be minimised to achieve acceptable interactive performance.

The communication protocol between the display manager and its clients is too complex to be used directly. Access to the protocol is usually provided by a procedural API, such as XLib or the Win32 GDI, where procedures map quite directly to communication messages passed between client and server. These APIs typically contain hundreds of access functions. However, graphical displays have a natural object-oriented representation, and so the lower level API can be wrapped in a convenient class library or framework.

Patterns of programming graphics and animation.

Representing Graphical Displays as Objects Implementing Interactivity Drawing Pages about or clarifying the patterns

Also see UserInterfacePatterns, SmalltalkGraphicsFramework

CategoryGraphicsPattern CategoryPattern
