Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- irr::IrrlichtDevice *device = irr::createDevice(irr::video::EDT_OPENGL, irr::core::dimension2d<irr::u32>(640, 480), 16, false, false, false, 0);
- if (!device) return 1;
- device->setWindowCaption(L"Hello World!");
- irr::video::IVideoDriver* driver = device->getVideoDriver();
- irr::scene::ISceneManager* smgr = device->getSceneManager();
- irr::gui::IGUIEnvironment* guienv = device->getGUIEnvironment();
- guienv->addStaticText(L"Hello World!", irr::core::rect<irr::s32>(10, 10, 260, 22), true);
- irr::scene::IAnimatedMesh* mesh = smgr->getMesh("sydney.md2");
- if (!mesh)
- {
- device->drop();
- return 1;
- }
- irr::scene::IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
- irr::scene::IAnimatedMeshSceneNode* node2 = smgr->addAnimatedMeshSceneNode(mesh);
- if (node)
- {
- node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
- node->setMD2Animation(irr::scene::EMAT_RUN);
- node->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
- node->setPosition(irr::core::vector3df(0, 0, 0));
- node2->setMaterialFlag(irr::video::EMF_LIGHTING, false);
- node2->setMD2Animation(irr::scene::EMAT_RUN);
- node2->setMaterialTexture( 0, driver->getTexture("sydney.bmp") );
- node2->setPosition(irr::core::vector3df(300, 0, 0));
- }
- smgr->addCameraSceneNode(0, irr::core::vector3df(0, 300, -300), irr::core::vector3df(0, 0, 0));
- int i = 0;
- while(device->run())
- {
- driver->beginScene(true, true, irr::video::SColor(255, 100, 101, 140));
- smgr->getActiveCamera()->render();
- node->OnAnimate(i);
- node2->OnAnimate(i);
- node->render();
- node2->render();
- driver->endScene();
- i+=10;
- }
- device->drop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement