本文整理汇总了C#中Axiom.Graphics.GpuProgramParameters.SetNamedAutoConstantReal方法的典型用法代码示例。如果您正苦于以下问题:C# GpuProgramParameters.SetNamedAutoConstantReal方法的具体用法?C# GpuProgramParameters.SetNamedAutoConstantReal怎么用?C# GpuProgramParameters.SetNamedAutoConstantReal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axiom.Graphics.GpuProgramParameters
的用法示例。
在下文中一共展示了GpuProgramParameters.SetNamedAutoConstantReal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TranslateProgramParameters
//.........这里部分代码省略.........
}
if ( success )
{
try
{
if ( named )
parameters.SetNamedAutoConstant( name, def.AutoConstantType, extraInfo );
else
parameters.SetAutoConstant( index, def.AutoConstantType, extraInfo );
}
catch
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line,
"setting of constant failed" );
}
}
else
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line,
"invalid auto constant extra info parameter" );
}
}
}
break;
#endregion Int
#region Real
case GpuProgramParameters.AutoConstantDataType.Real:
if ( def.AutoConstantType == GpuProgramParameters.AutoConstantType.Time ||
def.AutoConstantType == GpuProgramParameters.AutoConstantType.FrameTime )
{
Real f = 1.0f;
if ( i2 != null )
getReal( i2, out f );
try
{
if ( named )
{
parameters.SetNamedAutoConstantReal(name, def.AutoConstantType, f);
}
else
parameters.SetAutoConstantReal( index, def.AutoConstantType, f );
}
catch
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line,
"setting of constant failed" );
}
}
else
{
if ( i2 != null )
{
Real extraInfo = 0.0f;
if ( getReal( i2, out extraInfo ) )
{
try
{
if ( named )
{
parameters.SetNamedAutoConstantReal(name, def.AutoConstantType, extraInfo);
}
else
parameters.SetAutoConstantReal( index, def.AutoConstantType, extraInfo );
}
catch
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line,
"setting of constant failed" );
}
}
else
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line,
"incorrect float argument definition in extra parameters" );
}
}
else
{
compiler.AddError( CompileErrorCode.NumberExpected, prop.File, prop.Line,
"extra parameters required by constant definition " + atom1.Value );
}
}
break;
#endregion Real
}
}
else
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line );
}
}
else
{
compiler.AddError( CompileErrorCode.InvalidParameters, prop.File, prop.Line );
}
}
break;