close
沒有錯,這次功課題目叫做開一個視窗,其實我還真的不知道什麼叫做開一個窗,所以只好把功課一印出三角形的程式碼砍掉,其他原封不動的在當成第2次功課交給老師拉
。只是不知道有沒有符合老師的需求。
結果
程式碼
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************** | |
Computer Graghics | |
Author:SHEN ZHI-XUN | |
Time:2016/10/11 | |
********************/ | |
#include <GL/glut.h> | |
#include <iostream> | |
using namespace std; | |
void display(void) { | |
glClear(GL_COLOR_BUFFER_BIT); | |
glBegin(GL_POLYGON); | |
glEnd(); | |
glFlush(); | |
} | |
int main(int argc,char** argv) { | |
glutInit(&argc,argv); //使用指令做初始化。 | |
glutInitDisplayMode(GLUT_SINGLE| GLUT_RGB); //設定顯示的屬性。 | |
glutInitWindowSize(500,500); //視窗大小。 | |
glutInitWindowPosition(0,0); //視窗位子。 | |
glutCreateWindow("Open Window"); //創立視窗。 | |
glutDisplayFunc(display); //顯示視窗。 | |
glutMainLoop(); | |
return 0; | |
} |
全站熱搜