Added support for glLightModel functionality via osg::LightModel.

This commit is contained in:
Robert Osfield
2002-02-25 22:46:38 +00:00
parent aaa0a42205
commit e21af2adce
10 changed files with 256 additions and 6 deletions

28
src/osg/LightModel.cpp Normal file
View File

@@ -0,0 +1,28 @@
#include <osg/GL>
#include <osg/LightModel>
using namespace osg;
LightModel::LightModel():
StateAttribute(),
_ambient(0.2f,0.2f,0.2f,1.0f),
_colorControl(LightModel::SINGLE_COLOR),
_localViewer(false),
_twoSided(false)
{
}
LightModel::~LightModel()
{
}
void LightModel::apply(State&) const
{
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,_ambient.ptr());
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL,_colorControl);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER,_localViewer);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE,_twoSided);
}