38 lines
681 B
C
38 lines
681 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <GL/glut.h>
|
|
|
|
void afficher(void)
|
|
{
|
|
glMatrixMode(GL_PROJECTION);
|
|
glLoadIdentity();
|
|
glOrtho(-1.0,1.0,-1.0,1.0,-1.0,1.0);
|
|
glClearColor(0.0,0.0,0.0,0.0);
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
glColor3f(1.0,1.0,1.0);
|
|
glBegin(GL_POLYGON);
|
|
glVertex2f(-0.7,-0.7);
|
|
glVertex2f(-0.7, 0.7);
|
|
glVertex2f( 0.7, 0.7);
|
|
glVertex2f( 0.7,-0.7);
|
|
glEnd();
|
|
glFlush();
|
|
}
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
glutInit(&argc, argv);
|
|
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGBA);
|
|
|
|
int win = glutCreateWindow("glut");
|
|
|
|
glutDisplayFunc(afficher);
|
|
|
|
glutMainLoop();
|
|
|
|
glutDestroyWindow(win);
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|