From Marco Jez, fixes to osgFX so that effects are compiled correctly.
Fixed title name of osgkeyboardmouse example.
This commit is contained in:
@@ -214,7 +214,7 @@ int main( int argc, char **argv )
|
||||
|
||||
// create the window to draw to.
|
||||
osg::ref_ptr<Producer::RenderSurface> renderSurface = new Producer::RenderSurface;
|
||||
renderSurface->setWindowName("osgsimple");
|
||||
renderSurface->setWindowName("osgkeyboardmouse");
|
||||
renderSurface->setWindowRectangle(100,100,800,600);
|
||||
renderSurface->useBorder(true);
|
||||
renderSurface->realize();
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace osgFX
|
||||
META_StateAttribute(osgFX, Validator, VALIDATOR);
|
||||
|
||||
void apply(osg::State &state) const;
|
||||
void compile(osg::State &state) const;
|
||||
|
||||
inline int compare(const osg::StateAttribute &sa) const;
|
||||
|
||||
|
||||
@@ -122,9 +122,14 @@ void Effect::traverse(osg::NodeVisitor &nv)
|
||||
tech = techs_[global_sel_tech_].get();
|
||||
}
|
||||
|
||||
// if we could find an active technique, then continue with traversal
|
||||
// if we could find an active technique, then continue with traversal,
|
||||
// else go for default traversal (no effect)
|
||||
if (tech) {
|
||||
tech->traverse(nv, this);
|
||||
} else {
|
||||
if (nv.getTraversalMode() == osg::NodeVisitor::TRAVERSE_ALL_CHILDREN) {
|
||||
inherited_traverse(nv);
|
||||
}
|
||||
}
|
||||
|
||||
// wow, we're finished! :)
|
||||
|
||||
@@ -23,6 +23,11 @@ Validator::Validator(const Validator ©, const osg::CopyOp ©op)
|
||||
{
|
||||
}
|
||||
|
||||
void Validator::compile(osg::State &state) const
|
||||
{
|
||||
apply(state);
|
||||
}
|
||||
|
||||
void Validator::apply(osg::State &state) const
|
||||
{
|
||||
if (!effect_) return;
|
||||
|
||||
Reference in New Issue
Block a user