Viewport, Origin & Clipping 

Blitz allows you to define a viewport and origin for all your drawing.

A viewport allows you to limit drawing to a rectangular area of the screen. If you attempt to draw outside this area, drawing commmands will be clipped - ie: the bits that lie outside the viewport will be 'chopped off'.

The Origin is simply an x,y coordinate that gets added to ALL drawing coordinates. (You might think of this as OFFSET.)

Together, these are great for split-screen multiplayer games, as you can set up a different viewport and origin for each player.

In this example, a cross made of 2 lines is drawn to 4 viewports.

Graphics 640,480
For x=0 to 320 Step 320
     For y=0 to 240 Step 240
          Origin x,y
          Viewport x,y,320,240
          Line 0,0,319,239
          Line 319,0,0,239
     Next
Next
WaitKey