FindNamedConstantDefinition() public méthode

Find a constant definition for a named parameter. This method returns null if the named parameter did not exist, unlike GetConstantDefinition which is more strict; unless you set the last parameter to true.
public FindNamedConstantDefinition ( string name, bool throwExceptionIfNotFound ) : GpuConstantDefinition
name string The name to look up
throwExceptionIfNotFound bool
Résultat GpuConstantDefinition
		public void Bind( GpuProgramParameters gpuParams )
		{
			if ( gpuParams != null )
			{
				Axiom.Graphics.GpuProgramParameters.GpuConstantDefinition def =
					gpuParams.FindNamedConstantDefinition( _name );

				if ( def != null )
				{
					this._params = gpuParams;
					this.physicalIndex = def.PhysicalIndex;
				}
			}
		}
        protected void _updateParameter( GpuProgramParameters programParameters, String paramName, Object value,
                                         int sizeInBytes )
        {
            //programParameters.AutoAddParamName = true;
            var idx = programParameters.FindNamedConstantDefinition( paramName ).LogicalIndex;

            if ( value is Matrix4 )
            {
                programParameters.SetConstant( idx, (Matrix4)value );
            }
            else if ( value is ColorEx )
            {
                programParameters.SetConstant( idx, (ColorEx)value );
            }
            else if ( value is Vector3 )
            {
                programParameters.SetConstant( idx, ( (Vector3)value ) );
            }
            else if ( value is Vector4 )
            {
                programParameters.SetConstant( idx, (Vector4)value );
            }
            else if ( value is float[] )
            {
                programParameters.SetConstant( idx, (float[])value );
            }
            else if ( value is int[] )
            {
                programParameters.SetConstant( idx, (int[])value );
            }
            else if ( value is float )
            {
                programParameters.SetConstant( idx, new[]
                                                    {
                                                        (float)value, 0.0f, 0.0f, 0.0f
                                                    } );
            }
            else
            {
                programParameters.SetConstant( idx, (float[])value );
            }
        }