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
        /// <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);
                    }
                }
            }
        }
Exemplo n.º 2
0
		/// <summary>
		///     Binds named parameters to fp30 programs.
		/// </summary>
		/// <param name="parms"></param>
        public override void BindProgramParameters(GpuProgramParameters parms, GpuProgramParameters.GpuParamVariability mask)
		{
			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, System.Text.Encoding.ASCII.GetBytes( name ), entry.val ); // TAO 2.0
						//Gl.glProgramNamedParameter4fvNV( programId, name.Length, name, entry.val );
					}
				}
			}
		}