本文整理汇总了C++中UniformParameterPtr::get方法的典型用法代码示例。如果您正苦于以下问题:C++ UniformParameterPtr::get方法的具体用法?C++ UniformParameterPtr::get怎么用?C++ UniformParameterPtr::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniformParameterPtr
的用法示例。
在下文中一共展示了UniformParameterPtr::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resolveParameter
//-----------------------------------------------------------------------------
UniformParameterPtr Program::resolveParameter(GpuConstantType type,
int index, uint16 variability,
const String& suggestedName,
size_t size)
{
UniformParameterPtr param;
if (index == -1)
{
index = 0;
// Find the next available index of the target type.
UniformParameterIterator it;
for (it = mParameters.begin(); it != mParameters.end(); ++it)
{
if ((*it)->getType() == type &&
(*it)->isAutoConstantParameter() == false)
{
index++;
}
}
}
else
{
// Check if parameter already exists.
param = getParameterByType(type, index);
if (param.get() != NULL)
{
return param;
}
}
// Create new parameter.
param = ParameterFactory::createUniform(type, index, variability, suggestedName, size);
addParameter(param);
return param;
}
示例2: resolveAutoParameterInt
//-----------------------------------------------------------------------------
UniformParameterPtr Program::resolveAutoParameterInt(GpuProgramParameters::AutoConstantType autoType, GpuConstantType type,
size_t data, size_t size)
{
UniformParameterPtr param;
// Check if parameter already exists.
param = getParameterByAutoType(autoType);
if (param.get() != NULL)
{
if (param->isAutoConstantIntParameter() &&
param->getAutoConstantIntData() == data)
{
param->setSize(std::max(size, param->getSize()));
return param;
}
}
// Create new parameter.
param = UniformParameterPtr(OGRE_NEW UniformParameter(autoType, data, size, type));
addParameter(param);
return param;
}
示例3: createCpuSubPrograms
//-----------------------------------------------------------------------
bool FFPTransform::createCpuSubPrograms(ProgramSet* programSet)
{
Program* vsProgram = programSet->getCpuVertexProgram();
// Resolve World View Projection Matrix.
UniformParameterPtr wvpMatrix = vsProgram->resolveAutoParameterInt(GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX, 0);
if (wvpMatrix.get() == NULL)
return false;
Function* vsEntry = vsProgram->getEntryPointFunction();
assert(vsEntry != NULL);
// Resolve input position parameter.
ParameterPtr positionIn = vsEntry->resolveInputParameter(Parameter::SPS_POSITION, 0, Parameter::SPC_POSITION_OBJECT_SPACE, GCT_FLOAT4);
if (positionIn.get() == NULL)
return false;
// Resolve output position parameter.
ParameterPtr positionOut = vsEntry->resolveOutputParameter(Parameter::SPS_POSITION, 0, Parameter::SPC_POSITION_PROJECTIVE_SPACE, GCT_FLOAT4);
if (positionOut.get() == NULL)
return false;
// Add dependency.
vsProgram->addDependency(FFP_LIB_TRANSFORM);
FunctionInvocation* transformFunc = OGRE_NEW FunctionInvocation(FFP_FUNC_TRANSFORM, FFP_VS_TRANSFORM, 0);
transformFunc->pushOperand(wvpMatrix, Operand::OPS_IN);
transformFunc->pushOperand(positionIn, Operand::OPS_IN);
transformFunc->pushOperand(positionOut, Operand::OPS_OUT);
vsEntry->addAtomInstace(transformFunc);
return true;
}