sábado, 23 de agosto de 2008

Template 1º (LISTO PARA COPIAR Y COMPILAR)


a_m_t486@hotmail.com
//ESTE TEMPLATE CREA UNA ESCENA EN IRRLICHT Y CREA UN CUBO PARA SER MOSTRADO CON UNA CAMARA



#include
#include
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;


int main() {

// Inicializamos Irrlicht
IrrlichtDevice *device = createDevice(EDT_OPENGL, dimension2d (800, 600), 32, false, false, false, 0);

// Guardamos los apuntadores que serán de utilidad
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();

// Le ponemos un título a nuestra ventana
device->setWindowCaption(L"Hola Mundo en Irrlicht [--A M T--]");


ISceneNode* cubo = smgr->addCubeSceneNode();
cubo->setPosition(vector3df(0,0,5));
cubo->setScale(vector3df(1,1,1));
cubo->setRotation(vector3df(0,0,5));


smgr->addCameraSceneNode(0, vector3df(0, 30, -40), vector3df(0, 0, 0));



// El ciclo principal de nuestra aplicación

while (device->run())

{

cubo->setRotation(cubo->getRotation() + vector3df(0,1,0.005));

driver->beginScene(true, true, SColor(255, 255, 255, 140));
smgr->drawAll();
driver->endScene();
}

// Nos aseguramos de cerrar de manera adecuada Irrlicht
device->drop();

// Siempre es bueno regresar un cero para indicar que todo salió bien
return 0;
}


No hay comentarios: