// Copyright (C) 2002-2003 Gideon May (gideon@computer.org) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. #include #include #include #include #include #include #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSG { void init_TexEnvCombine() { class_, bases > texenv("TexEnvCombine", "TexEnvCombine - encapsulates the OpenGL glTexEnvCombine (texture environment) state.", no_init); scope texenv_scope(texenv); texenv.def(init<>()) .def("setCombine_RGB", &osg::TexEnvCombine::setCombine_RGB) .def("setCombine_Alpha", &osg::TexEnvCombine::setCombine_Alpha) .def("getCombine_RGB", &osg::TexEnvCombine::getCombine_RGB) .def("getCombine_Alpha", &osg::TexEnvCombine::getCombine_Alpha) .def("setSource0_RGB", &osg::TexEnvCombine::setSource0_RGB) .def("setSource1_RGB", &osg::TexEnvCombine::setSource1_RGB) .def("setSource2_RGB", &osg::TexEnvCombine::setSource2_RGB) .def("setSource0_Alpha", &osg::TexEnvCombine::setSource0_Alpha) .def("setSource1_Alpha", &osg::TexEnvCombine::setSource1_Alpha) .def("setSource2_Alpha", &osg::TexEnvCombine::setSource2_Alpha) .def("getSource0_RGB", &osg::TexEnvCombine::getSource0_RGB) .def("getSource1_RGB", &osg::TexEnvCombine::getSource1_RGB) .def("getSource2_RGB", &osg::TexEnvCombine::getSource2_RGB) .def("getSource0_Alpha", &osg::TexEnvCombine::getSource0_Alpha) .def("getSource1_Alpha", &osg::TexEnvCombine::getSource1_Alpha) .def("getSource2_Alpha", &osg::TexEnvCombine::getSource2_Alpha) .def("setOperand0_RGB", &osg::TexEnvCombine::setOperand0_RGB) .def("setOperand1_RGB", &osg::TexEnvCombine::setOperand1_RGB) .def("setOperand2_RGB", &osg::TexEnvCombine::setOperand2_RGB) .def("setOperand0_Alpha", &osg::TexEnvCombine::setOperand0_Alpha) .def("setOperand1_Alpha", &osg::TexEnvCombine::setOperand1_Alpha) .def("setOperand2_Alpha", &osg::TexEnvCombine::setOperand2_Alpha) .def("getOperand0_RGB", &osg::TexEnvCombine::getOperand0_RGB) .def("getOperand1_RGB", &osg::TexEnvCombine::getOperand1_RGB) .def("getOperand2_RGB", &osg::TexEnvCombine::getOperand2_RGB) .def("getOperand0_Alpha", &osg::TexEnvCombine::getOperand0_Alpha) .def("getOperand1_Alpha", &osg::TexEnvCombine::getOperand1_Alpha) .def("getOperand2_Alpha", &osg::TexEnvCombine::getOperand2_Alpha) .def("setScale_RGB", &osg::TexEnvCombine::setScale_RGB) .def("setScale_Alpha", &osg::TexEnvCombine::setScale_Alpha) .def("getScale_RGB", &osg::TexEnvCombine::getScale_RGB) .def("getScale_Alpha", &osg::TexEnvCombine::getScale_Alpha) .def("setConstantColor", &osg::TexEnvCombine::setConstantColor) .def("getConstantColor", &osg::TexEnvCombine::getConstantColor, return_value_policy()) ; # define OSG_ENUM_COMBINE(VALUE) \ (combine.value(#VALUE, osg::TexEnvCombine::VALUE), \ texenv.def(#VALUE, object(osg::TexEnvCombine::VALUE))) enum_ combine("CombineParam"); OSG_ENUM_COMBINE(REPLACE); OSG_ENUM_COMBINE(MODULATE); OSG_ENUM_COMBINE(ADD); OSG_ENUM_COMBINE(ADD_SIGNED); OSG_ENUM_COMBINE(INTERPOLATE); OSG_ENUM_COMBINE(SUBTRACT); OSG_ENUM_COMBINE(DOT3_RGB); OSG_ENUM_COMBINE(DOT3_RGBA); # define OSG_ENUM_SOURCE(VALUE) \ (source.value(#VALUE, osg::TexEnvCombine::VALUE), \ texenv.def(#VALUE, object(osg::TexEnvCombine::VALUE))) enum_ source("SourceParam"); OSG_ENUM_SOURCE(CONSTANT); OSG_ENUM_SOURCE(PRIMARY_COLOR); OSG_ENUM_SOURCE(PREVIOUS); OSG_ENUM_SOURCE(TEXTURE); OSG_ENUM_SOURCE(TEXTURE0); OSG_ENUM_SOURCE(TEXTURE1); OSG_ENUM_SOURCE(TEXTURE2); OSG_ENUM_SOURCE(TEXTURE3); OSG_ENUM_SOURCE(TEXTURE4); OSG_ENUM_SOURCE(TEXTURE5); OSG_ENUM_SOURCE(TEXTURE6); OSG_ENUM_SOURCE(TEXTURE7); # define OSG_ENUM_OPERAND(VALUE) \ (operand.value(#VALUE, osg::TexEnvCombine::VALUE), \ texenv.def(#VALUE, object(osg::TexEnvCombine::VALUE))) enum_ operand("OperandParam"); OSG_ENUM_OPERAND(SRC_COLOR); OSG_ENUM_OPERAND(ONE_MINUS_SRC_COLOR); OSG_ENUM_OPERAND(SRC_ALPHA); OSG_ENUM_OPERAND(ONE_MINUS_SRC_ALPHA); } } // namespace PyOSG