Assignment 0
Introduction to GLUT and FLTK
This assignment is a simple introduction to the use of the GL Utility ToolKit (GLUT) and the Fast/Lite ToolKit
(FLTK, pronounced "Full-Tick"). The idea is to get you accustomed to the program structure and libraries you will
use for the rest of your
assignments in this class. It should be fairly uninvolved work-wise, but may involve some tricky compiler/library
voodoo to get working perfectly, especially if you are trying to install it on your home system. If you run into any
problems, please don't hesitate to e-mail the TA -- he is your friend. It
is critical you get
this framework to work and understand it fairly well, as all remaining assignments will be based upon it.
You will need to download the source and project files here.
The assignment consists of two (or three) parts:
Part 0: Installing GLUT and FLTK
(Only applicable if you are installing on your own machine. This should be already done on all the machines in
OLS 002a)
First, you will need to acquire the archives for GLUT (available here) and FLTK
(available here). Each should contain a directory of libraries (.lib files),
includes (.h files), and binaries (.exe or .dll files). Place the LIB and INCLUDE directories from the archives
somewhere in your build path (the default for Visual Studio .NET is "c:\program files\Microsoft Visual Studio
.NET\vc7"), and the DLLs in your executable path (one such location being "c:\windows\system32"). In the FLTK
archive, there is also a program called "Fluid.exe". This program allows you to edit and export the FLTK
configuration files, and so you should put it somewhere you can have easy access to.
Part 1: Basic GLUT
Once you have downloaded the project file for Assignment 0, open it up and select "Part 1" as your active project.
Open "part1.cpp" and read through the code. It is a very typical and straight-forward GLUT application, and should
be documented well enough for you to easily follow what it is doing at each part. Once you have finished reading
through it, and feel you have a good understanding of how it works, compile it and run the program.
Part 2: Basic FLTK
Now, select "Part 2" as your active project. This program is virtually the same as Part 1, except that now the GLUT
frame is embedded within a FLTK window manager object. The only real changes in source code are in the main function
(where the CFLTKGui object is created) and in the includes (some of the constants have been moved to a new file
called "main.h"). Compile and run the program. Now, you should see a similar window as before, except that it is
embedded within a FLTK control panel. One button has been implemented; its job is to quit the program when pressed.
In the directory containing Part 2, there is an executable named "fluid.exe". Run it, and open the file named
"gui.fl". This file is the FLUID definition file for this GUI interface. FLUID allows you to visually define this
interface file, and then export it to source code to be included in the project. Once this source is exported, the
project is simply recompiled and the changes take effect.
Look through the various items and options, and familiarize yourself with the tools available. You can see details
on any item in the code view by simply double-clicking on them. Pay special attention to how the "Quit" button is
implemented.
Your task for part 2 is to implement buttons that toggle the lighting, wireframe, and animation
just as implemented in Part 1. You may use the already implemented Quit button as a model, though you are
encouraged to experiment with the framework and implement these functions using any other logical
widgets (radio buttons or check boxes), or to extend the program (such as adding a slider to control the
rotation speed) as well. All of these tools will be required in later projects.