diff --git a/examples/osgblendequation/osgblendequation.cpp b/examples/osgblendequation/osgblendequation.cpp index 76d6bf24d..b87c07ded 100644 --- a/examples/osgblendequation/osgblendequation.cpp +++ b/examples/osgblendequation/osgblendequation.cpp @@ -10,6 +10,31 @@ #include +const int _eq_nb=8; +const osg::BlendEquation::Equation _equations[_eq_nb]= +{ + osg::BlendEquation::FUNC_ADD, + osg::BlendEquation::FUNC_SUBTRACT, + osg::BlendEquation::FUNC_REVERSE_SUBTRACT, + osg::BlendEquation::RGBA_MIN, + osg::BlendEquation::RGBA_MAX, + osg::BlendEquation::ALPHA_MIN, + osg::BlendEquation::ALPHA_MAX, + osg::BlendEquation::LOGIC_OP +}; + +const char* _equations_name[_eq_nb]= +{ + "osg::BlendEquation::FUNC_ADD", + "osg::BlendEquation::FUNC_SUBTRACT", + "osg::BlendEquation::FUNC_REVERSE_SUBTRACT", + "osg::BlendEquation::RGBA_MIN", + "osg::BlendEquation::RGBA_MAX", + "osg::BlendEquation::ALPHA_MIN", + "osg::BlendEquation::ALPHA_MAX", + "osg::BlendEquation::LOGIC_OP" +}; + class TechniqueEventHandler : public osgGA::GUIEventHandler { @@ -34,32 +59,9 @@ protected: osg::BlendEquation* _blendEq; - static const int _eq_nb=8; int _eq_index; - static const osg::BlendEquation::Equation _equations[_eq_nb]; - static const char* _equations_name[_eq_nb]; }; -const osg::BlendEquation::Equation TechniqueEventHandler::_equations[_eq_nb]={ - osg::BlendEquation::FUNC_ADD, - osg::BlendEquation::FUNC_SUBTRACT, - osg::BlendEquation::FUNC_REVERSE_SUBTRACT, - osg::BlendEquation::RGBA_MIN, - osg::BlendEquation::RGBA_MAX, - osg::BlendEquation::ALPHA_MIN, - osg::BlendEquation::ALPHA_MAX, - osg::BlendEquation::LOGIC_OP - }; -const char* TechniqueEventHandler::_equations_name[_eq_nb]={ - "osg::BlendEquation::FUNC_ADD", - "osg::BlendEquation::FUNC_SUBTRACT", - "osg::BlendEquation::FUNC_REVERSE_SUBTRACT", - "osg::BlendEquation::RGBA_MIN", - "osg::BlendEquation::RGBA_MAX", - "osg::BlendEquation::ALPHA_MIN", - "osg::BlendEquation::ALPHA_MAX", - "osg::BlendEquation::LOGIC_OP" - }; diff --git a/examples/osglogicop/osglogicop.cpp b/examples/osglogicop/osglogicop.cpp index cbc354108..868835280 100644 --- a/examples/osglogicop/osglogicop.cpp +++ b/examples/osglogicop/osglogicop.cpp @@ -10,6 +10,46 @@ #include +const int _ops_nb=16; +const osg::LogicOp::Opcode _operations[_ops_nb]= +{ + osg::LogicOp::CLEAR, + osg::LogicOp::SET, + osg::LogicOp::COPY, + osg::LogicOp::COPY_INVERTED, + osg::LogicOp::NOOP, + osg::LogicOp::INVERT, + osg::LogicOp::AND, + osg::LogicOp::NAND, + osg::LogicOp::OR, + osg::LogicOp::NOR, + osg::LogicOp::XOR, + osg::LogicOp::EQUIV, + osg::LogicOp::AND_REVERSE, + osg::LogicOp::AND_INVERTED, + osg::LogicOp::OR_REVERSE, + osg::LogicOp::OR_INVERTED +}; + +const char* _ops_name[_ops_nb]= +{ + "osg::LogicOp::CLEAR", + "osg::LogicOp::SET", + "osg::LogicOp::COPY", + "osg::LogicOp::COPY_INVERTED", + "osg::LogicOp::NOOP", + "osg::LogicOp::INVERT", + "osg::LogicOp::AND", + "osg::LogicOp::NAND", + "osg::LogicOp::OR", + "osg::LogicOp::NOR", + "osg::LogicOp::XOR", + "osg::LogicOp::EQUIV", + "osg::LogicOp::AND_REVERSE", + "osg::LogicOp::AND_INVERTED", + "osg::LogicOp::OR_REVERSE", + "osg::LogicOp::OR_INVERTED" +}; class TechniqueEventHandler : public osgGA::GUIEventHandler { @@ -34,49 +74,9 @@ protected: osg::LogicOp* _logicOp; - static const int _ops_nb=16; int _ops_index; - static const osg::LogicOp::Opcode _operations[_ops_nb]; - static const char* _ops_name[_ops_nb]; }; -const osg::LogicOp::Opcode TechniqueEventHandler::_operations[_ops_nb]={ - osg::LogicOp::CLEAR, - osg::LogicOp::SET, - osg::LogicOp::COPY, - osg::LogicOp::COPY_INVERTED, - osg::LogicOp::NOOP, - osg::LogicOp::INVERT, - osg::LogicOp::AND, - osg::LogicOp::NAND, - osg::LogicOp::OR, - osg::LogicOp::NOR, - osg::LogicOp::XOR, - osg::LogicOp::EQUIV, - osg::LogicOp::AND_REVERSE, - osg::LogicOp::AND_INVERTED, - osg::LogicOp::OR_REVERSE, - osg::LogicOp::OR_INVERTED - }; - -const char* TechniqueEventHandler::_ops_name[_ops_nb]={ - "osg::LogicOp::CLEAR", - "osg::LogicOp::SET", - "osg::LogicOp::COPY", - "osg::LogicOp::COPY_INVERTED", - "osg::LogicOp::NOOP", - "osg::LogicOp::INVERT", - "osg::LogicOp::AND", - "osg::LogicOp::NAND", - "osg::LogicOp::OR", - "osg::LogicOp::NOR", - "osg::LogicOp::XOR", - "osg::LogicOp::EQUIV", - "osg::LogicOp::AND_REVERSE", - "osg::LogicOp::AND_INVERTED", - "osg::LogicOp::OR_REVERSE", - "osg::LogicOp::OR_INVERTED" - }; bool TechniqueEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter&) {