We will use the code that we used before and once again create a new empty method:
Remove the
setShadowTechnique()
function call from thecreateCamera()
function. We don't want our scene in wireframe mode.Create an empty
createViewports()
method:void createViewports() { }
Ogre::Viewport* vp = mWindow->addViewport(mCamera);
Set the background color and the aspect ratio:
vp->setBackgroundColour(ColourValue(0.0f,0.0f,1.0f)); mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
Compile and run the application.
We created a viewport. To do this, we needed to pass a camera to the function. Each viewport can only render the view of one camera, so Ogre 3D enforces that one camera is given during creation. Of course, the camera can be changed later using the appropriate getter and setter functions. The most noticeable change is that the background...