<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- /home/gvatteka/dev/qt-4.3/doc/src/qtopiacore-opengl.qdoc --> <head> <title>Qtopia Core and OpenGL</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <h1 align="center">Qtopia Core and OpenGL<br /><small></small></h1> <p>Starting with the 4.2 release, Qtopia Core</tt> supports <a href="http://www.khronos.org/opengles/">OpenGL ES</tt></a> (OpenGL for Embedded Systems). To be able to use the OpenGL API in Qtopia Core</tt>, it must be integrated with the Q Window System (QWS). This is done by providing an <a href="http://www.khronos.org/egl/">EGL</tt></a> implementation, i.e., a native platform window system interface.</p> <p align="center"><img src="images/qtopiacore-opengl.png" /></p><p><a href="http://www.khronos.org/egl/">EGL</tt></a> 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 <a href="http://www.khronos.org/egl/">EGL</tt></a> in Qtopia Core</tt>:</p> <ul><li><a href="#simple-integration">Simple Integration</a></li> <li><a href="#full-integration">Full Integration</a></li> </ul> <p><b>Warning:</b> This feature is under development and is subject to change.</p> <a name="simple-integration"></a> <h2>Simple Integration</h2> <p>The simple integration approach use a ready-made <a href="http://www.khronos.org/egl/">EGL</tt></a> implementation, only requiring a simple custom interface between the <a href="http://www.khronos.org/egl/">EGL</tt></a> interface and QWS. To illustrate, the current release of Qtopia Core</tt> provides a simple example interface integrating the "Vanilla" EGL implementation from <a href="http://www.hybrid.fi/">Hybrid Graphics Ltd.</tt></a> with QWS. The example is located in Qt's <tt>src/opengl</tt> directory (<tt>qegl_qws.*</tt>).</p> <p align="center"><img src="images/qtopiacore-vanilla.png" /></p><p>Our example interface uses <a href="gui/QImage.html"><tt>QImage</tt></a> to draw into the backingstore enabling alpha blending with other windows. It is important to notice that the <a href="http://www.khronos.org/egl/">EGL</tt></a> 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 <tt>qegl_qws_p.h</tt> and <tt>qegl_qws.cpp</tt> files to ensure that the <tt>createNativePixmap()</tt> and <tt>destroyNativePixmap()</tt> functions return the appropiate data. The current implementation converts a <a href="gui/QImage.html"><tt>QImage</tt></a> object to a "Vanilla" pixmap.</p> <p>Another approach to simple integration, is to implement the <tt>createNativeWindow()</tt> 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 <a href="mailto:qtbugs@trolltech.com">Trolltech</tt></a> for more information.</p> <a name="full-integration"></a> <h2>Full Integration</h2> <p>It is also possible to do a full integration, taking the advantage of accelerated hardware. This requires creating a custom driver using the screen driver framework. See the Accelerated Graphics Driver Example</tt> for more information on the screen driver framework, and see the <tt>OpenGL for Embedded Systems Example</tt> for an example OpenGL ES integration.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="30%">Copyright © 2007 <a href="trolltech.html">Trolltech</a></td> <td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="30%" align="right"><div align="right">Qt Jambi </div></td> </tr></table></div></address></body> </html>