After loading a AnimatedMesh MD3 format, when I like to have a 'remove' the node, I always crash.
It's the same thing when I quit the application (device->drop() ).
There is the code I use:
Code: Select all
int main()
{
// let user select driver type
video::E_DRIVER_TYPE driverType = video::EDT_DIRECT3D9;
printf("Please select the driver you want for this example:\n"\
" (a) Direct3D 9.0c\n (b) Direct3D 8.1\n (c) OpenGL 1.5\n"\
" (d) Software Renderer\n (e) Burning's Software Renderer\n"\
" (f) NullDevice\n (otherKey) exit\n\n");
char i;
std::cin >> i;
switch(i)
{
case 'a': driverType = video::EDT_DIRECT3D9;break;
case 'b': driverType = video::EDT_DIRECT3D8;break;
case 'c': driverType = video::EDT_OPENGL; break;
case 'd': driverType = video::EDT_SOFTWARE; break;
case 'e': driverType = video::EDT_BURNINGSVIDEO;break;
case 'f': driverType = video::EDT_NULL; break;
default: return 0;
}
IrrlichtDevice* device = createDevice(driverType,
core::dimension2d<s32>(640, 480), 16, false, false, false, 0);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("../../media/md3/head.md3");
if (!mesh) return 1;
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
/* if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMaterialTexture( 0, driver->getTexture("../../media/md3/lower.tga") );
}*/
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
Someone he already knows this problem ?
The release of resource of the MD3 node seems problematic...
(Irrlicht 1.5, and no problem with the MD2, for example.)