本文整理汇总了C++中TextureList::Append方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureList::Append方法的具体用法?C++ TextureList::Append怎么用?C++ TextureList::Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureList
的用法示例。
在下文中一共展示了TextureList::Append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadTexture
TextureMap* ReadTexture(TiXmlElement *element)
{
const char* texName = element->Attribute("texture");
if ( texName == NULL ) return NULL;
Texture *tex = NULL;
if ( COMPARE(texName,"checkerboard") ) {
TextureChecker *ctex = new TextureChecker;
tex = ctex;
printf(" Texture: Checker Board\n");
for ( TiXmlElement *child = element->FirstChildElement(); child!=NULL; child = child->NextSiblingElement() ) {
if ( COMPARE( child->Value(), "color1" ) ) {
Color c(0,0,0);
ReadColor( child, c );
ctex->SetColor1(c);
printf(" color1 %f %f %f\n",c.r,c.g,c.b);
} else if ( COMPARE( child->Value(), "color2" ) ) {
Color c(0,0,0);
ReadColor( child, c );
ctex->SetColor2(c);
printf(" color2 %f %f %f\n",c.r,c.g,c.b);
}
}
textureList.Append( tex, texName );
} else {
printf(" Texture: File \"%s\"",texName);
tex = textureList.Find( texName );
if ( tex == NULL ) {
TextureFile *ftex = new TextureFile;
tex = ftex;
ftex->SetName(texName);
if ( ! ftex->Load() ) {
printf(" -- Error loading file!");
delete tex;
tex = NULL;
} else {
textureList.Append( tex, texName );
}
}
printf("\n");
}
TextureMap *map = new TextureMap(tex);
LoadTransform(map,element,1);
return map;
}