任何人都知道如何从我解析的xml中循环不同的图像(我使用libxml2)然后加载它>在c ++中使用SOIL for OpenGL?这是我的代码:
LoadImage *img[0];
File getFile;
int a;
string imge;
vector<char*> image3;
void getImageNode(File getFile){
vector<Image> image = getFile.getChildrenImage();
a = image.size();
Image image2;
while(image.size()){
image2 = image.front();
imge = image2.getthumb();
char *fileImage = &imge[0];
image3.push_back(fileImage);
image.erase(image.begin());
}
}
int main(int argc,char **argv){
GetRootNode getrootNode;
string xmlFile = "educationalVideo.xml";
Parser xmlObj(xmlFile);
getFile = xmlObj.getNode();
getImageNode(getFile);
for(int i=0; i<=a; i++){
while(image3.size()){
char *fileImage2 = image3.front();
img[i]=new LoadImage(fileImage2); //getting last image
image3.erase(image3.begin());
}
}
return 0;
}