Set up your project
Before you begin
You should have the following things ready:
- The BlackBerry 10 Native SDK
- A BlackBerry 10 device or the BlackBerry 10 Device Simulator
Create a project
Because 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> template, where <version> is the version of OpenGL ES that 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 app. For example, bbutil.c contains 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 app. 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 for BlackBerry, on the File menu, click New > BlackBerry Project.
- In the Project Type section, select Application > Core Native and click Next.
- In the Templates section, select the version of OpenGL that you want to use. Click Next.
- In the Project Name field of the Basic Settings section, enter a name for your project (for example, MyProject). Click Next.
- In the API Level section, select the API level that you want to use and click Finish.
- If you're prompted to open the C/C++ perspective, click Yes.
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: 2015-03-31