Split Screen Sample

This sample demonstrates how to display the same scene in two viewports using two separate view and projection matrices, simulating a two-player game scenario.

Sample Overview

The Split Screen Sample demonstrates how to render the same scene to multiple viewports. This technique is often used for split-screen multiplayer, but can be used for other situations where content is desired to be clipped to a particular area.

How the Sample Works

The main area of the sample is the DrawScene method, which takes in a viewport, view matrix and projection matrix. The method is responsible for setting the viewport, as well as rendering the entire scene using the specified view and projection matrices. This sample only renders the tank, but this method is where you can add the rest of your scene’s rendering, so that all viewports are capable of seeing the game objects.

The tank model and class are borrowed from the Simple Animation Sample, and are used to help show that the two viewports are indeed seeing the same thing from different angles.