本文整理汇总了C++中IString::Printf方法的典型用法代码示例。如果您正苦于以下问题:C++ IString::Printf方法的具体用法?C++ IString::Printf怎么用?C++ IString::Printf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IString
的用法示例。
在下文中一共展示了IString::Printf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendLightsInfo
void IShaderManager::SendLightsInfo()
{
return;
IString str;
//printf("light count %d\n",ILight::m_aLights.Count());
for (unsigned int i=0; i<m_pShaderList.Count(); i++)
{
if (m_pShaderList[i] && m_pShaderList[i]->IsCompiled())
{
//m_pShaderList[i]->UseShader();
int ok = m_pShaderList[i]->SetParameterInt("m_nLightsCount",ILight::m_aLights.Count());
//printf("Send light count %d\n",ok);
if (ok)
for (unsigned int j=0; j<ILight::m_aLights.Count(); j++)
{
//Send color
str.Printf("m_v3LightsColor[%d]",j);
ok=m_pShaderList[i]->SetParameter3Float(str,ILight::m_aLights[j]->m_cColor);
//Send position
str.Printf("m_v3LightsPos[%d]",j);
ok=m_pShaderList[i]->SetParameter3Float(str,ILight::m_aLights[j]->m_vPosition);
//Send radius
str.Printf("m_fLightsRadius[%d]",j);
ok=m_pShaderList[i]->SetParameterFloat(str,ILight::m_aLights[j]->m_fRadius);
}
}
}
}
示例2: GetString
IString IProperty::GetString()
{
if (m_pVar)
{
switch (m_iType)
{
case IPT_BOOL:
return *((bool*)m_pVar)==true?"true":"false";
break;
case IPT_INTEGER:
return IString(*((int*)m_pVar));
break;
case IPT_FLOAT:
return TrimZeroFloat(IString(*((float*)m_pVar)));
break;
case IPT_VEC2:
{
IString str;
IVector2D *vect = ((IVector2D*)m_pVar);
str.Printf("%f;%f",vect->GetU(),vect->GetV());
return str;
}
break;
case IPT_VEC3:
{
IString str;
IVector3D *vect = ((IVector3D*)m_pVar);
str.Printf("%f;%f;%f",vect->GetX(),vect->GetY(),vect->GetZ());
return str;
}
break;
case IPT_COLOR:
{
IString str;
IColor *color = ((IColor*)m_pVar);
str.Printf("%f;%f;%f;%f",color->GetRed(),color->GetGreen(),color->GetBlue(),color->GetAlpha());
return str;
}
break;
case IPT_STRING:
case IPT_LONG_STRING:
return *((IString*)m_pVar);
break;
case IPT_CHOICE:
return *((int*)m_pVar);
//return IString(*((int*)m_pVar));
break;
case IPT_RESSOURCE_ITX: // Texture
//if (((ISmartPtr<ITexture>*)m_pVar))
//return (*(ISmartPtr<ITexture>*)m_pVar)->GetFilename();
//return "";
//return *((IString*)m_pVar);
return Core::RelativeToPath(Core::AppPath(),*((IString*)m_pVar));
break;
case IPT_RESSOURCE_IMA: // Material
break;
case IPT_RESSOURCE_IEM: // Animated mesh
break;
}
}
return "";
}