summaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-01-09 17:39:36 +0000
committerBrian Paul <[email protected]>2005-01-09 17:39:36 +0000
commita4a31c5d76874be8dd30f6809cc63fb27069c135 (patch)
tree16b15fbc3e6d0eaaec59c8adc94a4894a24313b3 /progs
parent2d84ed83c421cb472f4fce5cdcd6191a49345f51 (diff)
use #ifdef to test for extension
Diffstat (limited to 'progs')
-rw-r--r--progs/demos/fplight.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/progs/demos/fplight.c b/progs/demos/fplight.c
index 6eb77c60ea6..c7a38248d38 100644
--- a/progs/demos/fplight.c
+++ b/progs/demos/fplight.c
@@ -37,15 +37,19 @@ static void Display( void )
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
if (PixelLight) {
+#if defined(GL_NV_fragment_program)
NAMED_PARAMETER4FV(FragProg, "LightPos", LightPos);
glEnable(GL_FRAGMENT_PROGRAM_NV);
glEnable(GL_VERTEX_PROGRAM_NV);
+#endif
glDisable(GL_LIGHTING);
}
else {
glLightfv(GL_LIGHT0, GL_POSITION, LightPos);
+#if defined(GL_NV_fragment_program)
glDisable(GL_FRAGMENT_PROGRAM_NV);
glDisable(GL_VERTEX_PROGRAM_NV);
+#endif
glEnable(GL_LIGHTING);
}
@@ -216,6 +220,7 @@ static void Init( void )
exit(1);
}
+#if defined(GL_NV_fragment_program)
glGenProgramsNV(1, &FragProg);
assert(FragProg > 0);
glGenProgramsNV(1, &VertProg);
@@ -243,6 +248,7 @@ static void Init( void )
glBindProgramNV(GL_VERTEX_PROGRAM_NV, VertProg);
glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 0, GL_MODELVIEW_PROJECTION_NV, GL_IDENTITY_NV);
glTrackMatrixNV(GL_VERTEX_PROGRAM_NV, 4, GL_MODELVIEW, GL_INVERSE_TRANSPOSE_NV);
+#endif
/*
* Misc init