The QNX Advanced Graphics TDK is a set of tools and runtime components for creating sophisticated displays that feature accelerated 2D and 3D graphics rendering with little CPU overhead. Based on a clean room and certified implementation of the industry standard OpenGL ES API, it allows developers to leverage a base of existing OpenGL code as well as industry programming expertise.
Development tools
Runtime components
QNX Graphics technologies provide flexibility and performance
At the core of the QNX Advanced Graphics TDK is a technology called Graphics Framework (GF). GF provides the services
that allow the graphic programmer to build interfaces that range from the tiniest 2D environment to feature-rich 2D and
3D environments including web browsers and email programs.
The GF architecture allows programs to render directly to hardware, making them faster and more responsive in an
embedded environment where resources are limited. GF achieves this by providing direct access to graphics drivers
(there is no message passing or context switching while rendering), and by using hardware acceleration where possible.
This makes it perfect for embedded environments, where it can be used as the basic graphics layer for anything from a
simple full screen UI to a complex windowing system for multiple application GUIs. It can also act as a porting layer
for existing UIs.
For embedded 3D requirements, QNX Advanced Graphics TDK supports the OpenGL® ES 1.0 API specification, a
well-defined subset of OpenGL® designed for embedded applications. The QNX implementation supports the Common
profile and EGL platform interface layers.
While the graphics framework can support full screen application user interfaces, it can also handle
multiple threads and multiple applications; you can even run 2D and OpenGL® ES applications alongside
Photon applications, if required.

Software modularity allows you to deploy only those features that are required.
The architecture itself and high performance drivers are all built to get the best performance possible out of low-end
hardware.
Standards for 3D means developers don't waste c getting up to speed.
Here is an example of a typical application built with the QNX Advanced Graphics TDK and using Graphics Framework.
Note that all of these components are optional, except for the graphics driver (devg) and the application code itself
(which is statically linked with only the necessary routines required from the Advanced Graphics libraries).

While the Graphics Framework is intended for full screen application user interfaces, it can handle multiple threads,
multiple applications, and you can even run 2D and OpenGL® ES applications alongside Photon applications, if required.
The Graphics Framework uses a client/server model, with an io-display monitor process acting as the server and managing
device resources (such as memory and layers) and hardware access. The client (the graphical application) renders directly
to the hardware. Clients obtain a lock (a mutex in shared memory) by calling gf_draw_begin() to ensure that only one thread
or application has access to the hardware at a time. The io-display monitor process provides increased robustness by catching
abnormal client termination, cleaning up resources after termination, and reviving the shared mutex if it was held by an
abnormally terminated client. The shared memory mutex is given to the highest priority waiting thread, ensuring that the
graphics program with highest priority will be able to draw first.
All hardware access by GF applications is brokered by the io-display monitor process. The io-display monitor process
also allocates all video memory, and handles application termination (both normal and abnormal) by releasing allocated
memory, and releasing locked hardware (if necessary). This control can be "invisible" to graphic client programs,
as all interactions are handled internally by the library.
The diagram below illustrates the relationship of the io-display monitor process to three separate programs or clients:

Note that all three programs load in the graphics driver shared object (devg) and are directly controlling the graphics
hardware. Each program will take a turn in using the graphics driver by asking for and receiving the mutex managed by the
io-display monitor process. The order of the exclusive access is based on the priority of the requesting program.
Once io-display has started, applications can use the Graphics Framework library (libgf) and OpenGL® ES libraries to
acquire a graphics context and render to the device.
Third party application frameworks or existing in-house frameworks can easily be used with the QNX Advanced Graphics TDK.
An existing framework can choose to use any of the underlying supported features including 2D draw, 3D draw, image and font
support. Simple wrapper routines can be used to thinly abstract draw operations while still providing the existing framework
with the performance and real-time features inherent in the Graphics Framework.
Within the QNX Graphics Framework there are conceptual components used to divide the graphical environment in to an
understandable hierarchy. These components are:
Devices and displays are the logical entities representing hardware components managed by GF. A device is a piece
of graphics hardware, which is attached to and managed by io-display via the appropriate devg-* driver. Each device has an
entry in /dev/io-display.
Each device has at least one display, which represents the video display viewed by the end-user. Some devices are
multi-headed, meaning they support multiple displays.
Layers represent an area of memory that is shown on a display. Some modern graphics hardware supports multiple
layers, though from the GF perspective all devices have at least one layer (layer 0). Layers provide a great deal of
flexibility in laying out content on a display. For example, you can put a scrolling map on a background layer, and GUI
controls for scrolling the map on a front layer. The application can scroll the map smoothly without redrawing the GUI
controls, eliminating flicker and reducing CPU load. In any situation where you want to display text or a GUI over top of
visual information, layering can be very useful.

A surface is piece of memory that the GF library can render to. If the surface is connected to a layer
(and the layer is visible), anything rendered on the surface appears on the layer's display. The surface must have a
pixel format that is supported by the layer so that objects rendered onto the surface appear correctly. Generally, a
layer targets (or is associated with) a single surface. An exception is planar data, such as planar YUV commonly used
for video capture, which requires three surfaces (one for each video component).
By default, the GF allocates a surface in video memory for highest performance. However, when you create the surface
you can request that it be optimized for CPU access, which generally means it will be allocated in system RAM.
A context is a structure that maintains information about a rendering target between calls to rendering functions,
such as the pen width, foreground and background colors, and clipping rectangle. A context targets a surface, and is an
argument to all GF drawing functions. A surface can be used for 2D drawing or OpenGL ES 3D drawing. Surfaces can be
combined on multiple layers before they become visible.
This figure illustrates how contexts, surfaces, and layers are relate
By using the combination of displays, layers, surfaces and draw contexts, very complex screens can be built from
simple applications. The 2D navigation example below shows a graphics environment that supports four layers. Three
layers are being used: one for 2D map display, one for menu/touchscreen and another for warning messages. The system
designer may choose to build this as one complete program or as three separate programs. Proper use of chromakey and
alphablending enable the visibility between the layers.
Adding 3D then becomes as simple as developing an OpenGL® ES program and either replacing the 2D program with the
3D upgrade or running the OpenGL® ES program on the same layer as 2D (split screen).
Adding a web browser becomes as simple as starting Photon on a graphic layer and then running a custom web browser
application developed with the QNX Web Browser TDK.
If the QNX Photon microGUI windowing system is distributed with a customer product, then a Photon license must be provided for each runtime.
The Web Browser Technology Development Kit for customizing a web browser is sold separately.
Please contact your QNX account manager for a complete list of current
graphics chip support.
OpenGL® ES and the oval logo are trademarks of Silicon Graphics, Inc. in the United States and/or
other countries worldwide. Products bearing such trademarks incorporate intellectual property that is owned
and licensed to others by Silicon Graphics, Inc.