티스토리 뷰
// 컴퓨터그래픽스 교재 P174 예제
#include<glut.h>
#include<gl.h>
#include<glu.h>
void MyDisplay(){
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,0.0,0.0);
glBegin(GL_POLYGON);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,-0.5,0.0);
glVertex3f(0.5,0.5,0.0);
glVertex3f(-0.5,0.5,0.0);
glEnd();
glFlush();
}
int main()
{
glutCreateWindow("OpenGL Drawing Example");
glClearColor(255,255,0.0,0.0);
glutDisplayFunc(MyDisplay);
glutMainLoop();
return 0;
}