CG
#include <GL/glut.h>
void display(void)
{
int i;
glClear(GL_COLOR_BUFFER_BIT);
/* 図形の描画 */
glColor3d(1.0, 1.0, 0.0);
glutWireTeapot(1.0);
glFlush();
}
void resize(int w, int h)
{
glViewport(0, 0, w, h);
glLoadIdentity();
gluPerspective(30.0, (double)w / (double)h, 1.0, 100.0);
gluLookAt(3.0, 4.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
}
void init(void)
{
glClearColor(0.0, 0.0, 0.0, 0.0);
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA);
glutCreateWindow(argv[0]);
glutDisplayFunc(display);
glutReshapeFunc(resize);
init();
glutMainLoop();
return 0;
}