Simple 2D GL Example

Written by Paul Bourke
May 1996


This is a VERY crude and simple example on how to use GL to create a window, form some menu items, draw some 2D graphics primitives, and respond to keys or menu choices from the user. It should not be considered as the approach to take for "significant" projects but rather as a first introduction to native GL. It is a useful approach to take for quick utilities that require some simple graphical output and user interaction.

The C source code that generates the above window. This source is written in what is hoped is a straightforward style without unnecessary complications.