Editing OpenGL ES Libraries

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
#REDIRECT [[OpenGL-ES]]
+
[[Category:Development]]
 +
Want to start developing for the [[Nokia N900]] using [[OpenGL-ES|OpenGL ES]] but don't know where to start?
 +
 
 +
Here is some information about the various libraries and APIs that are available on the N900. Also included is information about developing with OpenGL ES and some examples.
 +
 
 +
== Library Support ==
 +
 
 +
This section includes a partial list of library options for using OpenGL ES.
 +
 
 +
=== SDL 1.2 + SDL-GLES ===
 +
 
 +
The N900 ships with SDL 1.2. You can use that and a external library, [[User:Javispedro/SDL-GLES|SDL-GLES]] (available in extras), to create simple OpenGL ES 1.1 and 2.0 applications.
 +
 
 +
=== SDL 1.3 ===
 +
 
 +
SDL 1.3 supports OpenGL ES 1.x. This doesn't seem to work in the N900 as of now.
 +
 
 +
=== OpenGL ES 1.x utilies ===
 +
Information:
 +
: http://www.unrealvoodoo.org/hiteck/projects/maemo/
 +
Git repositories:
 +
: http://www.unrealvoodoo.org/git/
 +
 
 +
Sami Kyöstilä has developed a number of utilities. This includes SDL with OpenGL ES 1.x support, libglutes, python-opengles and several translators to convert OpenGL ES and OpenGL. Note that these utilities are designed for the Nokia N810 and OpenGL ES 1.x.
 +
 
 +
=== Qt ===
 +
 
 +
You can use Qt with OpenGL ES 2.x on the Nokia N900. There is an example application called hellogl_es2. Get it here:
 +
: http://qt.gitorious.org/qt/qt/trees/4.5/examples/opengl/hellogl_es2
 +
 
 +
This example shows how to use OpenGL ES embedded in a QtWidget.
 +
 
 +
=== Clutter ===
 +
 
 +
libclutter supports OpenGL ES 2.x. It seems oriented towards toolkits and applications with user interface elements.
 +
 
 +
=== Xlib (X11) ===
 +
 
 +
You can use Xlib (X11) and utilize the EGL library for context creation along with OpenGL ES. This is what the [http://maemo.nokia.com/maemo-select/applications/bounce-evolution Bounce Evolution] game uses.
 +
 
 +
You can use OpenGL ES version 1 or 2 directly without worrying about the version that is supported by the library.
 +
 
 +
See below for an example Xlib application.
 +
 
 +
=== PVRShell ===
 +
 
 +
The Khronos OpenGL ES 2.0 SDK includes a simple API for window creation called PVRShell. They also include additional tools for more advanced computer graphics applications. It is much simpler to create an OpenGL ES 2.0 application using PVRShell. It doesn't seem to have much support for handling events.
 +
 
 +
== Notes ==
 +
 
 +
* OpenGL and OpenGL ES are very different and are not compatible.
 +
 +
* WARNING: If you try to run an OpenGL application with scratchbox then it will most likely work. This is because it uses the native operating system OpenGL libraries to execute. However, if you try and run it on the device it will not work as it only has OpenGL ES libraries.
 +
 
 +
* OpenGL ES doesn't run natively on a desktop computer. It is possible to get some kind of emulation library from the PowerVR Insider SDK [http://www.imgtec.com/powervr/insider/powervr-sdk.asp] so that you can test on a desktop computer. The OpenGL ES 2.0 emulation library was packaged for use inside the FREMANTLE_X86 scratchbox target (package libgles2-dev, extras-devel non-free repository).
 +
 
 +
* OpenGL ES 1.x and OpenGL ES 2.x are also different. OpenGL ES 1.x has a fixed pipeline whereas OpenGL ES 2.x uses shaders. The matrix stack has also been removed and you have to manage it yourself.
 +
 
 +
* If you require any kind of performance in Maemo 5, you need to make your window full screen.
 +
 
 +
== Installation and Examples ==
 +
 
 +
Here are some notes about packages required for OpenGL ES development and some simple examples to help get you started.
 +
 
 +
You can compile OpenGL ES applications with scratchbox. The ESBox IDE makes it much easier to execute the application on the device. It automates copying the binary onto the device and execution.
 +
 
 +
Firstly you want to install the following packages on scratchbox.
 +
 
 +
<pre>[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install libgles2-sgx-img-dev</pre>
 +
 
 +
This is the OpenGL ES 2.0 development files required for compiling.
 +
 
 +
<pre>[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install opengles-sgx-img-common-dev</pre>
 +
 
 +
This installs the EGL library (used for portable context creation, see the docs) and PowerVR development files. It also includes some simple demos.
 +
 
 +
If you want OpenGL ES 1.x compatibility then install the following package in scratchbox:
 +
 
 +
<pre>[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install libgles1-sgx-img-dev</pre>
 +
 
 +
Now install the required libraries on the N900:
 +
 
 +
<pre>Nokia-N900-42-11:~# apt-get install libgles1-sgx-img libgles2-sgx-img opengles-sgx-img-common</pre>
 +
 
 +
 
 +
=== Qt Example ===
 +
 
 +
You need to install libqt4-opengl-dev:
 +
<pre>[sbox-FREMANTLE_ARMEL: ~] > fakeroot apt-get install libqt4-opengl-dev</pre>
 +
 
 +
It doesn't install any examples, so download the hellogl_es2 example from here:
 +
 
 +
: http://qt.gitorious.org/qt/qt/trees/4.5/examples/opengl/hellogl_es2
 +
 
 +
Moddify glwidget.h and change <code>#include <QGLWidget></code> to <code>#include <QtOpenGL/QGLWidget></code>.
 +
 
 +
Edit the hellogl_es2.pro and add:
 +
 
 +
<pre>LIBS += -lGLESv2 -lQtOpenGL</pre>
 +
 
 +
Then run:<pre>qmake -project
 +
qmake
 +
make
 +
</pre>
 +
 
 +
Which will (hopefully) compile hellogl_es2. Then you can copy the binary to the device and run it.
 +
 
 +
=== Xlib Examples ===
 +
 
 +
You can usually compile any Xlib example with a simple Makefile like:
 +
 
 +
CC=g++
 +
LDLIBS=-lEGL -lX11 -lGLESv2
 +
all: main
 +
main: main.o
 +
 
 +
In the PowerVR SDK TrainingCourse directory there are a number of examples. The first two use only Xlib. The rest make use of PowerVR libraries which have to be linked in with the program.
 +
 
 +
Here is a nice [[SimpleGL example | simple example]] (created by [http://talk.maemo.org/member.php?u=28583 exoticorn])
 +
 
 +
== Resources ==
 +
 
 +
Here are some useful resources.
 +
 
 +
*http://www.unrealvoodoo.org/hiteck/projects/maemo/ - Maemo Experiments
 +
*http://qt.gitorious.org/qt/qt/trees/4.5/examples/opengl/hellogl_es2 - hellogl_es2 example for Qt 4.5
 +
*[[OpenGL-ES]] - OpenGL ES page on the maemo wiki with useful information
 +
*http://www.imgtec.com/powervr/insider/sdk/KhronosOpenGLES2xSGX.asp - Khronos OpenGL ES 2.0 SDK has useful examples
 +
*http://talk.maemo.org/showthread.php?t=37356 - Thread discussing performance of OpenGL ES
 +
*[[Game_development]] - Page describing game development on Maemo. More oriented towards 2D games but has some useful information.
 +
*http://www.forum.nokia.com/info/sw.nokia.com/id/0ea5ec64-2d35-4363-94c0-dd2560c6524b/Get_started_with_Maemo_5.html - If you don't know how to start with Maemo development in general then look here.
 +
*http://repository.maemo.org/ - Information about repositories
 +
*http://www.khronos.org/opengles/sdk/docs/man/ - OpenGL ES 2.0 Reference Page
 +
*http://www.khronos.org/opengles/sdk/1.1/docs/man/ - OpenGL ES 1.1 Reference Page. It also has information about EGL.
 +
*http://n2.nabble.com/Fremantle-OpenGL-wrapper-td3013572.html - Thread discussing ideas about OpenGL and Maemo.

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)