The OpenGL graphics library compromises three main parts. The core part (gl.h, gl.lib and gl.dll), the utility part (glu.h, glu.lib and glu.dll) and the toolkit part which enable OpenGL to interact with the windows (glut.h, glut.lib and glut.dll). Normally, the first two parts are already installed on your windows machine by default. You need only to install the third part as explained below.
Download OpenGl utility tool kit (GLUT) from the internet. You can easily find it by searching "download glut for windows in Google". Here is a link for a new version of the utility:
http://www.xmission.com/~nate/glut.html.
Usually, there are two options: downloading the compiled binary files and download the source files, both in zipped files. In principle, we need the compiled binary files. Hence, we download the zipped file for the compiled glut named something like:
The above three files must be placed in their proper locations on your system. The glut32.dll should be put in the system32 folder under the window folder on your hard desk. The glut.h should be copied in the include folder of the visual c. To find this folder follow the path: C:\Program Files\Microsoft Visual Studio 9.0\VC\include. Of course, this will differ according to the version of visual studio, and your installation location. It’s preferred that you create a folder named GL in the include folder and copy glut.h there. The library files glut32.lib should be copied in the library folder (C:\Program Files\Microsoft Visual Studio 9.0\VC\lib). If you have not visual studio, the free Visual C++ express editions can go. : since the glut is unmanaged code, you should download the binary file that goes with your hardware. If you have hardware other than the familiar inter 64 systems you can find a version of the library for the hardware platform you use to run your windows on the web site: http://www.opengl.org/resources/libraries/glut/glut_downloads.php#windows. Note
system.
Download OpenGl utility tool kit (GLUT) from the internet. You can easily find it by searching "download glut for windows in Google". Here is a link for a new version of the utility:
http://www.xmission.com/~nate/glut.html.
Usually, there are two options: downloading the compiled binary files and download the source files, both in zipped files. In principle, we need the compiled binary files. Hence, we download the zipped file for the compiled glut named something like:
- Glut.h
- Glut32.lib
- Glut32.dll
The above three files must be placed in their proper locations on your system. The glut32.dll should be put in the system32 folder under the window folder on your hard desk. The glut.h should be copied in the include folder of the visual c. To find this folder follow the path: C:\Program Files\Microsoft Visual Studio 9.0\VC\include. Of course, this will differ according to the version of visual studio, and your installation location. It’s preferred that you create a folder named GL in the include folder and copy glut.h there. The library files glut32.lib should be copied in the library folder (C:\Program Files\Microsoft Visual Studio 9.0\VC\lib). If you have not visual studio, the free Visual C++ express editions can go. : since the glut is unmanaged code, you should download the binary file that goes with your hardware. If you have hardware other than the familiar inter 64 systems you can find a version of the library for the hardware platform you use to run your windows on the web site: http://www.opengl.org/resources/libraries/glut/glut_downloads.php#windows. Note
system.
After the preparation of your system, you can write graphics programs in visual studio by creating Visual C++ console programs and just include the glut.h file in the beginning of any source file that calls OpenGL but after the inclusion of the standard io library. Just use #include <GL/glut.h>.
This first page should be sufficient but more details are given below. Best wishes… Dr. Hamed Hemeda More detailed procedure for the installation (windows, Visual C++)
1. Download GLUT
2. Unzip the file.
3. Put the file "glut.h" into the standard Visual C++ include directory
4. Put the file "glut32.lib" into the standard Visual C++ library directory
5. Make sure your Visual C++ project links in the GLUT/gl/glu libraries. This is located in:
6. #include < GL/glut.h > in your program.
Writing graphics programs . You should install the latest graphics driver for your graphics card to get the most of the graphics This first page should be sufficient but more details are given below. Best wishes… Dr. Hamed Hemeda More detailed procedure for the installation (windows, Visual C++)
- a. Put the file "glut32.dll" into the system path.
- b. This can be in the same directory as your executable file.
- c. On Windows XP or earlier, this can be in "C:\WINDOWS\system32"
- d. Or you can create a directory like "C:\DLLs", put the file in this directory and change your system path to include this new directory.
- i. Do this by opening Control Panel -> System, clicking on "Advanced System Settings", followed by "Environment Variables", and editing the "Path" variable.
- a. (For Visual Studio 2010, this should be: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\gl")
- b. (For Visual Studio 2008, this should be: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\gl")
- c. (For Visual Studio 2005, this should be: "C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\Include\gl")
- d. You've got the right directory if you see a copy of "gl.h"
- a. (For Visual Studio 2010, this should be: "C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib")
- b. (For Visual Studio 2008, this should be: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib")
- c. (For Visual Studio 2005, this should be: "C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\lib")
- d. There should be lots of .lib files here, including "opengl32.lib" and "glu32.lib".
- a. Menu: "Project -> (your-project-name) Properties"
- b. Tab: "Configuration Properties -> Linker -> Input"
- c. Under "Additional Dependancies", add "glut32.lib glu32.lib opengl32.lib"
- a.
ليست هناك تعليقات:
إرسال تعليق