Code: Select all
#include <irrlicht.h>
#include <iostream>
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()
{
for (int i = 0; i < 5; i++)
{
IrrlichtDevice* device =
createDevice(video::EDT_DIRECT3D9, dimension2d<u32>(1024, 768), 32,
false, false, false, 0);
if (!device)
return 1;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IGUIEnvironment* guienv = device->getGUIEnvironment();
IMeshSceneNode* node = smgr->addCubeSceneNode();
IImage* image = driver->createImageFromFile("cube/pos-x.png");
ITexture* texture = driver->addTexture("TestTexture", image);
node->setMaterialTexture(4, texture);
image->drop();
driver->beginScene();
smgr->drawAll();
driver->endScene();
device->closeDevice();
device->drop();
}
std::cin.get();
}
Code: Select all
node->setMaterialTexture(4, texture);
Code: Select all
node->setMaterialTexture(3, texture);