Code: Select all
if (id == 103)
{
listbox->addItem(L"File open");
openNewObject = guienv->addFileOpenDialog(L"Please choose a file.", true, 0, -1);
return true;
}
Code: Select all
if(openNewObject != 0)
{
currentMesh = smgr->getMesh((const char *)openNewObject->getFilename());
currentMeshNode = smgr->addAnimatedMeshSceneNode(currentMesh);
currentMeshNode->setPosition(core::vector3df(0.0f, 0.0f, 0.0f));
currentMeshNode->setMaterialFlag(video::EMF_LIGHTING, false);
currentMeshNode->setMaterialTexture( 0, driver->getTexture("testTerrain.bmp") );
openNewObject = 0;
}
ie: its trying to load a file as soon as I click on "open a file" rather than when I click the open button in openFileDialog..
So how do I change it?