Page 1 of 1
Split Screen
Posted: Wed Feb 10, 2010 10:15 pm
by Sleddog
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?
Posted: Wed Feb 10, 2010 10:21 pm
by CuteAlien
Check example 18 in the examples folder - it shows how to implement splitscreens.
Posted: Wed Feb 10, 2010 10:32 pm
by Sleddog
Thanks. I searched the forums, but not the examples lol.
Posted: Thu Feb 11, 2010 4:49 am
by Virion
Posted: Thu Feb 11, 2010 6:28 am
by Brainsaw
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:
Code: Select all
smgr->beginScene();
driver->setViewport(viewPortOfPlayer1);
smgr->setActiveCamera(cameraOfPlayer1);
smgr->drawAll();
driver->setViewport(viewPortOfPlayer2);
smgr->setActiveCamera(cameraOfPlayer2);
smgr->drawAll();
smgr->endScene();
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.