by Jim X. Chen: Professor Jim X. Chen Department of Computer Science George Mason University Fairfax, VA 22030
by Jim X. Chen: COMMENTS System: OpenGL (Mesa) ST2 SITE computing labs (SunOpenGL or Mesa) ST1 CSI computing labs (SGI OpenGL) Computer Graphics Lab (PWC) You must set up your system before next class. Please check out the syllabus and updates at: OpenGL on Windows 95, 98, or NT (Recommended) 2
by Jim X. Chen: On Windows 95, 98, NT system, or Download OpenGL library (Win95 only): Or ftp://ftp.microsoft.com/softlib/mslfiles/opengl95.exeftp://ftp.microsoft.com/softlib/mslfiles/opengl95.exe Or opengl95.exe contains opengl32.dll needed to run OpenGL programs under Win95. Windows 98/NT4/2000 come with OpenGL already. Download GLUT GUI library: Or to download precompiled glutdlls.zip for Windows 9x/NT/2000.
by Jim X. Chen: 4 1. OpenGL/Glut Configuration Tutorial 1. OpenGL/Glut Configuration Tutorial On Visual C++ I assume you have Microsoft Visual C++ and Windows95 and Visual C++ has been installed to the default directory, c:\msdev (For your system, you may start ‘find’ tool to find a VC++ file like gl.h, and then determine the default directory for your system.) A. Install OpenGL and Glut Create a temporary directory and extract the glutdlls.zip there. Copy all *.h files to c:\msdev\include\gl; all *.lib files to c:\msdev\lib; and all *.dll files to c:\windows\system. Check opengl32.dll in c:\windows\system. If it does not exist, do the following: Create a temporary directory; Move opengl95.exe file into this directory; Run opengl95.exe, which will create a bunch of files in the current directory; Copy all *.dll files to c:\windows\system. You are now ready to enter the fun and exciting world of OpenGL and Glut programming!
by Jim X. Chen: 5 B. Set OpenGL or Glut in Visual C++: First, make sure that you've included all the necessary *.h files in your program. You need for Glut; or and, and possibly and/or for OpenGL. You need to let Visual C++ know that you want it to consult all the necessary libraries. To do this, you first need to choose Settings under the Project or Build menu item. The Settings button will appear after you compile your program once.
by Jim X. Chen: 6 A Project Settings dialog box will now pop up. You now need to select the Link tab. Unfortunately, the Link tab may be hidden. Click the half-a-tab circled below...
by Jim X. Chen: 7...and the Link page will magically appear:
by Jim X. Chen: 8 The Object/library modules section of this page which you should be interested in is circled in red above. Scroll to the end of this line and add the necessary *.lib files to the list. There are four libraries that you might need to add: opengl32.lib, glu32.lib, glaux.lib, and glut32.lib. Since it doesn't hurt much to have extra libs listed, I suggest you add all of them.
by Jim X. Chen: 9 C. Compile and run the following program Source code examples can be downloaded from ftp://ftp.sgi.com/opengl/opengl12.zip Or /* Example 1.1.point.c: draw multiple randomly generated points */ // by Jim X. Chen; September 2000 Points Points.c
by Jim X. Chen: OpenGL/Glut Tutorial 2. OpenGL/Glut Tutorial On Borland C++ Please visit web site for detail:
by Jim X. Chen: On SGI Workstations (ST Rm228 and Graphics Lab.) 11 The system administrator should have OpenGL library installed. Check this with your system administrator Download GLUT GUI library for SGI: Go to web site: Get GLUT documents from the same place Following the instructions to compile and configure GLUT on your system GLUT Online help: Sample code: ftp://ftp.sgi.com/opengl/opengl12.tar.Zftp://ftp.sgi.com/opengl/opengl12.tar.Z
by Jim X. Chen: On SUN Workstations (ST2 SITE Lab.) 12 First we'll create directories for AUX and then copy AUX files from system directories. (Here we use aux GUI library) mkdir $HOME/OpenGL mkdir $HOME/OpenGL/aux mkdir $HOME/OpenGL/aux/examples mkdir $HOME/OpenGL/aux/libaux mkdir $HOME/OpenGL/aux/libtk cd /usr/openwin/share/src/GL/contrib/utils/aux cp./aux/examples $HOME/OpenGL/aux/examples cp./aux/libaux $HOME/OpenGL/aux/libaux cp./aux/libtk $HOME/OpenGL/aux/libtk OR just run the following command: cp -r ~xwang1/OpenGL $HOME/OpenGL
by Jim X. Chen: 13 Reference web site: / After that, you have your environment ready. Now you can compile and run some example program. First change to the examples directory under your account by: cd $HOME/OpenGL/aux/examples then compile an example program (movelight.c) by make movelight finnally, run ‘movelight’, and you will see the result.