Before you begin

You should have a basic understanding of the C language and some experience running applications with the QNX Momentics IDE. Before starting this tutorial, you should have the following things ready:

  • The BlackBerry Native SDK for Tablet OS
  • Your BlackBerry PlayBook

Create your project

Since we don't really want to write all of the setup code from scratch, let's create a project using the BlackBerry Tablet OS OpenGL ES 1.1 Application Template Project. We want to use this template for two reasons. The first is that the main.c file comes with a bunch of boilerplate OpenGL ES code that we can borrow from. The second is that this template includes a file called bbutil.c. The bbutil.c file contains a whole bunch of convenient functions that you can call from your application - functions for performing common tasks like initializing and terminating EGL, loading and rendering text and textures, and changing the screen orientation.

  1. In the QNX Momentics IDE, click File > New > BlackBerry Tablet OS C/C++ Project.
  2. Provide a project name. Click Next.
  3. In the Project type section, click BlackBerry Tablet OS Open GL ES 1.1 Application Template Project. Click Finish.

After you 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: bbutil.c, bbutil.h, and main.c.

Configure your project

Your project in the QNX Momentics IDE requires some setup to get started with this tutorial:

  1. In the Project Explorer view, right-click your project and click Properties.
  2. In the left-hand navigation pane, click C/C++ Build > Settings.
  3. In the Tool Settings tab, click QCC Linker > Libraries.
  4. In the Libraries section, verify that the following entries exist and add any that are missing:
    • bps
    • screen
    • EGL
    • GLESv1_CM
    • m

This should be enough to get the project compiled and linked. If you run into issues, you can always check that the include paths for the project are correct by looking at the QCC Compiler, QCC Assembler, and QCC Linker items in the Tool Settings tab.