The option I prefer is the multiple viewports on the one window, which is stretched over the two monitors. It seems to work, except that DirectX doesn't want to render textures properly, except on the final viewport.
This is the kind of code I'm using:
Code: Select all
device = createDevice(video::EDT_DIRECT3D9, core::dimension2d<s32>(2560, 1024));
smgr=device->getSceneManager();
driver=device->getVideoDriver();
env=device->getGUIEnvironment();
//...some misc setup code
while(device->run())
if(device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,0,0,0));
driver->setViewPort(rect<s32>(0,0,1280,1024));
smgr->drawAll();
// some code...
env->drawAll();
driver->setViewPort(rect<s32>(1280,0,2560,1024));
smgr->drawAll();
// some code...
env->drawAll();
driver->endScene();
}
device->drop();
However, we have some features of our models on this project (such as shininess factors) that the OpenGL renderer doesn't seem to support well and would prefer to use DirectX.
I tried wrapping each viewport in beginScene()/endScene() calls seperately (as opposed to just one beginScene() and one endScene()) and that almost worked, but the viewports then just flashed horribly... Lucky I'm not epileptic
So, does anyone have any ideas on why DirectX doesn't like the multiple viewports? And more importantly, how can I fix it?