1.利用Codeblocks跑出OpenGL
(1)OpenGL project
(2)命名,檔案路徑

2.利用Codeblocks跑出GLUT
(1)載下freeglut MinGW版
(2)解壓縮
(3)把檔名改成libglut32.a
(4)建立GLUT project
(5)GLUT檔的路徑
(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;
}
沒有留言:
張貼留言