protected override Resource _create( string name, ulong handle, string group, bool isManual, IManualResourceLoader loader, NameValuePairList createParams )
{
if ( createParams == null || ( createParams.ContainsKey( "syntax" ) == false || createParams.ContainsKey( "type" ) == false ) )
{
throw new Exception( "You must supply 'syntax' and 'type' parameters" );
}
string syntaxCode = createParams[ "syntax" ];
string type = createParams[ "type" ];
// if there is none, this syntax code must not be supported
// just return the base GL program since it won't be doing anything anyway
if ( factories[ syntaxCode ] == null )
{
return new GLGpuProgram( this, name, handle, group, isManual, loader );
}
GpuProgramType gpt;
if ( type == "vertex_program" )
{
gpt = GpuProgramType.Vertex;
}
else
{
gpt = GpuProgramType.Fragment;
}
return ( (IOpenGLGpuProgramFactory)factories[ syntaxCode ] ).Create( this, name, handle, group, isManual, loader, gpt, syntaxCode );
}