From eda45df83952e3e92ec4adacc8c942085e132077 Mon Sep 17 00:00:00 2001 From: Diederick Niehorster Date: Mon, 13 Aug 2012 04:59:48 +0000 Subject: [PATCH] fixed shader route in shapes demo: - small bug in gl_frustum implementation in matrix lib, element (4,4) should be 0 - default OpenGL ambient color is (.2, .2, .2, 1.), not black little bit of formatting git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1388 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/shapes/glmatrix.c | 1 + progs/demos/shapes/shapes.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/progs/demos/shapes/glmatrix.c b/progs/demos/shapes/glmatrix.c index 961bf7c..5128da8 100644 --- a/progs/demos/shapes/glmatrix.c +++ b/progs/demos/shapes/glmatrix.c @@ -160,6 +160,7 @@ void gl_frustum(float left, float right, float bottom, float top, float near, fl mat[10] = c; mat[11] = -1.f; mat[14] = d; + mat[15] = 0; gl_mult_matrixf(mat); } diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index 7326914..e91a969 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -190,13 +190,13 @@ const ourGLchar *fragmentShaderSource[] = { "};", "lightSource light0 = lightSource(", " vec4(2.0, 5.0, 5.0, 0.0),", - " vec4(1.0, 1.0, 1.0, 1.0),", - " vec4(1.0, 1.0, 1.0, 1.0),", - " 0.0, 1.0, 0.0,", + " vec4(1.0, 1.0, 1.0, 1.0),", + " vec4(1.0, 1.0, 1.0, 1.0),", + " 0.0, 1.0, 0.0,", " 180.0, 0.0,", " vec3(0.0, 0.0, 0.0)", ");", - "vec4 scene_ambient = vec4(0.0, 0.0, 0.0, 1.0);", + "vec4 scene_ambient = vec4(0.2, 0.2, 0.2, 1.0);", " ", "struct material", "{", -- 1.7.10.4