from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import sys def display(): glClearColor(0,0,0,0) glClear(GL_COLOR_BUFFER_BIT) glBegin(GL_TRIANGLES) glVertex2f(-0.5,-0.5) glVertex2f(0.5,0.0) glVertex2f(0.0,0.5) glEnd() glFlush() def main(): glutInit(sys.argv) glutInitDisplayMode(GLUT_RGB) glutInitWindowPosition(200,200) glutInitWindowSize(250,250) glutCreateWindow("Un triangle") glutDisplayFunc(display) glutMainLoop() main()