Now i developed a new version for multiple multihead adapters. U can render over 16 adapters which can have 16 heads per adapter.
The currend used irrlicht has the version 0.14 but i planned this patch for the newest version of irrlicht. (but The current version has no 32 bit indicies and so on. it is a little bit hard to adpated all the features)
U can download the irrlichtv014 multirenderer source at my project site
http://dev-delight.sourceforge.net
the engine enummerate all the adapters if u coose the multihead driver.
u can set the right adapter / head with with the viewport function.
updates follows =)
In some cases the dx device was not correctly reset after the app termination.
Tested on 4 monitors with 2 cards.
nvidia 7600gs pci express
nvidia 5200 FX pci without express =)
i hope the code was usefull...
here the helloworld tutorial for multihead support
Code: Select all
#include "./irrlicht/irrlicht/include/irrlicht.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _DEBUG
#pragma comment(lib, "./Irrlicht/Debug/Irrlicht.lib")
#else
#pragma comment(lib, "./Irrlicht/Release/Irrlicht.lib")
#endif
volatile bool g_run = true;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
if(event.KeyInput.PressedDown)
{
if(event.KeyInput.Key == 27)
{
g_run = false;
}
}
}
return false;
}
};
int main()
{
MyEventReceiver evRec;
u32 width = 800;
u32 height = 600;
u32 adapterCount = getMultiHeadAdapterCountDX9();
core::array<core::rect<s32> > screenResolutions;
//not that multihead devices must be set as fullscreen!!!
IrrlichtDevice *device =
createDevice(EDT_DIRECT3D9_MULTIHEAD, dimension2d<s32>(width, height), 16,
true, false, false, &evRec);
u32 idx = 0;
u32 l = 0;
for(idx = 1; idx < adapterCount+1; ++idx)
{
screenResolutions.push_back(core::rect<s32>(l, 0, width*idx, height));
l = width*idx;
}
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("../../media/sydney.md2");
IAnimatedMeshSceneNode* node;
IAnimatedMeshSceneNode* node1;
ISceneNode* nodeDummy = smgr->addEmptySceneNode();
if(mesh != NULL)
{
node = smgr->addAnimatedMeshSceneNode( mesh);
node1 = smgr->addAnimatedMeshSceneNode( mesh);
}
ISceneNodeAnimator *anim = NULL;
if (node && node1 && nodeDummy)
{
node->setMaterialFlag(EMF_LIGHTING, false);
node->setFrameLoop(0, 0);
node->setMaterialTexture( 0, driver->getTexture("../../media/sydney1.bmp") );
node->setPosition(core::vector3df(50.0f, 0.0f, 0.0f));
node1->setMaterialFlag(EMF_LIGHTING, false);
node1->setFrameLoop(0, 0);
node1->setMaterialTexture( 0, driver->getTexture("../../media/sydney.bmp") );
node1->setPosition(core::vector3df(-50.0f, 0.0f, 0.0f));
nodeDummy->addChild(node);
nodeDummy->addChild(node1);
nodeDummy->setPosition(core::vector3df(0,0,0));
ISceneNodeAnimator *anim = smgr->createRotationAnimator(core::vector3df(0.0f,0.0f,0.1f));//, 20, 0.001f, core::vector3df(180,0,0));
if(anim)
{
nodeDummy->addAnimator(anim);
anim->drop();
}
}
smgr->addCameraSceneNodeMaya();
while(device->run() && g_run)
{
driver->beginScene(true, true, SColor(255,100,101,140));
for(idx = 0; idx < adapterCount; ++idx)
{
driver->setViewPort(screenResolutions[idx]);
smgr->drawAll();
}
driver->endScene();
}
device->drop();
return 0;
}