Added a bunch of files synched with 0.8.42

This commit is contained in:
Don BURNS
2001-09-19 21:08:56 +00:00
parent fed86f3f03
commit e8f256a59d
446 changed files with 58397 additions and 10552 deletions

View File

@@ -1,8 +1,5 @@
#include "osg/GL"
#include "osg/CullFace"
#include "osg/Output"
#include "osg/Input"
using namespace osg;
@@ -11,70 +8,12 @@ CullFace::CullFace()
_mode = BACK;
}
CullFace::~CullFace()
{
}
CullFace* CullFace::instance()
{
static ref_ptr<CullFace> s_CullFace(new CullFace);
return s_CullFace.get();
}
void CullFace::enable( void )
{
glEnable( GL_CULL_FACE );
}
void CullFace::disable( void )
{
glDisable( GL_CULL_FACE );
}
void CullFace::apply()
void CullFace::apply(State&) const
{
glCullFace((GLenum)_mode);
}
bool CullFace::readLocalData(Input& fr)
{
bool iteratorAdvanced = false;
if (fr[0].matchWord("mode"))
{
if (fr[1].matchWord("FRONT"))
{
_mode = FRONT;
fr+=2;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("BACK"))
{
_mode = BACK;
fr+=2;
iteratorAdvanced = true;
}
else if (fr[1].matchWord("FRONT_AND_BACK"))
{
_mode = FRONT_AND_BACK;
fr+=2;
iteratorAdvanced = true;
}
}
return iteratorAdvanced;
}
bool CullFace::writeLocalData(Output& fw)
{
switch(_mode)
{
case(FRONT): fw.indent() << "mode FRONT" << endl; break;
case(BACK): fw.indent() << "mode BACK" << endl; break;
case(FRONT_AND_BACK): fw.indent() << "mode FRONT_AND_BACK" << endl; break;
}
return true;
}