summaryrefslogtreecommitdiffstats
path: root/progs/demos/arbfplight.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-01-09 17:00:57 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-01-09 17:00:57 +0000
commitb58091a336d767bf82dbf12d6161997206a44bcf (patch)
treea8cbbecfb2c3faeeeec476047d529bd9a989f658 /progs/demos/arbfplight.c
parent429efa9f00b63f08ba4bc76e5b8ba80aceee24ec (diff)
downloadexternal_mesa3d-b58091a336d767bf82dbf12d6161997206a44bcf.zip
external_mesa3d-b58091a336d767bf82dbf12d6161997206a44bcf.tar.gz
external_mesa3d-b58091a336d767bf82dbf12d6161997206a44bcf.tar.bz2
Add #ifdefs for extension testing (Marcello Magallon)
Diffstat (limited to 'progs/demos/arbfplight.c')
-rw-r--r--progs/demos/arbfplight.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/progs/demos/arbfplight.c b/progs/demos/arbfplight.c
index d5508a6..2173ae6 100644
--- a/progs/demos/arbfplight.c
+++ b/progs/demos/arbfplight.c
@@ -51,16 +51,20 @@ static void Redisplay( void )
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
if (PixelLight) {
+#if defined(GL_ARB_fragment_program)
glProgramLocalParameter4fvARB_func(GL_FRAGMENT_PROGRAM_ARB,
LIGHTPOS, LightPos);
glEnable(GL_FRAGMENT_PROGRAM_ARB);
glEnable(GL_VERTEX_PROGRAM_ARB);
+#endif
glDisable(GL_LIGHTING);
}
else {
glLightfv(GL_LIGHT0, GL_POSITION, LightPos);
+#if defined(GL_ARB_fragment_program)
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glDisable(GL_VERTEX_PROGRAM_ARB);
+#endif
glEnable(GL_LIGHTING);
}
@@ -298,6 +302,7 @@ static void Init( void )
glDeleteProgramsARB_func = (PFNGLDELETEPROGRAMSARBPROC) glutGetProcAddress("glDeleteProgramsARB");
assert(glDeleteProgramsARB_func);
+#if defined(GL_ARB_fragment_program)
/*
* Fragment program
*/
@@ -349,6 +354,7 @@ static void Init( void )
exit(0);
}
assert(glIsProgramARB_func(VertProg));
+#endif
/*
* Misc init