Irrlicht

Irrlicht é uma engine para jogos completa e open-source feita em C++. Ela é utilizada em vários projetos e é atualizada freqüentemente.

Table of Contents

Código de exemplo

#include <irrlicht/irrlicht.h>
#include <cstdio>
 
// neste arquivos estará um "main" com o Irrlicht
 
using namespace irr;
 
// sub-namespaces
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
 
int main( int argc, char **argv ){
    IrrlichtDevice *device = createDevice( video::EDT_OPENGL, dimension2d<u32>( 640, 480 ), 16,
                                          false, false, false, 0 );
 
    if( !device ){
        puts( "Could not be possible to create the irrlicht device" );
        return 1;
    }
 
    device->setWindowCaption( L"Hello World - Intro irrlicht tutorial" );
 
    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager *smgr = device->getSceneManager();
    IGUIEnvironment *guienv = device->getGUIEnvironment();
 
    guienv->addStaticText( L"Hello World! This is the Irrlicht software renderer", rect<s32>( 10, 10, 260, 22 ), true );
 
    IAnimatedMesh *mesh = smgr->getMesh( "/home/normal/Desktop/engines 3D/irrlicht-1.7.2/media/sydney.md2" );
 
    if( !mesh ){
        device->drop();
        puts( "Could not be possivel load .md2 mesh" );
        return 1;
    }
 
    IAnimatedMeshSceneNode *node = smgr->addAnimatedMeshSceneNode( mesh );
 
    if( node ){
        node->setMaterialFlag( EMF_LIGHTING, false );
        node->setMD2Animation( scene::EMAT_STAND );
        node->setMaterialTexture( 0, driver->getTexture( "/home/normal/Desktop/engines 3D/irrlicht-1.7.2/media/sydney.bmp" ) );
    }
 
    smgr->addCameraSceneNode( 0, vector3df( 0, 30, -40 ), vector3df( 0, 5, 0 ) );
 
    while( device->run() ){
        driver->beginScene( true, true, SColor( 255, 100, 101, 140 ) );
 
        smgr->drawAll();
        guienv->drawAll();
 
        driver->endScene();
    }
 
    device->drop();
 
    return 0;
}

Versão Atual: 1.7.2

links

Site Oficial: http://irrlicht.sourceforge.net

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.