Code: Select all
#include <irrlicht.h>
#include "driverChoice.h"
//#include <iostream>
//using namespace std;
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#endif
int main(){
IrrlichtDevice *device = createDevice(video::EDT_OPENGL);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
//smgr->setAmbientLight(video::SColorf(0.3,0.3,0.3,1)); // r,g,b,a
//ILightSceneNode* light1 = smgr->addLightSceneNode( 0, core::vector3df(-20,100,-20), video::SColorf(0.3f,0.3f,0.3f), 1.0f, 1 );
ISceneNode* cube = smgr->addCubeSceneNode();
cube->setPosition(vector3df(0,0,0));
cube->setScale(vector3df(1,1,1));
cube->getMaterial(0).Shininess = 15.0f;
cube->getMaterial(0).SpecularColor.set(0,200,50,50); // a,r,g,b
cube->getMaterial(0).AmbientColor.set(0,255,0,0);
cube->getMaterial(0).DiffuseColor.set(0,0,255,0);
//cube->getMaterial(0).EmissiveColor.set(0,0,0,255);
cube->getMaterial(0).Lighting = false; //.set(false);
//cube->setMaterialFlag(video::EMF_LIGHTING, false);
ICameraSceneNode* cam = smgr->addCameraSceneNode();
cam->setTarget(vector3df(0,0,0)); // cube->getPosition());
cam->setPosition(vector3df(10,10,10));
while(device->run() && device){
driver->beginScene(true, true, video::SColor(0,55,55,55));
smgr->drawAll();
driver->endScene();
}
device->drop();
}