Tutorial: 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 Momentics IDE for BlackBerry and choose the OpenGL ES 1.1 or 2.0 project template, 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 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 window looks 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

Last modified: 2013-12-21

comments powered by Disqus