Sie sind auf Seite 1von 3

Installation/verification: OpenGL comes with the OS and Visual Studio 2010/2008 installations, to verify:

runtime libraries:

on 64-bit Windows:

header files:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\GL\{GL,GLU}.h ["Program Files (x86)" for 64-bit Windows; VS2008: v6.0A]

linker library:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\OpenGL32.Lib ["Program Files (x86)" for 64-bit Windows; VS2008: v6.0A]

If GLUT is not installed, you can install it by downloading the glut zip file (v. 3.7.6) (web site) and copying its files to the correct folders as follows:

runtime library:

header file:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\GL\glut.h ["Program Files (x86)" for 64-bit Windows; VS2008: v6.0A]

linker library:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib\glut32.lib ["Program Files (x86)" for 64-bit Windows; VS2008: v6.0A]

(Alternatively, some installation put the GLUT dll in the same directory as the OpenGL/GLU dlls and the header and linker library files under "C:\Program Files\Microsoft Visual Studio 9.0\VC\" ("Program Files (x86)" for 64-bit Windows).) Or you may choose to install freeglut for Windows. Later in your OpenGL source files, include the following line:
#include <GL/glut.h>

You don't need to include gl.h and glu.h, as they are already included in glut.h. For an example, see the provided sample source code. Command line make: see the instructions for Cygwin below. Visual Studio 2010/2008 project (graphical step-by-step, all the screen shots are from VS2008, but are applicable to VS2010):

Create a new project: o Select "FileNewProject" (Fig. 26) o Choose a template for your new project: "Visual C++Win32Win32 Console Application", give the project a name, e.g., "sampleapp" and click "OK" (Fig. 27) o On the "Welcome to the Win32 Application Wizard" page, click "Next >" (Fig. 28) o On the "Application Setting" dialog box, under "Additional options" tick "Empty project", then click "Finish" (Fig. 29) Add source files:

Right click on "sampleapp" on the second line of the "Solution Explorer" pane on the left to "AddExisting Item" (Fig. 30), select your file, for example, the provided sample.c, and click "Add"

Add libraries: o Right click on "sampleapp" again and select "Properties" to tell the linker which libraries need to be added (Fig. 31) o On the "Property Pages", under "Configuration:" tell VS to add the additional libraries to "All Configurations" (Fig. 32) o Select "Configuration PropertiesLinkerInput" on the left pane, and enter:

[VS2008: with spaces in place of the semicolons] as "Additional Dependencies" on the top of the right pane, hit RETURN and then click "Apply" (Fig. 33)

Optional: To prevent your program from opening a console window, while still on the "Property Pages", select "Configuration PropertiesLinkerCommand Line" on the left pane, and enter:

as "Additional options" at the bottom of the right pane, then click "Apply" (Fig. 34) You may not want to disable the console window if you print out messages to the console (see next step).

Close the "Property Pages" pane by clicking "Ok", then click on the play button on the second menu bar ( ) to build and run the program. If you print out messages to the console, run the program using Ctl-F5 instead, to keep the cmd window from exiting after the program exits. To distribute your program, include glut32.dll with your distribution as it's most likely not installed on most Windows systems.

.3 Menginstall OpenGL : 1. Install terlebih dahulu Microsoft Visual C++ 2. Ada beberapa file yang perlu didownload untuk penambahan di Visual C++ diantaranya : * glut.h * glut32.dll * glut32.lib Setelah persiapan selesai kalian bisa mengikuti tutorial instal OpenGL: 1. Copy file glut.h ke direktori C:\Program Files\Microsoft Visual Studio 9.0\VC \include\GL (Tapi anda harus membuat folder terlebih dahulu yang bernama GL). 2. Copy file glut32.lib ke C:\Program Files\Microsoft Visual Studio 9.0\VC\lib 3. Copy file glut32.dll ke C:\WINDOWS\system32 4. Setelah file-file tadi sudah dicopy ke tempatnya masing-masing, untuk menggunakan library OpenGL pada sebuah project maka harus mengimport library glut dengan cara menyisipkan syntax #include GL/glut.h 5. Setelah itu, barulah kita bisa mengetikkan perintah-perintah / syntax OpenGL.