subwindows

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
porki
Posts: 15
Joined: Fri Jun 08, 2007 2:18 pm

subwindows

Post by porki »

With this short code fragment I am able to load 3ds max model of truck with fps camera that I can rotate.
int main()
{
device = createDevice( video::EDT_OPENGL, dimension2d<s32>(1024, 768), 16,false, false, false, 0);
device->setWindowCaption(L"Przyklad dzialania Irrlichta ");
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
IAnimatedMesh* mesh = smgr->getMesh("../../media/truck.3ds");
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setMD2Animation ( scene::EMAT_STAND );
}
smgr->addCameraSceneNode(0, vector3df(0,100,-100), vector3df(0,5,0));
scene::ICameraSceneNode * cam = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(true);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
But when I'm trying to to this in subwindow from tutorial 5 (which appears after clicking the button) nothing happens. Also when I create new window after clicking this button in this way:
if (id == 102)
{
IrrlichtDevice* irrDevice = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(800, 600));
irrDevice->setWindowCaption(L"Symulacja");
video::IVideoDriver* driverS = device->getVideoDriver();
return true;
}
break;
and try to load this model nothing happens.Window appears but without model.
Shortly - I would like to know how to create a subwindow where I could load, for example, Animated Meshes, models etc. just like I did in the main window.
Thanks for help!
Post Reply