From Sohey Yamamoto, addition of TexEnvFilter support.
This commit is contained in:
@@ -316,6 +316,10 @@ SOURCE=..\..\..\src\osgPlugins\osg\TexEnvCombine.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\TexEnvFilter.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\..\src\osgPlugins\osg\TexGen.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -56,6 +56,7 @@ CXXFILES =\
|
||||
TessellationHints.cpp\
|
||||
TexEnv.cpp\
|
||||
TexEnvCombine.cpp\
|
||||
TexEnvFilter.cpp\
|
||||
TexGen.cpp\
|
||||
TexGenNode.cpp\
|
||||
TexMat.cpp\
|
||||
|
||||
49
src/osgPlugins/osg/TexEnvFilter.cpp
Normal file
49
src/osgPlugins/osg/TexEnvFilter.cpp
Normal file
@@ -0,0 +1,49 @@
|
||||
#include "osg/TexEnvFilter"
|
||||
|
||||
#include "osgDB/Registry"
|
||||
#include "osgDB/Input"
|
||||
#include "osgDB/Output"
|
||||
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
|
||||
// forward declare functions to use later.
|
||||
bool TexEnvFilter_readLocalData(Object& obj, Input& fr);
|
||||
bool TexEnvFilter_writeLocalData(const Object& obj, Output& fw);
|
||||
|
||||
// register the read and write functions with the osgDB::Registry.
|
||||
RegisterDotOsgWrapperProxy g_TexEnvFilterProxy
|
||||
(
|
||||
new TexEnvFilter,
|
||||
"TexEnvFilter",
|
||||
"Object StateAttribute TexEnvFilter",
|
||||
&TexEnvFilter_readLocalData,
|
||||
&TexEnvFilter_writeLocalData
|
||||
);
|
||||
|
||||
|
||||
bool TexEnvFilter_readLocalData(Object& obj, Input& fr)
|
||||
{
|
||||
bool iteratorAdvanced = false;
|
||||
|
||||
TexEnvFilter& texenvfilter = static_cast<TexEnvFilter&>(obj);
|
||||
|
||||
float lodBias = 0.0f;
|
||||
if (fr[0].matchWord("lodBias") && fr[1].getFloat(lodBias))
|
||||
{
|
||||
fr += 2;
|
||||
texenvfilter.setLodBias(lodBias);
|
||||
iteratorAdvanced = true;
|
||||
}
|
||||
|
||||
return iteratorAdvanced;
|
||||
}
|
||||
|
||||
bool TexEnvFilter_writeLocalData(const Object& obj, Output& fw)
|
||||
{
|
||||
const TexEnvFilter& texenvfilter = static_cast<const TexEnvFilter&>(obj);
|
||||
|
||||
fw.indent() << "lodBias " << texenvfilter.getLodBias() << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user