AppDevOpenGL ES
From NRCwikis
Contents |
Requirements
Sample OpenGL ES Project (EGTriangle)
- Part of Eurographics 2006 Course on Developing Mobile 3D Applications
- Instructions
- Download the project file EGTriangle.tar.gz
- Follow the instruction in the readme.txt file or look at course notes
- For project description (and installation instructions) see pages 45-92 of the course notes
OpenGL ES Examples in S60 SDK
- The examples are included as part of the S60 SDK. The default installation directory is: C:\Symbian\9.2\S60_3rd_FP1\S60Ex\OpenGLEx
- Unfortunately, the examples were not set up to work directly with Carbide.c++, so there is some extra work needed to build the .sis file. In essence, the .pkg file, which is used to build the .sis file, uses relative paths that Carbide does not parse correctly. The local paths will have to be changed to reflect the global location of the files. (See the definition of the .sis and the .pkg files at the bottom of this page.)
- Below we describe how to compile and run one of the examples using Carbide.c++
Importing the Project
- Create a workspace called C:\Symbian\Carbide\OpenGLExWorkspace
- Import the project called BumpMap using File->Import->Symbian Bld.Inf wizard
- Browse to the project definition file OpenGLEx\BumpMap\group\bld.inf
- Make sure that "Copy source files into workspace" is unchecked. (This results in the workspace creating links to the original project files, instead of making a local copy. Unfortunately, if you decide to make a local copy of the files, this leaves certain files uncopied. In order to build the .sis file this way, you would have to compare the two directory structures and include the missing files separtely using Import->File command.)
- Select the following build configurations
- S60 3.1 Emulator Debug
- S60 3.1 Phone (GCCE) Debug
- S60 3.1 Phone (GCCE) Release
Compiling the Project
- Set active build configuration to "S60 3.1 Emulator Debug" using the Project menu
- Build the project by selecting Project->Build Project
- Run the executable by selecting Run->Run Bumpmap
- This will automatically launch the S60 emulator. (It takes some 15 seconds for the device emulator to boot, so be patient.)
- Click on the Menu button and navigate to the directory called Installed
- Launch the application called Bumpmap
- Set active build configuration to "S60 3.1 Phone (GCCE) Debug" using the Project menu
- Build the project by selecting Project->Build Project
- It will first compile the project and create an executable called BumpMap.exe
- It will next try to build .sis file based on what is .pkg and fail
- Next we explain how to change the .pkg file to fix the problem
Building the .sis file
- Open in an editor the file called OpenGLEx\BumpMap\sis\bumpmap_gcce.pkg. Follow this link to see the original package file
- Make the following changes to the file:
- Replace all instances of "..\..\..\..\epoc32" with "$(EPOCROOT)epoc32"
- Comment out the line containing bumpmap_icon.mif. (The project is not set up to produce the .mif file, so we are simply going to use the default one.)
- Comment out the line containing backup_registration.xml.
- Open in an editor the file called OpenGLEx\BumpMap\group\bld.inf. Below the command PRJ_EXPORTS is a list of files exported by the application. The second argument on each line shows the location where the file will be exported. Follow this link to see the original build file.
- Change the lines in the .pkg file corresponding to the exported files (firefly.jpg, bumpmap.jpg, texmap.jpg) to reflect the export locations specified in the bld.inf file
- Follow this link to see the final package file.
- Build the project by selecting Project->Build Project
Testing the Application on a Phone
- Install the executable on your S60 phone by double clicking on the Bumpmap_gcce.sis file in the "C/C++ Projects" window. (This assumes that the cell phone is connected to the PC either through Bluetooth, or a USB cable.)
Useful Concepts/Definitions
- An installation (.sis) file is, in essence, a file that compresses the files (such as, .dll, .exe, .rss) included in an application and lists all the needed information (such as language, unique application ID) that the real device needs when receiving an application.
- A package (.pkg) file is a text file containing statements that define the information required by the installation .sis file creation utility, MakeSIS.
