Create an OpenGL window

In this tutorial, we'll show you how to create a window that you can use with OpenGL ES. When you create a new project in the QNX Momentics IDE and choose the BlackBerry Tablet OS OpenGL ES 1.1 Application Template Project, the result is an OpenGL ES application that displays a multicolored square on the screen. Most of the code in the application is devoted to setting up an OpenGL ready window, so this tutorial is mostly a walkthrough of that template (and the files main.c and bbutil.c). But we've removed the code to draw the multicolored square so we can focus on just the required setup code.

The ready window would look like this when the application is minimized:

Device image showing an OpenGL sample window.

You will learn to

  • Create a native window
  • Initialize and bind EGL to the native window
  • Draw graphics using OpenGL ES
  • Clean up graphics once you're done