Split Screen
Split Screen
How would I go about implementing split screen functionality? It seems that 2 cameras are needed, but from all indications it does not seem possible to render from 2 ICameraSceneNodes, and then take their images and combine them together for the final output. Any suggestions?
Check example 18 in the examples folder - it shows how to implement splitscreens.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
It's quite easy. I was surprised about how easy it is when I integrated it into my current project "Stunt Marble Racers". Here is some pseudo-code on how it works:
I hope I remembered that correctly, I don't have the code here at work. But you could check out my game (and it's sources), the splitscreen rendering is (IIRC) done in CGame::update.
Code: Select all
smgr->beginScene();
driver->setViewport(viewPortOfPlayer1);
smgr->setActiveCamera(cameraOfPlayer1);
smgr->drawAll();
driver->setViewport(viewPortOfPlayer2);
smgr->setActiveCamera(cameraOfPlayer2);
smgr->drawAll();
smgr->endScene();
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames