Exemple #1
0
	void OgrePass::addSharedParameter (int type, const std::string& name)
	{
		Ogre::GpuProgramParametersSharedPtr params;
		if (type == GPT_Vertex)
			params = mPass->getVertexProgramParameters();
		else if (type == GPT_Fragment)
			params = mPass->getFragmentProgramParameters();

		params->addSharedParameters (name);
	}
Exemple #2
0
	void OgrePass::addSharedParameter (int type, const std::string& name)
	{
		Ogre::GpuProgramParametersSharedPtr params;
		if (type == GPT_Vertex)
			params = mPass->getVertexProgramParameters();
		else if (type == GPT_Fragment)
			params = mPass->getFragmentProgramParameters();

		try
		{
			params->addSharedParameters (name);
		}
		catch (Ogre::Exception& )
		{
			std::stringstream msg;
			msg << "Could not create a shared parameter instance for '"
				   << name << "'. Make sure this shared parameter has a value set (via Factory::setSharedParameter)!";
			throw std::runtime_error(msg.str());
		}
	}