1 how to install opengl u software running under microsoft windows makes extensive use of...

10
1 How to Install OpenGL How to Install OpenGL Software running under Microsoft Software running under Microsoft Windows makes extensive use of "dynamic Windows makes extensive use of "dynamic link libraries." A dynamic link library link libraries." A dynamic link library (DLL) is a set of executable code that (DLL) is a set of executable code that has the following properties: has the following properties: the code is loaded at run time only the code is loaded at run time only when it is actually needed when it is actually needed (dynamically linked) (dynamically linked) it is group of functions for it is group of functions for accomplishing common tasks (a library) accomplishing common tasks (a library)

Upload: justina-eaton

Post on 21-Jan-2016

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

1

How to Install OpenGLHow to Install OpenGL

Software running under Microsoft Windows Software running under Microsoft Windows makes extensive use of "dynamic link makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a libraries." A dynamic link library (DLL) is a set of executable code that has the set of executable code that has the following properties:following properties: – the code is loaded at run time only when the code is loaded at run time only when

it is actually needed (dynamically linked) it is actually needed (dynamically linked) – it is group of functions for accomplishing it is group of functions for accomplishing

common tasks (a library) common tasks (a library)

Page 2: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

2

How to Install OpenGLHow to Install OpenGL

To create code that uses DLL's, you To create code that uses DLL's, you typically need 3 types of software: typically need 3 types of software: – header files (*.h) header files (*.h)

these files contain data type definitions these files contain data type definitions and function prototypes that allow your and function prototypes that allow your code to be code to be compiledcompiled correctly. correctly.

They are text files that you can read and They are text files that you can read and study to get a better understand of how study to get a better understand of how the software works. the software works.

Page 3: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

3

How to Install OpenGLHow to Install OpenGL

– library files (*.lib) library files (*.lib) these files typically contain function these files typically contain function

"stubs" that know how to invoke "stubs" that know how to invoke appropriate DLL functions at run time. appropriate DLL functions at run time.

these files are used at these files are used at linklink time to create time to create your executable file. your executable file.

– DLL files (*.dll) DLL files (*.dll) these files contain the actual executable these files contain the actual executable

library code. library code. these files are invoked at these files are invoked at runrun time. time.

Page 4: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

4

Installation ProcedureInstallation Procedure

Step 1: Download the software Step 1: Download the software Step 2: Unarchive the files:Step 2: Unarchive the files:

–   Unzip the archive file: OpenglSoftware.zip Unzip the archive file: OpenglSoftware.zip Step 3: Copy the Dynamic Link Libraries Step 3: Copy the Dynamic Link Libraries

(DLL) Files to the Operating System Folder(DLL) Files to the Operating System Folder:: Copy the files Copy the files – Opengl32.dll Opengl32.dll – Glu32.dll Glu32.dll – glut32.dll glut32.dll – to the folder to the folder C:\Windows\SystemC:\Windows\System. . NoteNote: The : The

first two DLL's may already be there. If it first two DLL's may already be there. If it prompts you that the file already exists, select prompts you that the file already exists, select the option that chooses the file with the most the option that chooses the file with the most recent date.recent date.

Page 5: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

5

Installation ProcedureInstallation Procedure

Step 4: Copy the OpenGL Header Files to the Step 4: Copy the OpenGL Header Files to the Compiler Folders:Compiler Folders: Go to the "include" folder of Go to the "include" folder of your compiler. your compiler.         For Visual C++, this folder is         For Visual C++, this folder is C:\Program Files\Microsoft Visual Studio\Vc98\C:\Program Files\Microsoft Visual Studio\Vc98\IncludeInclude Create a new subfolder called "GL" in this folder Create a new subfolder called "GL" in this folder         (if the folder already exists, do nothing)         (if the folder already exists, do nothing) Copy the following files into the "GL" folder: Copy the following files into the "GL" folder: – Gl.h Gl.h – Glu.h Glu.h – glut.h glut.h

NoteNote: The first two .h files may already be there. : The first two .h files may already be there. If it prompts you that the file already exists, select If it prompts you that the file already exists, select the option that chooses the file with the most the option that chooses the file with the most recent date. recent date.

Page 6: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

6

Installation ProcedureInstallation Procedure

Step 5: Copy the OpenGL Library Files to Step 5: Copy the OpenGL Library Files to the Compiler Folders:the Compiler Folders: Go to the "Library" Go to the "Library" folder of your compiler. folder of your compiler.         For Visual C++, this is the folder         For Visual C++, this is the folder   C:\Program Files\Microsoft Visual Studio\C:\Program Files\Microsoft Visual Studio\Vc98\LibVc98\Lib Create a new subfolder called "OpenGL" in Create a new subfolder called "OpenGL" in this folder. this folder. Copy the following files into this subfolder: Copy the following files into this subfolder: – OpenGl32.lib OpenGl32.lib – Glu32.lib Glu32.lib – glut32.lib  glut32.lib 

Page 7: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

7

OpenGL in Visual C++OpenGL in Visual C++

Step 1:Step 1: Create a personal folder (directory) on the Create a personal folder (directory) on the C: hardrive to save your work. C: hardrive to save your work.

Step 2Step 2:: Launch Microsoft Visual Studio, Visual C++ Launch Microsoft Visual Studio, Visual C++ Step 3Step 3:: Create a new project: Create a new project:

– Under the "File" menu; execute the "New" command.  Under the "File" menu; execute the "New" command.  – Select the project type as "Win32 Console Application" Select the project type as "Win32 Console Application"

If you do not see this as an option, you are not in the If you do not see this as an option, you are not in the "projects folder." Select the "Project" tab at the top of "projects folder." Select the "Project" tab at the top of the window. the window.

– Type a project name into the edit box. For example: Type a project name into the edit box. For example: Lab01  Lab01 

– Change the location of the project to your personal Change the location of the project to your personal folder/directory.  folder/directory. 

Note: Note: NeverNever save your work under the Visual C++ save your work under the Visual C++ folders hierarchy. folders hierarchy.

– Select the "OK" button. Select the "OK" button. – Select the "An empty project" radio button; then select Select the "An empty project" radio button; then select

the "Finish" button. the "Finish" button. – Select "OK" on the next window. Select "OK" on the next window.

Page 8: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

8

OpenGL in Visual C++OpenGL in Visual C++

Step 4:Step 4: Add source code files to the project Add source code files to the project – If the files already exist If the files already exist

Use "Project" menu: select "Add to Project" Use "Project" menu: select "Add to Project" command: "Add files" command. command: "Add files" command.

Select one or more appropriate files Select one or more appropriate files Select "OK" Select "OK"

– To create new files To create new files Use the "File" menu: select "New" command: Use the "File" menu: select "New" command:

select the appropriate type of file select the appropriate type of file Enter and edit your text as needed. Enter and edit your text as needed. Save your work Save your work Use "Project" menu: select "Add to Project" Use "Project" menu: select "Add to Project"

command: "Add files" command. command: "Add files" command. Select one or more appropriate files Select one or more appropriate files Select "OK" Select "OK"

Page 9: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

9

OpenGL in Visual C++OpenGL in Visual C++

Step 5: Add the OpenGL library files to the Step 5: Add the OpenGL library files to the project as in step 4.project as in step 4. – Use "Project" menu: select "Add to Project" Use "Project" menu: select "Add to Project"

command: "Add files" command. command: "Add files" command. – Change to the folder that contains the library Change to the folder that contains the library

files; in the UPM labs, this will be the folder ? files; in the UPM labs, this will be the folder ? – If you do not see the files appear, it is probably If you do not see the files appear, it is probably

due to the wrong "file type filter"; change the due to the wrong "file type filter"; change the filter to filter to *.lib*.lib. .

– Select the following 3 libraries Select the following 3 libraries OpenGl32.lib OpenGl32.lib Glu32.lib Glu32.lib glut32.lib glut32.lib

– Select "OK" Select "OK"

Page 10: 1 How to Install OpenGL u Software running under Microsoft Windows makes extensive use of "dynamic link libraries." A dynamic link library (DLL) is a set

10

OpenGL in Visual C++OpenGL in Visual C++

Step 6: Execute the programStep 6: Execute the program – To compile the currently open file:    To compile the currently open file:   

Use "Build" menu; select "Compile" command Use "Build" menu; select "Compile" command – To compile and link:To compile and link:

  Use "Build" menu; select "Build" command Use "Build" menu; select "Build" command – To compile, link, and execute:         To compile, link, and execute:        

Use "Build" menu; select "Execute" command Use "Build" menu; select "Execute" command