From 684049d97d423a5a873aefc5313d0c4b22528b95 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Aug 2009 13:53:56 -0600 Subject: demos: rename InitUniforms() to SetUniformValues() And call new PrintUniforms() in demos. --- progs/glsl/toyball.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'progs/glsl/toyball.c') diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index 7fe27aebfe..13f5776684 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -173,7 +173,8 @@ Init(void) glUseProgram(program); - InitUniforms(program, Uniforms); + SetUniformValues(program, Uniforms); + PrintUniforms(Uniforms); assert(glGetError() == 0); -- cgit v1.2.3 From fdfb0d4b0e04bff2f3dbae2d1f8e3765fb4b0dce Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 12 Aug 2009 17:25:49 -0600 Subject: progs/glsl: change uniform_info::type field to use GLSL vector types --- progs/glsl/toyball.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'progs/glsl/toyball.c') diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index 13f5776684..89733d6175 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -24,18 +24,18 @@ static GLuint program; static struct uniform_info Uniforms[] = { - { "LightDir", 4, GL_FLOAT, { 0.57737, 0.57735, 0.57735, 0.0 }, -1 }, - { "HVector", 4, GL_FLOAT, { 0.32506, 0.32506, 0.88808, 0.0 }, -1 }, - { "BallCenter", 4, GL_FLOAT, { 0.0, 0.0, 0.0, 1.0 }, -1 }, - { "SpecularColor", 4, GL_FLOAT, { 0.4, 0.4, 0.4, 60.0 }, -1 }, - { "Red", 4, GL_FLOAT, { 0.6, 0.0, 0.0, 1.0 }, -1 }, - { "Blue", 4, GL_FLOAT, { 0.0, 0.3, 0.6, 1.0 }, -1 }, - { "Yellow", 4, GL_FLOAT, { 0.6, 0.5, 0.0, 1.0 }, -1 }, - { "HalfSpace0", 4, GL_FLOAT, { 1.0, 0.0, 0.0, 0.2 }, -1 }, - { "HalfSpace1", 4, GL_FLOAT, { 0.309016994, 0.951056516, 0.0, 0.2 }, -1 }, - { "HalfSpace2", 4, GL_FLOAT, { -0.809016994, 0.587785252, 0.0, 0.2 }, -1 }, - { "HalfSpace3", 4, GL_FLOAT, { -0.809016994, -0.587785252, 0.0, 0.2 }, -1 }, - { "HalfSpace4", 4, GL_FLOAT, { 0.309116994, -0.951056516, 0.0, 0.2 }, -1 }, + { "LightDir", 1, GL_FLOAT_VEC4, { 0.57737, 0.57735, 0.57735, 0.0 }, -1 }, + { "HVector", 1, GL_FLOAT_VEC4, { 0.32506, 0.32506, 0.88808, 0.0 }, -1 }, + { "BallCenter", 1, GL_FLOAT_VEC4, { 0.0, 0.0, 0.0, 1.0 }, -1 }, + { "SpecularColor", 1, GL_FLOAT_VEC4, { 0.4, 0.4, 0.4, 60.0 }, -1 }, + { "Red", 1, GL_FLOAT_VEC4, { 0.6, 0.0, 0.0, 1.0 }, -1 }, + { "Blue", 1, GL_FLOAT_VEC4, { 0.0, 0.3, 0.6, 1.0 }, -1 }, + { "Yellow", 1, GL_FLOAT_VEC4, { 0.6, 0.5, 0.0, 1.0 }, -1 }, + { "HalfSpace0", 1, GL_FLOAT_VEC4, { 1.0, 0.0, 0.0, 0.2 }, -1 }, + { "HalfSpace1", 1, GL_FLOAT_VEC4, { 0.309016994, 0.951056516, 0.0, 0.2 }, -1 }, + { "HalfSpace2", 1, GL_FLOAT_VEC4, { -0.809016994, 0.587785252, 0.0, 0.2 }, -1 }, + { "HalfSpace3", 1, GL_FLOAT_VEC4, { -0.809016994, -0.587785252, 0.0, 0.2 }, -1 }, + { "HalfSpace4", 1, GL_FLOAT_VEC4, { 0.309116994, -0.951056516, 0.0, 0.2 }, -1 }, { "InOrOutInit", 1, GL_FLOAT, { -3.0, 0, 0, 0 }, -1 }, { "StripeWidth", 1, GL_FLOAT, { 0.3, 0, 0, 0 }, -1 }, { "FWidth", 1, GL_FLOAT, { 0.005, 0, 0, 0 }, -1 }, -- cgit v1.2.3 From 680df529a323714013006aae9b3ad5298913a7b3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 17 Aug 2009 12:57:37 -0600 Subject: demos/glsl: remove glutInitWindowPosition() calls --- progs/glsl/toyball.c | 1 - 1 file changed, 1 deletion(-) (limited to 'progs/glsl/toyball.c') diff --git a/progs/glsl/toyball.c b/progs/glsl/toyball.c index 89733d6175..c502f24077 100644 --- a/progs/glsl/toyball.c +++ b/progs/glsl/toyball.c @@ -205,7 +205,6 @@ int main(int argc, char *argv[]) { glutInit(&argc, argv); - glutInitWindowPosition( 0, 0); glutInitWindowSize(400, 400); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); -- cgit v1.2.3