Thx for your help, but i had try out this way, (i had read the other threads disscusing this problem

) but when i do that in the draw loop like this:
while(device->run() && driver)
{
if (device->isWindowActive())
{
// load next scene if necessary
u32 now = device->getTimer()->getTime();
if (now - sceneStartTime > timeForThisScene && timeForThisScene!=-1)
switchToNextScene();
pcamera->setTarget(Player1node->getPosition());
// draw everything
driver->beginScene(true, true, backColor);
smgr->drawAll();
guienv->drawAll();
driver->endScene();
// statistics
swprintf(tmp, 255, L"%s fps:%d polys:%d", driver->getName(),
driver->getFPS(), driver->getPrimitiveCountDrawn());
statusText->setText(tmp);
}
}
it compiles but the app crash at start