public FindNamedConstantDefinition ( string name, bool throwExceptionIfNotFound ) : GpuConstantDefinition | ||
name | string | The name to look up |
throwExceptionIfNotFound | bool | |
리턴 | GpuConstantDefinition |
public GpuConstantDefinition FindNamedConstantDefinition(string name, bool throwExceptionIfNotFound)
{
if (namedParams == null)
{
if (throwExceptionIfNotFound)
throw new AxiomException( "Named constants have not been initialised, perhaps a compile error." );
return null;
}
int value;
if (!namedParams.TryGetValue( name, out value ))
{
if (throwExceptionIfNotFound)
throw new AxiomException( "Parameter called " + name + " does not exist. " );
return null;
}
//else
{
// temp hack (gotta update this mess)
var def = new GpuConstantDefinition();
def.LogicalIndex = value;
def.PhysicalIndex = value;
return def;
//return &(i->second);
}
}
}
public void Bind( GpuProgramParameters gpuParams ) { if ( gpuParams != null ) { Axiom.Graphics.GpuProgramParameters.GpuConstantDefinition def = gpuParams.FindNamedConstantDefinition( _name ); if ( def != null ) { this._params = gpuParams; this.physicalIndex = def.PhysicalIndex; } } }