2015年3月5日 星期四

week2_金博鈞

1.利用Codeblocks跑出OpenGL

(1)OpenGL project

(2)命名,檔案路徑

 (3)Project中的內建程式碼

 (4)Build and Run.



2.利用Codeblocks跑出GLUT

(1)載下freeglut MinGW版

(2)解壓縮




(3)把檔名改成libglut32.a
(4)建立GLUT project

(5)GLUT檔的路徑

 (6)跑出程式碼

(7)Build and Run~
















3.五行程式碼


#include  <GL/glut.h>                                  ///呼叫外掛~

int main(int argc,char **argv)                      ///main的參數
{
    glutInit(&argc,argv);                                

    glutCreateWindow("02163024金博鈞");///建立一個小視窗

    glutMainLoop();                                      ///=卡住不讓程式結束
}



4.十行程式碼

#include  <GL/glut.h> 
void display()                                     ///用來顯示的函式
{
    glutWireTeapot(0.5);                     ///用glut畫空心茶壺

    glFlush();                                       ///沖出去~
}

int main(int argc,char **argv)                       
{
    glutInit(&argc,argv);                                

    glutCreateWindow("02163024金博鈞"); 

    glutDisplayFunc(display);                        

    glutMainLoop();    
                                    
    return 0;
}




沒有留言:

張貼留言