本文整理汇总了C++中IParamBlock2::GetDesc方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::GetDesc方法的具体用法?C++ IParamBlock2::GetDesc怎么用?C++ IParamBlock2::GetDesc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock2
的用法示例。
在下文中一共展示了IParamBlock2::GetDesc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InvalidateUI
void EllipseObject::InvalidateUI()
{
myParamBlock->GetDesc()->InvalidateUI();
}
示例2:
int DxStdMtl2::GetMatIndex(Mtl * m_Mtl)
{
int i;
Mtl *Std;
StdMat2 * Shader;
// MaxShader *Shader, *s;
if(m_Mtl->IsMultiMtl())
{
Shader = (StdMat2 *)GetRefTarg();
// I use the SubAnims here, as I do not want any NULL material introduced that are not visible to the user
// this can happen when you have N materials and you select N+1 mat ID - the material will add a NULL material
// to the list to compensate - this screws with the index into the paramblock
for(i=0; i < m_Mtl->NumSubs(); i++)
{
Std = (Mtl*)m_Mtl->SubAnim(i);
if(Std!=NULL)
{
if(Std->NumSubMtls()>0)
{
for(int j=0; j< Std->NumSubMtls();j++)
{
Mtl * subMtl = Std->GetSubMtl(j);
if(subMtl == Shader)
Std = subMtl;
}
}
MSPlugin* plugin = (MSPlugin*)((ReferenceTarget*)Std)->GetInterface(I_MAXSCRIPTPLUGIN);
ReferenceTarget * targ = NULL;
if(plugin){
targ = plugin->get_delegate();
Std = (Mtl*)targ;
}
if(Std == Shader)
{
int id=0;
// this gets interesting - the MatID are editable !! must get them from the PAramblock
IParamBlock2 * pblock = m_Mtl->GetParamBlock(0); // there is only one
if(pblock)
{
ParamBlockDesc2 * pd = pblock->GetDesc();
for(int j=0;j<pd->count;j++)
{
if(_tcsicmp(_T("materialIDList"),pd->paramdefs[j].int_name)==0) //not localised
{
//int id;
pblock->GetValue(j,0,id,FOREVER,i);
id = id+1; //for some reason this is stored as a zero index, when a 1's based index is used
}
}
pblock->ReleaseDesc();
}
return(id);
}
}
}
}
return(0);
}
示例3: ConvertMaterial
//.........这里部分代码省略.........
else if (mtl.ClassID() == DIRECTX_9_SHADER_CLASS_ID)
{
IsDirect9Shader = true;
IDxMaterial* dxMtl = (IDxMaterial*)mtl.GetInterface(IDXMATERIAL_INTERFACE);
char *effectName = dxMtl->GetEffectFilename();
IParamBlock2 *paramBlock = mtl.GetParamBlock(0);
std::string outPath;
std::string outBaseName;
std::string outExtention;
PX2::StringHelp::SplitFullFilename(effectName, outPath, outBaseName,
outExtention);
PX2::ShinePtr shineStandard = new0 PX2::Shine();
bool alphaVertex = false;
PX2::Texture2DPtr diffTex;
bool normalEnable = false;
PX2::Texture2DPtr normalTex;
float normalScale = 0.0f;
bool specEnable = false;
PX2::Texture2DPtr specTex;
float specPower = 0.0f;
bool reflectEnable = false;
PX2::TextureCubePtr reflectTex;
float reflectPower = 0.0f;
bool doubleSide = false;
int blendMode = 2;
ParamBlockDesc2 *paramDesc = 0;
int numParam = 0;
if (paramBlock)
{
paramDesc = paramBlock->GetDesc();
numParam = paramBlock->NumParams();
ParamType2 paramType;
for (int i=0; i<numParam; i++)
{
std::string parmName;
PX2::Float4 color4 = PX2::Float4(0.0f, 0.0f, 0.0f, 0.0f);
PX2::Float3 color3 = PX2::Float3(0.0f, 0.0f, 0.0f);
float floatValue = 0.0f;
bool boolValue = false;
float *floatTable = 0;
int intValue = 0;
std::string str;
PX2::Texture2D *tex2d = 0;
paramType = paramBlock->GetParameterType((ParamID)i);
if (TYPE_STRING == paramType)
ConvertStringAttrib(paramBlock, i, parmName, str);
else if (TYPE_FLOAT == paramType)
ConvertFloatAttrib(paramBlock, i, parmName, floatValue);
else if (TYPE_INT == paramType)
ConvertIntAttrib(paramBlock, i, parmName, intValue);
else if (TYPE_RGBA == paramType)
ConvertColorAttrib(paramBlock, i, parmName, color4, i);
else if (TYPE_POINT3 == paramType)
ConvertPoint3Attrib(paramBlock, i, parmName, color3);
else if (TYPE_POINT4 == paramType)
ConvertPoint4Attrib(paramBlock, i, parmName, color4);
else if (TYPE_BOOL == paramType)
ConvertBoolAttrib(paramBlock, i, parmName, boolValue);
else if (TYPE_FLOAT_TAB == paramType)