// 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_Shader() { class_, bases, boost::noncopyable > shader("Shader", no_init); # define OSG_ENUM_TYPE(VALUE) \ (shadertype.value(#VALUE, osg::Shader::VALUE), \ shader.def(#VALUE, object(osg::Shader::VALUE))) enum_ shadertype("Type"); OSG_ENUM_TYPE(VERTEX); OSG_ENUM_TYPE(FRAGMENT); OSG_ENUM_TYPE(UNDEFINED); shader .def(init()) .def(init()) .def("setType",&osg::Shader::setType) .def("setShaderSource",(void (osg::Shader::*)( const std::string& )) &osg::Shader::setShaderSource) // // // .def("getShaderSource",&osg::Shader::getShaderSource, return_internal_reference<>()) // // // .def("readShaderFile",(osg::Shader::* (osg::Shader::Type,const std::string& )) &osg::Shader::readShaderFile) .def("readShaderFile",&osg::Shader::readShaderFile, return_value_policy()) .def("loadShaderSourceFromFile",(bool (osg::Shader::*)(const std::string&)) &osg::Shader::loadShaderSourceFromFile) .def("getType",&osg::Shader::getType) .def("getTypename",&osg::Shader::getTypename) .def("dirtyShader",&osg::Shader::dirtyShader) // // // .def("compileShader"(void (osg::Shader::*)(unsigned int) const) &osg::Shader::compileShader) .def("compileShader", &osg::Shader::compileShader) .def("attachShader", &osg::Shader::attachShader) .def("deleteGlShader", &osg::Shader::deleteGlShader) .def("flushDeletedGlShaders", &osg::Shader::flushDeletedGlShaders) .staticmethod("readShaderFile") .staticmethod("deleteGlShader") .staticmethod("flushDeletedGlShaders") ; } }