Added a GL vesion number check to LightModel, and small typo fix in Registry.

This commit is contained in:
Robert Osfield
2002-03-02 09:24:05 +00:00
parent b13f7fecf6
commit 9727d8ff06
2 changed files with 12 additions and 8 deletions

View File

@@ -35,14 +35,18 @@ LightModel::~LightModel()
void LightModel::apply(State&) const
{
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,_ambient.ptr());
if (_colorControl==SEPERATE_SPECULAR_COLOR)
static bool s_seperateSpecularSupported = strcmp((const char *)glGetString(GL_VERSION),"1.2")>=0;
if (s_seperateSpecularSupported)
{
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPERATE_SPECULAR_COLOR);
}
else
{
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR);
if (_colorControl==SEPERATE_SPECULAR_COLOR)
{
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SEPERATE_SPECULAR_COLOR);
}
else
{
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,GL_SINGLE_COLOR);
}
}
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,_localViewer);

View File

@@ -177,7 +177,7 @@ void Registry::removeDotOsgWrapper(DotOsgWrapper* wrapper)
EraseMacro(_nodeWrapperMap,wrapper);
}
#undef EraseMaroc
#undef EraseMacro
void Registry::addReaderWriter(ReaderWriter* rw)
{