[출처] http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/glut/
Using OpenGL & GLUT in Code::Blocks
Download Code::Blocks
http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/
Download the GLUT bin file (first download link) from:
http://www.xmission.com/~nate/glut.html
- After you download and open the GLUT bin zip file, you will need to:
- Copy glut32.dll to c:\windows\system,
- Copy glut32.lib to c:\program files\mingw\lib, and
- Copy glut.h to c:\program files\mingw\include\GL.
- These are default locations, your paths may be different. But basically, you place the .lib and .h files in the location of your compiler (in this case mingw). The .dll file goes in the windows system directory.
Now you are ready to start Code::Blocks and make a new project.
Open up Code::Blocks. Start a new Project by going to File, New, Project.
Select to make a new GLUT project and press Go to continue.
Press Next at this menu
Give a project title, and a location where to create the project and then press Next.
Let Code::Blocks know where you stored your GL files, then press Next.
Leave these unchanged, and press Finish.
In the manager window (viewable by pressing Shift-F2), open up the sample source file by double clicking on it. To make your program work, you will need to add at line 14:
#include <windows.h>
You will need to make a small change to the project's Build Options. Go to Project, Build Options.
Select the Linker tab and press Add in the Link Libraries area.
Press on the ... button to select a library to add. You need to add the glut32.lib library. Locate this from the directory you placed it in before.
After you add the library, it will ask if you want to keep the path relative. Select No.
Press OK to select the library.
Press OK to close the Project's Build Options.
Press F9 to do a Build & Run of your project.
After a while you'll get some warnings. Ignore the warnings. If you get errors, check the steps above to make sure you added in the new line at 14, and setup project to use the glut32.lib library file to use.
Hopefully you'll get a program displaying the following:
If you see the proceeding window, congratulations, GLUT works for you!
'Computer Science' 카테고리의 다른 글
OpenGL 프로그래밍의 개요 (0) | 2011.03.06 |
---|---|
OpenGL 프로그래밍의 기본 (0) | 2010.12.15 |
마이크로소프트의 화려한 부활이 머지 않았다... (0) | 2010.12.02 |
2010.11.26 애플빠들 따라하기, IBM PC에 아이폰 및 매킨토시 개발환경 구축 (0) | 2010.11.24 |
[알아봅시다] 이통사들의 모바일 트래픽 해법 (0) | 2010.10.31 |