From 1cb4901df5057954762ba598d5aec2195274c101 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 2 Jun 2004 15:04:33 +0000 Subject: [PATCH] Test if we have OpenGL 1.2 to use GL_RESCALE_NORMAL. If not, use the more expensive GL_NORMALIZE. Thanks Dave! --- Graphics/Draw.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Graphics/Draw.cpp b/Graphics/Draw.cpp index f14676798d..2d21f808d1 100644 --- a/Graphics/Draw.cpp +++ b/Graphics/Draw.cpp @@ -1,4 +1,4 @@ -// $Id: Draw.cpp,v 1.57 2004-06-01 17:14:30 geuzaine Exp $ +// $Id: Draw.cpp,v 1.58 2004-06-02 15:04:33 geuzaine Exp $ // // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // @@ -176,7 +176,12 @@ void InitRenderModel(void) glMaterialf(GL_FRONT_AND_BACK, GL_SHININESS, 40.); glShadeModel(GL_SMOOTH); glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, spec); +#if defined(GL_VERSION_1_2) + // this is more efficient, since we already specify unit normals glEnable(GL_RESCALE_NORMAL); +#else + glEnable(GL_NORMALIZE); +#endif glEnable(GL_COLOR_MATERIAL); // lighting is enabled/disabled for each particular primitive later glDisable(GL_LIGHTING); -- GitLab