輸入網址【jsyeh.org/3dcg10】
下載圖中紅色底線[data][win32][glut32.dll]
先將windows壓縮檔壓縮
再將glut32.dll丟進壓縮完的windows資料夾
打開data壓縮檔
將壓縮檔裡的data資料夾丟進windows資料夾
點選即可顯示
程式碼:
#include <GL/glut.h>
void display()
{
glBegin(GL_POLYGON);
glColor3f(1,1,0);
glVertex2f(0.5,0.5);
glVertex2f(0.5,-0.5);
glVertex2f(0,0);
glEnd();
glutSwapBuffers();
}
int main(int argc, char**argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH);
glutCreateWindow("hello");
glutDisplayFunc(display);
glutMainLoop();
}





沒有留言:
張貼留言