From aaf1594a6e65c8cac0bca9eb958a4ae2c54a8420 Mon Sep 17 00:00:00 2001 From: Yoann Date: Mon, 26 Sep 2011 21:51:01 +0200 Subject: [PATCH 1/2] =?UTF-8?q?Ajout=20d'un=20lien=20de=20biblioth=C3=A8qu?= =?UTF-8?q?e=20=C3=A0=20la=20compilation.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 59cd86e..ea3b8a3 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,4 @@ simple-terrain: simple-terrain.c gcc simple-terrain.c -o simple-terrain display: display.c - gcc -lGL -lSDL display.c -o display + gcc -lGL -lSDL -lGLU display.c -o display From 92c9300f7c25edafe7bc11ba6d46b07dec55428a Mon Sep 17 00:00:00 2001 From: Yoann Date: Mon, 26 Sep 2011 22:06:53 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Passe=20=C3=A0=20la=203=C3=A8me=20dimension?= =?UTF-8?q?=20de=20l'affichage=20(display.c).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- display.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/display.c b/display.c index c861e6e..710fc01 100644 --- a/display.c +++ b/display.c @@ -19,11 +19,16 @@ int main(int argc, char *argv[]) { } glClear(GL_COLOR_BUFFER_BIT); - + + glMatrixMode( GL_PROJECTION ); + glLoadIdentity( ); + gluPerspective(70,(double)640/480,1,1000); + gluLookAt(0, 0, -3, 0, 0.75, 0, 0, 1, 0); + glBegin(GL_TRIANGLES); - glColor3ub(255,0,0); glVertex2d(-0.75,-0.75); - glColor3ub(0,255,0); glVertex2d(0,0.75); - glColor3ub(0,0,255); glVertex2d(0.75,-0.75); + glColor3ub(255,0,0); glVertex3d(-0.75,-0.75,0); + glColor3ub(0,255,0); glVertex3d(0,0.75,0); + glColor3ub(0,0,255); glVertex3d(0.75,-0.75,0); glEnd(); glFlush();