Qt 4.2: Qtopia Core and OpenGL

|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# Qtopia Core and OpenGL

Starting with the 4.2 release, Qtopia Core supports OpenGL ES (OpenGL for Embedded Systems). To be able to use the OpenGL API in Qtopia Core, it must be integrated with the Q Window System (QWS). This is done by providing an EGL implementation, i.e., a native platform window system interface.

EGL is an interface portable layer for graphics resource management - and works between the rendering API and the underlying native platform window system. There are two ways of implementing EGL in Qtopia Core:

- Simple Integration
- Full Integration

Warning: This feature is under development and is subject to change.

## Simple Integration

The simple integration approach use a ready-made EGL implementation, only requiring a simple custom interface between the EGL interface and QWS. To illustrate, the current release of Qtopia Core provides a simple example interface integrating the "Vanilla" EGL implementation from Hybrid Graphics Ltd. with QWS. The example is located in Qt's `src/opengl` directory (`qegl_qws.*`).

Our example interface uses QImage to draw into the backingstore enabling alpha blending with other windows. It is important to notice that the EGL interface requires that the image data is represented using native types. Using the example interface as a basis for your own integration, you must modify the `qegl_qws_p.h` and `qegl_qws.cpp` files to ensure that the `createNativePixmap()` and `destroyNativePixmap()` functions return the appropiate data. The current implementation converts a QImage object to a "Vanilla" pixmap.

Another approach to simple integration, is to implement the `createNativeWindow()` function that enables the programmer to draw directly onto the screen. Please note that this approach currently requires more extensive modifications of the implementation files. Please contact Trolltech for more information.

## Full Integration

It is also possible to do a full integration, taking the advantage of accelerated hardware, but this requires a custom EGL implementation that is tailored for the given platform. Please contact Trolltech for more information.