Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. #include <irrlicht.h>
  2. using namespace irr;
  3. using namespace core;
  4. using namespace scene;
  5. using namespace video;
  6. using namespace io;
  7. using namespace gui;
  8.  
  9. #ifdef _IRR_WINDOWS_
  10. #pragma comment(lib, "Irrlicht.lib")
  11. #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
  12. #endif
  13.  
  14. int main()
  15. {
  16.       IrrlichtDevice *device =
  17.                 createDevice( video::EDT_SOFTWARE, dimension2d<u32>(640, 480), 16,
  18.                         false, false, false, 0);
  19.  
  20.         if (!device)
  21.                 return 1;
  22.         device->setWindowCaption(L"Hello World! - Irrlicht Engine Demo");
  23.          IVideoDriver* driver = device->getVideoDriver();
  24.         ISceneManager* smgr = device->getSceneManager();
  25.         IGUIEnvironment* guienv = device->getGUIEnvironment();
  26.           guienv->addStaticText(L"Hello World! This is the Irrlicht Software renderer!",
  27.                 rect<s32>(10,10,260,22), true);
  28.            IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
  29.         if (!mesh)
  30.         {
  31.                 device->drop();
  32.                 return 1;
  33.         }
  34.         IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );
  35.           if (node)
  36.         {
  37.                 node->setMaterialFlag(EMF_LIGHTING, false);
  38.                 node->setMD2Animation(scene::EMAT_STAND);
  39.                 node->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
  40.         }
  41.              smgr->addCameraSceneNode(0, vector3df(0,30,-40), vector3df(0,5,0));
  42.              while(device->run())
  43.         {
  44.  
  45.                  driver->beginScene(true, true, SColor(255,100,101,140));
  46.  
  47.                 smgr->drawAll();
  48.                 guienv->drawAll();
  49.  
  50.                 driver->endScene();
  51.         }
  52.         device->drop();
  53.  
  54.         return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement