Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Graphics Lab 1 OpenGL.

Similar presentations


Presentation on theme: "Computer Graphics Lab 1 OpenGL."— Presentation transcript:

1 Computer Graphics Lab 1 OpenGL

2 What is OpenGL?

3 What is OpenGL? OpenGL is a software interface to graphics
hardware. You can use to specify the objects and operations needed to produce interactive three-dimensional applications OpenGL is designed as a hardware-independent interface to be implemented on many different hardware platforms.

4 OpenGL The most popular raster graphics library, providing a powerful but primitive set of rendering commands Already supported by every window systems OpenGL Utility Library (GLU) : higher-level routines, part of OpenGL implementation Setting up matrices for specific viewing orientations and projections Performing polygon tessellation and rendering surfaces OpenGL Utility Toolkit (GLUT): window –system-independent high-level library. Need to install this library separately.

5 OpenGL Install OpenGL Utility Toolkit (GLUT) for MS Windows
Download GLUT from Unzip the package Set “include directory” and “lib directory” in the C++ Compiler to include the directory containing glut.h, glut.lib Copy glut32.dll into directory DRIVE:\WINNT\SYSTEM Add #include <glut.h> to the beginning of the program

6 OpenGL OpenGL Programming Guide: Nate Robins’ OpenGL Tutors
60/openGL/install/theredbook.zip Nate Robins’ OpenGL Tutors

7 If you are using a PC, OpenGL is included with all versions of Windows
If you are using a PC, OpenGL is included with all versions of Windows. You will have to get GLUT from the web. For windows you can download just the dll, lib and .h files. You should find OpenGL32.dll and glu32.dll with your system files. You should find the corresponding lib and .h files supplied with your compiler. The corresponding GLUT files should be placed with them.

8 OpenGL how to install the glut libraries and dll's ? glut.dll
glut.h glut.lib glut32.lib

9 Files: .h, .lib, .dll The entire folder gl is placed in the Include directory of Visual C++ The individual lib files are placed in the lib directory of Visual C++ The individual dll files are placed in C:\Windows\System32

10 3. Copy your glut.lib and glut32.lib to:
Copy both glut.dll and glut32.dll into your windows directory (WINDOWS , or WINDOWS \System32) Copy your glut.h to: <drive>:\<VC++ path>\include\GL\glut.h *** put the drive where you installed VC++ instead of the <drive> *** *** put the directory where you installed VC++ instead of the <VC++ path> 3. Copy your glut.lib and glut32.lib to: <drive>:\<VC++ path>\lib\glut.lib <drive>:\<VC++ path>\lib\glut32.lib

11 how to setup VC++ so that you can use the glut libraries?
Start VC++ and create a new project. 2. The project has to be a "Win32 Console Application" 3. Type in the name of the project and where it will be on your hard drive. 4. Chose an empty project and click next or finish 5. First thing you need to do when the project opens up is to click on the "Project" menu item from the top. 6. Chose "Settings" (a window will come up) 7. On the left side of the window there are tabs, chose the "Link" tab 8. The string field labeled "Object/library modules" has a few lib files already set in it 9. Go to the end of this string field and enter: opengl32.lib glut32.lib glu32.lib 10. Chose "OK" and that will include all the opengl libraries that you need 11. Now all you need to do is include <gl\glut.h> and you are ready to go

12

13 Example


Download ppt "Computer Graphics Lab 1 OpenGL."

Similar presentations


Ads by Google