Download presentation
Presentation is loading. Please wait.
1
OpenGL project setup
2
How to use it? The included files and linked library files are already set in every project. These three files, which includes glut.h, glut32.lib, and glut32.dll, are shared by all projects. Each project contains an example code. The solution file (OpenGL.sln) contains all the projects. You can open the solution file by VC.
3
Setup for Working Directory 1/3
Select your project. Click “Set as StartUp Project”.
4
Setup for Working Directory 2/3
Click “Properties”.
5
Setup for Working Directory 3/3
Change Working Directory. Such as “$(SolutionDir)dll”($(SolutionDir) is a macro). Set your working directory as the folder with glut32.dll.
6
For Visual Studio 2012+ If your project still cannot find the dll, you should do following step. You need to set the PATH. Debugging => Environment Enter the following PATH=$(LocalDebuggerWorkingDirectory) Now your program can find the dll files in your working directory.
7
What is Macro? Macro is like a nickname of the folder’s path.
Visual Studio has made hundreds of macros available to you. Such as ”$(SolutionDir) ”, it is the path of your .sln. You can find them in Property Pages dialog box. You can make your own macro, too.
8
What is “Working Directory”?
It is the directory where your program is executed. The default value is the directory of project. (Neither the Debug directory nor Release directory) Because the dll files can be shared by all projects, setting the working directory is better than placing redundant copy in each project directory.
9
Why it must be set? The setting of included files and linked files are stored in project file. (*.vcproj) However, the “Working Directory” is not! It is stored in user files, such as (*.user). When the project is moved to another computer, the setting of user files is inactive. Because the user file only works on its original computer, you must set it again.
10
How to set a whole new project?
Put these 3 files in your project directory. glut.h (Include it!) glut32.lib (Link it!) glut32.dll (Execute with it!)
11
Setup for a OpenGL Program 1/8
Microsoft Visual C New Blank Project.
12
Setup for a OpenGL Program 2/8
Empty Project.
13
Setup for a OpenGL Program 3/8
Add code files, such as main.cpp.
14
Setup for a OpenGL Program 4/8
Set properties.
15
Setup for a OpenGL Program 5/8
Set properties.
16
Setup for a OpenGL Program 6/8
Set link to the location of the lib file.
17
Setup for a OpenGL Program 7/8
Set link input, add the glut32.lib.
18
Setup for a OpenGL Program 8/8
Change Working Directory.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.