本文整理汇总了C++中MFPtrList::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ MFPtrList::Create方法的具体用法?C++ MFPtrList::Create怎么用?C++ MFPtrList::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFPtrList
的用法示例。
在下文中一共展示了MFPtrList::Create方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MFMaterial_RegisterMaterialType
MF_API void MFMaterial_RegisterMaterialType(const char *pName, const MFMaterialCallbacks *pCallbacks)
{
MFCALLSTACK;
MFMaterialType *pMatType;
pMatType = (MFMaterialType*)MFHeap_Alloc(sizeof(MFMaterialType) + MFString_Length(pName) + 1);
pMatType->pTypeName = (char*)&pMatType[1];
MFString_Copy(pMatType->pTypeName, pName);
MFDebug_Assert(pCallbacks->pBegin, "Material must supply Begin() callback.");
MFCopyMemory(&pMatType->materialCallbacks, pCallbacks, sizeof(MFMaterialCallbacks));
gMaterialRegistry.Create(pMatType);
pCallbacks->pRegisterMaterial(NULL);
}
示例2: MFMaterial_Create
MF_API MFMaterial* MFMaterial_Create(const char *pName)
{
MFCALLSTACK;
MFMaterial *pMat = MFMaterial_Find(pName);
if(!pMat)
{
pMat = (MFMaterial*)MFHeap_Alloc(sizeof(MFMaterial) + MFString_Length(pName) + 1);
MFZeroMemory(pMat, sizeof(MFMaterial));
pMat->pName = (char*)&pMat[1];
MFString_Copy(pMat->pName, pName);
gMaterialList.Create(pMat);
MaterialDefinition *pDef = pDefinitionRegistry;
while(pDef)
{
MFIniLine *pLine = pDef->pIni->GetFirstLine()->FindEntry("section",pName);
if (pLine)
{
MaterialInternal_InitialiseFromDefinition(pDef->pIni, pMat, pName);
break;
}
pDef = pDef->pNextDefinition;
}
if(!pDef)
{
// assign material type
pMat->pType = MaterialInternal_GetMaterialType("Standard");
pMat->pType->materialCallbacks.pCreateInstance(pMat);
// set diffuse map parameter
MFMaterial_SetParameterS(pMat, MFMatStandard_Texture, MFMatStandard_Tex_DifuseMap, pName);
}
}
pMat->refCount++;
return pMat;
}
示例3: MFCollision_CreateCollisionItem
MFCollisionItem* MFCollision_CreateCollisionItem()
{
MFCollisionItem *pItem = (MFCollisionItem*)MFHeap_Alloc(sizeof(MFCollisionItem));
gItemList.Create(pItem);
return pItem;
}