Before you begin
You should have the following things ready:
- The BlackBerry 10 Native SDK
- Your BlackBerry 10 device or the BlackBerry 10 Device Simulator
- A basic understanding of the C language and some experience running applications using the Native SDK
Create your project
Since we don't want to write all of the setup code from scratch, let's create a project using the BlackBerry 10 OS OpenGL ES <version> Application Template Project, where <version> is the version of OpenGL ES you want to use. One advantage of using the template is that the main.c file comes with a bunch of boilerplate OpenGL ES code that we can borrow from. The template also includes a file called bbutil.c, which contains a set of convenient functions that you can call from your application (for example, functions for performing common tasks such as initializing and terminating EGL, loading and rendering text and textures, and changing the screen orientation). For more information about the functions in bbutil.c, see Functions in the bbutil API.
This project template also includes several libraries that add capabilities to the application. You can view the included libraries by looking at the C/C++ build settings under the project properties. To create a project using this template, complete the following:
- In the Momentics IDE, click File > New > BlackBerry Project.
- In the Project Type section, select Core Native. Click Next.
- In the Templates section, select the version of OpenGL that you want to use. Click Next.
- In the Basic Settings section, enter a name for your project (for example, "MyProject") in the text box at the top. Click Next.
- In the API Level section, select the API level that you want to use.
- Click Finish.
A new project appears in the Project Explorer view. If you expand the project, you'll notice that it contains three source files in the src folder: bbutil.c, bbutil.h, and main.c. These files contain the fundamental code for our app.
Last modified: 2013-12-21