And here is what we have on personal computer
Code
Code: Select all
int _tmain(int argc, _TCHAR* argv[])
{
E_DRIVER_TYPE driverType = EDT_BURNINGSVIDEO;
IrrlichtDevice *device =createDevice(video::EDT_BURNINGSVIDEO, dimension2d<s32>(240, 320), 16, true );
if (device == 0)
return 1;
MyEventReceiver receiver(device);
device->setEventReceiver(&receiver);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
guienv->addStaticText(L"Hello World! This is the Irrlicht!",
rect<s32>(30,10,260,22), false);
guienv->addButton(core::rect<int>(30,35,70,50), 0, 2, L"uQit");
IAnimatedMesh* mesh = smgr->getMesh("\\Program Files\\TestIRWinMobile\\1.3ds");
if (!mesh)
return 1;
IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
if (node)
{
node->setMaterialTexture( 0, driver->getTexture("\\Program Files\\TestIRWinMobile\\1.tga") );
node->setMaterialFlag(video::EMF_LIGHTING, false);
node->setAnimationSpeed(10);
node->setFrameLoop(node->getStartFrame(),node->getEndFrame());
}
smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,20,0));
IGUIStaticText *text = guienv->addStaticText(L"FPS: 25",rect<s32>(60,55,200,70), false );
u32 frames=0;
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
if (++frames==10)
{
stringw str = L"FPS: ";
str += (s32)driver->getFPS();
text->setText ( str.c_str() );
frames=0;
}
driver->endScene();
}
device->drop();
return 0;
};