protected override Resource _create( string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, Collections.NameValuePairList createParams )
{
if ( createParams == null || !createParams.ContainsKey( "syntax" )
|| !createParams.ContainsKey( "type" ) )
{
throw new NotImplementedException( "You must supply 'syntax' and 'type' parameters" );
}
GpuProgramType gpt = 0;
CreateGpuProgramDelegate iter = _programMap[ createParams[ "syntax" ] ];
if ( iter == null )
{
return null;
}
string syntaxcode = string.Empty;
foreach ( KeyValuePair<string, CreateGpuProgramDelegate> pair in _programMap )
if ( pair.Value == iter )
{
syntaxcode = pair.Key;
break;
}
if ( createParams[ "type" ] == "vertex_program" )
{
gpt = GpuProgramType.Vertex;
}
else if ( createParams[ "type" ] == "fragment_program" )
{
gpt = GpuProgramType.Fragment;
}
else
{
throw new AxiomException( "Unknown GpuProgramType : " + createParams[ "type" ] );
}
return iter( this, name, handle, group, isManual, loader, gpt, syntaxcode );
}
/// <summary>