Пример #1
0
void save(Archive & ar, const ::fwData::TransferFunction::TFColor & _tfColor, const unsigned int version)
{
    std::vector< float > vecColor (4);
    vecColor[0] = _tfColor.r;
    vecColor[1] = _tfColor.g;
    vecColor[2] = _tfColor.b;
    vecColor[3] = _tfColor.a;
    ar &  ::boost::serialization::make_nvp( "TFColor" , vecColor );
}
Пример #2
0
	void Shader::SendColor(int location, const Color& color) const
	{
		if (location == -1)
			return;

		Vector4f vecColor(color.r/255.f, color.g/255.f, color.b/255.f, color.a/255.f);

		if (glProgramUniform4fv)
			glProgramUniform4fv(m_program, location, 1, vecColor);
		else
		{
			OpenGL::BindProgram(m_program);
			glUniform4fv(location, 1, vecColor);
		}
	}