프로그래밍/OpenGL

OPEN GL 주전자 그리기

문정환 2008. 9. 30. 10:30


#include<glut.h>
#include<gl.h>
#include<glu.h>

void MyDisplay(){
 glClear(GL_COLOR_BUFFER_BIT);
 glViewport(0,0,300,300);
 glColor3f(1.0,1.0,1.0);
 glutSolidTeapot(0.5);
// glutWireTeapot(0.5);
 // glEnd();
 glFlush();
}

int main(int argc, char** argv)
{
 glutInit(&argc,argv);
 glutInitDisplayMode(GLUT_RGB);
 glutInitWindowSize(300,300);
 glutInitWindowPosition(0,0);
 glutCreateWindow("차 주전자");
 glClearColor(0.0,0.0,0.0,1.0);
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0);
 glutDisplayFunc(MyDisplay);
 glutMainLoop();
 return 0;

}