void display(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3d(1,1,1);
glBegin(GL_TRIANGLES);
glVertex3d(0,0,0);
glVertex3d(0.9,0,0);
glVertex3d(0.9,0.9,0);
glEnd();
glFlush();
glutSwapBuffers();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA);
glutCreateWindow("TRIANGLE TEST");
glutPositionWindow(100,100);
glutDisplayFunc(display);
glutMainLoop();
}
コンパイルした結果はこんな感じ。{
glClear(GL_COLOR_BUFFER_BIT);
glColor3d(1,1,1);
glBegin(GL_TRIANGLES);
glVertex3d(0,0,0);
glVertex3d(0.9,0,0);
glVertex3d(0.9,0.9,0);
glEnd();
glFlush();
glutSwapBuffers();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA);
glutCreateWindow("TRIANGLE TEST");
glutPositionWindow(100,100);
glutDisplayFunc(display);
glutMainLoop();
}
0 件のコメント:
コメントを投稿