本文整理汇总了C++中TextureList::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureList::Clear方法的具体用法?C++ TextureList::Clear怎么用?C++ TextureList::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureList
的用法示例。
在下文中一共展示了TextureList::Clear方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadScene
int LoadScene(const char *filename)
{
TiXmlDocument doc(filename);
if ( ! doc.LoadFile() ) {
printf("Failed to load the file \"%s\"\n", filename);
return 0;
}
TiXmlElement *xml = doc.FirstChildElement("xml");
if ( ! xml ) {
printf("No \"xml\" tag found.\n");
return 0;
}
TiXmlElement *scene = xml->FirstChildElement("scene");
if ( ! scene ) {
printf("No \"scene\" tag found.\n");
return 0;
}
TiXmlElement *cam = xml->FirstChildElement("camera");
if ( ! cam ) {
printf("No \"camera\" tag found.\n");
return 0;
}
nodeMtlList.clear();
rootNode.Init();
materials.DeleteAll();
lights.DeleteAll();
objList.Clear();
textureList.Clear();
LoadScene( scene );
rootNode.ComputeChildBoundBox();
// Assign materials
int numNodes = nodeMtlList.size();
for ( int i=0; i<numNodes; i++ ) {
Material *mtl = materials.Find( nodeMtlList[i].mtlName );
if ( mtl ) nodeMtlList[i].node->SetMaterial(mtl);
}
nodeMtlList.clear();
// Load Camera
camera.Init();
camera.dir += camera.pos;
TiXmlElement *camChild = cam->FirstChildElement();
while ( camChild ) {
if ( COMPARE( camChild->Value(), "position" ) ) ReadVector(camChild,camera.pos);
else if ( COMPARE( camChild->Value(), "target" ) ) ReadVector(camChild,camera.dir);
else if ( COMPARE( camChild->Value(), "up" ) ) ReadVector(camChild,camera.up);
else if ( COMPARE( camChild->Value(), "fov" ) ) ReadFloat (camChild,camera.fov);
else if ( COMPARE( camChild->Value(), "width" ) ) camChild->QueryIntAttribute("value", &camera.imgWidth);
else if ( COMPARE( camChild->Value(), "height" ) ) camChild->QueryIntAttribute("value", &camera.imgHeight);
camChild = camChild->NextSiblingElement();
}
camera.dir -= camera.pos;
camera.dir.Normalize();
Point3 x = camera.dir ^ camera.up;
camera.up = (x ^ camera.dir).GetNormalized();
renderImage.Init( camera.imgWidth, camera.imgHeight );
return 1;
}