commit ef8400fa359ce40e19bf1d3f58e79a67bed64e8f
parent e710b49e77bbc85eaab92a29927865a6dbd151c6
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Mon, 26 Sep 2011 22:43:03 +0200
Merge branch 'master' of github:jsmaniac/2011-m2s3-city-builder
Conflicts:
Makefile
Diffstat:
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
@@ -16,7 +16,7 @@ simple-terrain: simple-terrain.c Makefile
$(CC) $< -o $@
display: display.c Makefile
- $(CC) -lGL -lSDL $< $(CFLAGS) -o $@
+ $(CC) -lGL -lSDL -lGLU $< $(CFLAGS) -o $@
roam: roam.c Makefile
$(CC) $< $(CFLAGS) -o $@
diff --git a/display.c b/display.c
@@ -22,11 +22,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();