Axiom.Graphics.GpuProgramParameters.GetNameByIndex C# (CSharp) Method

GetNameByIndex() public method

Given an index, this function will return the name of the parameter at that index.
public GetNameByIndex ( int index ) : string
index int Index of the parameter to look up.
return string
		public string GetNameByIndex( int index )
		{
			foreach ( DictionaryEntry entry in namedParams )
			{
				if ( (int)entry.Value == index )
				{
					return (string)entry.Key;
				}
			}

			return null;
		}

Usage Example

        /// <summary>
        ///     Binds named parameters to fp30 programs.
        /// </summary>
        /// <param name="parms"></param>
        public override void BindParameters(GpuProgramParameters parms)
        {
            if(parms.HasFloatConstants) {
                for(int index = 0; index < parms.FloatConstantCount; index++) {
                    string name = parms.GetNameByIndex(index);

                    if(name != null) {
                        GpuProgramParameters.FloatConstantEntry entry = parms.GetFloatConstant(index);

                        // send the params 4 at a time
                        Gl.glProgramNamedParameter4fvNV(programId, name.Length, name, entry.val);
                    }
                }
            }
        }
All Usage Examples Of Axiom.Graphics.GpuProgramParameters::GetNameByIndex