Axiom.Graphics.HighLevelGpuProgramManager.CreateProgram C# (CSharp) Method

CreateProgram() public method

Creates a new, unloaded HighLevelGpuProgram instance.
This method creates a new program of the type specified as the second and third parameters. You will have to call further methods on the returned program in order to define the program fully before you can load it.
public CreateProgram ( string name, string group, string language, GpuProgramType type ) : Axiom.Graphics.HighLevelGpuProgram
name string Name of the program to create.
group string
language string HLSL language to use.
type GpuProgramType Type of program, i.e. vertex or fragment.
return Axiom.Graphics.HighLevelGpuProgram
	    public HighLevelGpuProgram CreateProgram( string name, string group, string language, GpuProgramType type )
		{
			// lookup the factory for the requested program language
			HighLevelGpuProgramFactory factory = GetFactory( language );

			if ( factory == null )
			{
				throw new Exception(
					string.Format( "Could not find HighLevelGpuProgramManager that can compile programs of type '{0}'", language ) );
			}

			// create the high level program using the factory
			HighLevelGpuProgram program = factory.CreateInstance( this, name, nextHandle, group, false, null );
			program.Type = type;
			program.SyntaxCode = language;

			_add( program );
			return program;
		}