2015年7月12日 星期日

OpenGL Red book(ver.4.3) set up in visual studio c++2013(Tratdional Chines and English)


就我們所知,紅皮書算是學習openGL的經典了,但是從官網下載的套件使用在mvsc++上就是會出現不少問題,因此這篇文章記錄我目前所遇到的問題還有解決方案。
Red book(OpenGL programming guide) is an epic in learning opneGL, but the tool kit that downloaded from redbook official site using in mvsc++ would trigger some problems or glitches. This blog recorded the problems I have met and solved.


1.可從此網站下載範例和套件 http://www.opengl-redbook.com/
1.We can download sample code and tool kit from this site: http://www.opengl-redbook.com/
2.解壓縮後有這些內容
2.the content we unzip:
其中lib和include是我們需要用到的,但是這份檔案並不包含dll,要就得自己包一個出來,不然就是得從freeglut下載vc適合版的套件,當初沒發現這件事情焦頭爛額了好一陣子。
the "lib" and "include" folders are what we need, but dll file is not included. We can download MSVC package from freeglut site or made dll file  by yourself.

環境設定
IDE set up

3.開啟vc,點選專案->屬性 ,會開啟如下的畫面
3.run vc, click project->attribute,the figure below will be shown(sorry it is not English version)
4.點選VC++目錄,會出現下圖畫面
4.click VC++ Directories, like the picture shows below.


5.點選Include目錄,加入redbook的include,如下圖所示
5.choose Include Directories, add the path of redbook's include folder.
由於每個人檔案夾放置位置不同,因此include擷取位置因人而異,按下確定後include目錄設定就完成了。
Cos of the include folder path would be different from one to another,depending on user's setting.Click OK after include folder path set.

6.設定lib路徑,也是從VC++目錄中,點選程式庫目錄,把redbook中l的ib加入參考即可,如下圖所示
6.set lib folder path,just like how you set include folder path,choose LIBRARY DIRECTORIES,take lib folder of redbook into reference. Click OK.
7.接著點選連結器->輸入->其他相依性的選項,選擇需要呼叫的lib
7.click  Linker->input->Additional Dependencies,choose the lib you need.

在redbook中,雖然它也是從freeglut而來,但它和一般freeglut的lib不大一樣,就是它的lib內容多了很多東西,以下是比較圖
although redbook tool kit comes from freeglut,but there is much different in lib.the file number of lib is much more than freeglut's. There is comparsion.
Inhalt des rotbuch's lib
redbook的lib資料夾內容
content of freeglut's lib
freeglut的lib資料夾內容
引用的lib如下圖,由於這個例子只需要freeglut和glew在vs2010的debug_mode版的lib,因此我只引用這兩個,如下圖所示
the lib I use as the picture shown below,because I need are freeglut and glew  lib in vs2010(compatible to newer version ) of debug_mode.
按下確定後,開發環境即設定完成,可以開始寫程式了。
Click OK,then the IDE set up is done.




沒有留言:

張貼留言

同軸度 Coaxiality

同軸度和同心度是兩個非常容易搞混的幾何公差. 同軸度的符號如下: 跟正位度的符號是一樣的! 有這種設定,主要是它的定義和正位度的使用方法很像,反而跟同心度沒這麼相似. 首先來個範例: 由於這個不是繪圖軟體做的,只是示意用,不合工程圖規範的部分還請包涵. 這個是...