Example program: example_glut_menu.c
CS-116A: Introduction to Computer Graphics
Instructor: Rob Bruce
Fall 2016

This program demonstrates how to create mouse-driven menus through the OpenGL Utility Toolkit (GLUT).

  • When the user clicks the left mouse button, a menu appears.
  • When the user's mouse hovers over that the menu item, a sub-menu is drawn.
  • When the user's mouse hovers over the submenu, one of three options is selectable.
  • When the user selects of the three options, that option is returned as an event to the program indicating what menu item was selected by the user.

The full source code for example_glut_menu.c is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_116a/example_glut_menu/example_glut_menu.c

A Makefile to build this code on your Linux solid state drives is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_116a/example_glut_menu/linux_makefile/Makefile (right mouse click then select "Save Link As..." to download)

A Makefile to build this code on Mac OSX is available at http://www.cs.sjsu.edu/~bruce/programs/fall_2016_cs_116a/example_glut_menu/osx_makefile/Makefile (right mouse click then select "Save Link As..." to download)

NOTE: Make sure you DO NOT call your Makefile Makefile.txt

Your Makefile should be called simply Makefile with NO EXTENSION.

At a terminal on the command line, enter "make" in the same directory where you downloaded example_glut_menu.c and Makefile.