 _________________________________________________________________________
/#########################################################################\
|#####...####..######..######......####...####..#####..##......##......###|
|####.....###..######..########..#####.....###...####..##..######..#######|
|###..###..##..######..########..####..###..##....###..##..######..#######|
|###..###..##..######..########..####..###..##..#...#..##..######......###|
|###.......##..######..########..####.......##..##.....##..######..#######|
|###..###..##..######..########..####..###..##..###....##..######..#######|
|###..###..##...#####...#######..####..###..##..####...##..######..#######|
|###..###..##......##......##......##..###..##..#####..##......##......###|
|#########################################################################|
|####################################################################{RB}#|
|=========================================================================|
|									  |
|		           ----> PRESENTS <----				  |
|									  |
|			THE ABACUS SERIES - VOLUME 2		          |
|									  |
|            AMIGA GRAPHICS INSIDE AND OUT - THE COMPLETE BOOK            |
|									  |
| Typed / Scanned / Edited By : RAZOR BLADE.			          |
| Additional Typing by        : GLITCH ( + 8 pages by Asterix ! ).	  |
| Menu Coded by 	      : RAISTLIN				  |
| Original Supplied by	      : VIPER					  |
|									  |
|-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-|
| 		CALL THE ALLIANCE WORLD HQ -> THE PLACE TO BE             |
|       UNKNOWN PLEASURES --> +44 (0) 823 322 891 --> SYSOP: BARBARIAN    |
|_________________________________________________________________________|


       
       
9.3 The Foreman: The VIEWPORT
=============================
       
This is where you determine the size of the creativity area, the display 
mode and the available colours. All of this data is sent to the ViewPort.
This data is later used to create the Copper list that the special Copper
coprocessor will use to construct your screen.
       
Before you can send data to the ViewPort you must first specify the 
position on screen at which data should appear. The variables View.DxOffset
and View.DyOffset establish this position on the screen: One sets the 
X-coordinate on the screen, while the other sets the Y-ccordinate. InitView
initialises these variables so that your View position matches the 
positionin set in the Preferences (i.e. The corner angle in your preferences
screen which helps centre the screen).
       
If you enter a zro valu for ViewPort.DxOffset and ViewPort.DyOffset the 
upper left corner of the ViewPort will be positioned at exactly the same
location as the View. Different values (larger than zero) will place your
ViewPort somewhere in the middle of the screen.
       
ViewPort.DWidth and ViewPort.DHeight set the size of the ViewPort. When 
setting these variables you must remember which resultion you selected.
If you selected 640 pixels horizontal resolution (ViewPort.mode = hires),
you must specify a ViewPort.DWidth of 640 (instead of 320 normal mode).
This also applies to ViewPort.Mode = LACE (interlace mode), which must
have a ViewPort.DHeight of 400 instead of 200 (PAL 51 instead of 256).
       
       
                            PAGE 317
       
-----------------------------------------------------------------------------                                                               
             
       
A color map (or palette) is required for the color resolution. Since the 
different color entries require memory, we must assign them.
       
       ColorMap = (struct ColorMap *) GetColorMap
       (Number_of_Colors)
       
sets up an entire structure called the ColorMap structure. This structure 
stores the pointers to the color memory and the number of available colors
for the ViewPort.
       
After you initialise the ColorMap you must make it available to the 
ViewPort. You can send a pointer for the color map to the ViewPort like
this:
       
       ViewPort.ColorMap = ColorMap
       
or make a direct call like this:
       
       ViewPort.ColorMap = (struct ColorMap *)GetColorMap(Number_of_colors)
       
It is important that you use the Cast ('...(struct ColorMap*)') to 
prevent warnings (pointers do not point to same object).
       
You can determine the returned values of the function GetColorMap (and
all other functions) before the program sets them:
       
       extern struct ColorMap *GetColorMap()
       
       .....
       
       main()
       
Now the compiler will no display the warning messages when you call 
ViewPort.ColorMap = GetColorMap(Number_of_Colors).
       
To prevent the ViewPort structure from containing any random values that 
would confuse the system, we also have an initialise command:
       
       InitVPort(&ViewPort)
       
You should always use this command before writing any values to the 
ViewPort or using the ViewPort.
       
Before we can make use of the BitMap we have to make a connection between 
the ViewPort and the View:
       
       View.ViewPort = &ViewPort
       
                     
                            PAGE 318
       
-----------------------------------------------------------------------------
