You are on page 1of 2

TMT2033 Introduction to Computer Graphics Sem 2 09/10

TMC2033 Introduction to Computer Graphics


Lab 1: Introduction to OpenGL
1.0 Installing OpenGL
1. Make sure Microsoft Visual C++ 6.0 is installed on your machine.
2. Download the latest version of Graphics Library Utility Toolkit (GLUT).
3. Extract the compressed folder. Make sure that there are 5 files in the extracted folder: glut.txt,
glut32.lib, glut32.dll, glut.h and README-win32.txt.
4. Copy glut32.dll to the c:\WINDOWS\system.
5. Copy glut.h to c:\Program Files\Microsoft Visual Studio\Include\GL.
6. Copy glut32.lib to c:\Program Files\Microsoft Visual Studio\VC98\Lib.
2.0 Writing an OpenGL Program
1. Begin Microsoft Visual C++ 6.0.
2. Click on File on the menu bar and select New.
3. Select Win32 Console Application from the list in the Projects tab.
4. Name your project in the Project name textbox.
5. Click on the Browse button beside the Location textbox to select the directory where you are
going to store your project.
6. Click on the OK button to proceed. A window named Win32 Console Application Step 1 of 1
will appear.
7. Select the radio button for An empty project and click on the Finish button.
8. A window named New Project Information will appear next. Click on the OK button.
9. Click on Project on the menu bar and select Settings. A window name Project Settings will
appear.
10. Go to the C/C++ tab and click on the checkbox for Generate Browse Info.
11. Next, go to the Link tab. Type glut32.lib into the textbox for Object/library modules. Then, click
on the OK button.
12. Click on File on the menu bar and select New. Under the Files tab, select C++ Source File. Give a
name to your file and click on the OK button.
13. You can now begin to write your OpenGL program.

TMT2033 Introduction to Computer Graphics Sem 2 09/10


3.0 A Simple OpenGL Program
1. Code the following program in Microsoft Visual C++ 6.0:

2. What is the output of the program?

You might also like