// Copyleft 2004 Brett Hartshorn (bhartsho@yahoo.com) // // 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 using namespace boost::python; namespace { void call_apply(osg::Multisample& obj, osg::State& state) { return obj.apply(state); } class MultisampleWrapper : public osg::Multisample { public: MultisampleWrapper(PyObject* self_) : self(self_) {} void apply(osg::State& state) const { return call_method(self, "apply"); } PyObject* self; }; } // namespace namespace PyOSG { void init_Multisample() { class_, boost::noncopyable> multisample("Multisample", no_init); scope multisample_scope(multisample); multisample .def(init<>()) .def("setSampleCoverage", &osg::Multisample::setSampleCoverage) .def("getCoverage", &osg::Multisample::getCoverage) .def("getInvert", &osg::Multisample::getInvert) .def("setHint", &osg::Multisample::setHint) .def("apply", &call_apply) ; enum_ mode("Mode"); # define OSG_ENUM(VALUE) \ (mode.value(#VALUE, osg::Multisample::VALUE), \ multisample.def(#VALUE, object(osg::Multisample::VALUE))) OSG_ENUM(FASTEST); OSG_ENUM(NICEST); OSG_ENUM(DONT_CARE); } } //namespace PyOSG