summaryrefslogtreecommitdiff
path: root/progs/demos/arbfplight.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-03-22 16:27:13 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-03-22 16:27:13 +0000
commitf6a93d3dffcd285d8c8f45d96d304caf36dd3023 (patch)
tree909809d85bab94a33988459afcba371cf582151f /progs/demos/arbfplight.c
parent3b6eb9005006f786eefdc5331c1cd31e7f24ac9a (diff)
use GL state vars instead of program parameters
Diffstat (limited to 'progs/demos/arbfplight.c')
-rw-r--r--progs/demos/arbfplight.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index 14d7d3ec10..7a405206fa 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -37,8 +37,6 @@ static PFNGLISPROGRAMARBPROC glIsProgramARB_func;
static PFNGLDELETEPROGRAMSARBPROC glDeleteProgramsARB_func;
/* These must match the indexes used in the fragment program */
-#define DIFFUSE 1
-#define SPECULAR 2
#define LIGHTPOS 3
/* Set to one to test ARB_fog_linear program option */
@@ -185,8 +183,8 @@ static void Init( void )
#if DO_FRAGMENT_FOG
"OPTION ARB_fog_linear; \n"
#endif
- "PARAM Diffuse = program.local[1]; \n"
- "PARAM Specular = program.local[2]; \n"
+ "PARAM Diffuse = state.material.diffuse; \n"
+ "PARAM Specular = state.material.specular; \n"
"PARAM LightPos = program.local[3]; \n"
"TEMP lightDir, normal, len; \n"
"TEMP dotProd, specAtten; \n"
@@ -303,9 +301,6 @@ static void Init( void )
}
assert(glIsProgramARB_func(FragProg));
- glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, DIFFUSE, Diffuse);
- glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB, SPECULAR, Specular);
-
/*
* Do some sanity tests
*/
@@ -318,11 +313,6 @@ static void Init( void )
assert(v[1] == 20.0);
assert(v[2] == 30.0);
assert(v[3] == 40.0);
- glGetProgramLocalParameterdvARB_func(GL_FRAGMENT_PROGRAM_ARB, DIFFUSE, v);
- assert(v[0] == Diffuse[0]);
- assert(v[1] == Diffuse[1]);
- assert(v[2] == Diffuse[2]);
- assert(v[3] == Diffuse[3]);
}
/*