Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) IrrlichtExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppIrrlichtExample1/CppIrrlichtExample1.pro

 

TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += main.cpp

INCLUDEPATH += ../../Libraries/irrlicht-1.8/include
LIBS += -L../../Libraries/irrlicht-1.8/lib/Win32-gcc/ -lirrlicht
LIBS += -L../../Libraries/irrlicht-1.8/bin/Win32-gcc

 

 

 

 

 

./CppIrrlichtExample1/main.cpp

 

#include <cassert>
#include "irrlicht.h"

int main()
{
  irr::IrrlichtDevice * const device = irr::createDevice(irr::video::EDT_SOFTWARE);

  device->setWindowCaption(L"HelloIrrlicht");

  irr::video::IVideoDriver * const driver = device->getVideoDriver();
  irr::scene::ISceneManager * const scene_manager = device->getSceneManager();
  irr::gui::IGUIEnvironment * const gui_environment = device->getGUIEnvironment();
  irr::scene::IAnimatedMesh * const mesh = scene_manager->getMesh("../../Libraries/irrlicht-1.8/media/sydney.md2");
  assert(mesh);

  irr::scene::IAnimatedMeshSceneNode * const node = scene_manager->addAnimatedMeshSceneNode( mesh );
  assert(node);
  node->setMaterialFlag(irr::video::EMF_LIGHTING, false);
  node->setMD2Animation(irr::scene::EMAT_STAND);
  node->setMaterialTexture( 0, driver->getTexture("../../Libraries/irrlicht-1.8/media/sydney.bmp") );

  scene_manager->addCameraSceneNode(0, irr::core::vector3df(0,30,-40), irr::core::vector3df(0,5,0));

  while(device->run())
  {
    driver->beginScene(
      true,
      true,
      irr::video::SColor(0,195,195,195));
    scene_manager->drawAll();
    gui_environment->drawAll();
    driver->endScene();
  }
  device->drop();
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml