Getting Started with OpenGL

We will be using the OpenGL, BLUT, and GLUI libraries in this class. Your book discusses OpenGL and GLUT, while GLUI is a very nice widget API that draws all of its controls using OpenGL calls.

This page is meant to help those who aren't exactly sure how to setup OpenGL/GLUI/GLUT on their own. For those of you who do know how, feel free to download GLUT/GLUI for yourself and compile them. Just make sure that when you hand in your assignments it runs on either the Windows or Linux (lab4) machines found in the CADE lab.

Online documentation for GLUT
Online documentation, source code, and makefile for GLUI

There are zip/tar files provided for each platform in the Windows/Linux sections below. But if you would like to get the individual files for yourself you can find them at the following download locations


Windows Lab (WEB 210)

These are the instructions on how to get the sample code running under the Windows XP Machines found in the Windows CADE Lab (WEB 210). Things may be slightly different if running on other Windows machines (although it SHOULD work fine).

Get a copy of the files
  1. Save the getting_started_win.zip file to your hard drive
  2. Double click on the .zip file
Create a Visual Studio Project
  1. Start MS Visual Studio 2005 or 2008
  2. NOTE: This next step is only applicable if you haven't yet opened Visual Studio this session
    Choose the "C++ Development Settings" & click "Start Visual Studio"
  3. Menu: "File->New->Project From Existing Code ..."
    1. What type of Project: Visual C+
    2. Click Next
    3. Set the "Project File Location:" to the getting_started folder using the Browse button
    4. Type the name of your project in "Project Name:"
    5. Unselect "Show all files in Solution Explorer"
    6. Click Next
    7. Set the "Project type:" to be Console application project
    8. Click Finish
Make sure the IDE knows where to find the header and include files
  1. Menu: "Project -> Properties..."
  2. Choose "Configuration Properties -> Linker"
  3. Choose "Configuration:" -> All Configurations
  4. On the right hand side "Additional Library Directories"
    1. "./lib"
  5. Click OK
Now you should be able to Build (F7) and run (F5) your project

For visual studio 2010

  1. Save the getting_started_win2010.rar file to your hard drive
  2. Double click on the .rar file


Linux Lab (WEB 224/226)

NOTE: These instructions (and the libglui.a library provided) will only work on the lab 1, 3 machines.

Get a copy of the files
  1. Save the getting_started_linux.tgz file to your hard drive
  2. unzip the tar file by typing "tar -xvzf getting_started.tgz" again without the quotes
Everything's set up, just compile the files
  1. Go to the getting_started directory you just untarred
  2. Type "make"
  3. Run the program by typing "./sample"
  4. The program should run

Others

For OS X

  1. Save the getting_started_mac.zip file to your hard drive
  2. Uncompress the getting_started_mac.zip file
  3. Open the project using Xcode
You will probably need to install the framework for GLUI too, something like in glui-235-framework-for-mac-os-x


For OS X and Linux

This is a new getting started file with some additional useful code.

  1. Save the getting_started_linux_mac.tar.gz file to your hard drive
  2. Uncompress the file
  3. The project should work on Linux on the terminal, on OSX through the make file and the Xcode project
You will probably need to install the framework for GLUI too, something like in glui-235-framework-for-mac-os-x for osx.


For OS X and Linux - Shaders

This is a new getting started file for glsl.

  1. Save the getting_started_shaders.tar.gz file to your hard drive
  2. Uncompress the file
  3. The project should work on Linux on the terminal, on OSX through the make file and the Xcode project
  4. Bug notice: when using XCode, the reload shaders is not working. Running from the terminal for linux and OSX should have this working
You will probably need to install the framework for GLUI too, something like in glui-235-framework-for-mac-os-x for osx.