AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION
========================================================
Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) 
Original Author (Brian Paul (brianp@ssec.wisc.edu)

Dec.1 , 1995: Port of release Mesa 1.2.5
 - Modifications made to minimize changes to Mesa distribution.

Nov.25, 1995: Port of release Mesa 1.2.4


HISTORY
=======
As a 3D graphics progammer, I was increasingly frustrated to see OpenGL 
appearing on so many platforms EXCEPT the Amiga. Up to now, the task
of porting OpenGL directly from native Amiga drawing routines seemed like
a daunting task. However, two important events made this port possible.

First of all, Brian Paul wrote Mesa, the OpenGL software emulator that 
can be found on many platforms - except the Amiga and Atari (who cares 
about the latter!). This was pretty ironic considering that Mesa was 
originally prototyped on an Amiga! The second great event was when 
Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely 
register for this great piece of software) and released a development kit
so one could compile X programs with SAS/C.

Since Mesa had X routines as its primitive drawing operations, this made
a marriage of Mesa and Amiwin feasible. I copied over the sources from
an ftp site, played with the code, wrote some Smakefiles, and voila, 
I had OpenGL programs displaying on my Amiga.

Although the speed is nothing to be impressed about, this port can be
potentially useful to those who want to quickly test their code in
wireframe or perhaps learn more about programming with the OpenGL API.

I hope Amiga developers will continue to write excellent software for
their machine, especially more X clients for Amiwin. If you have any 
solutions so some of my problems in the porting notes, please send me
some email!

See you around,
Vic.

HOW TO CREATE THE LIBRARIES AND SAMPLE CODE
===========================================

Just run the shell script mklib.amiwin in the mesa directory. This will
make all the libraries and copy them into the mesa/lib directory. If you
don't want to compile everything, just go to the desired directory and
type smake in that directory.

Change any of the variables in the smakefiles as necessary. You will REQUIRE
the Amiwin development kit to compile these libraries since you need X11.LIB
and the shareable X libraries. Some examples require the AmiTCP4.0
net.lib static link library and related header files for unix related
header files and functions like sleep().

HOW TO USE THE MESA LIBRARIES
=============================

Study the Smakefiles in the demos, samples and book directories for the
proper SAS/C options and linkable libraries to use. Basically aux calls
require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB,
tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit
available in the lib directory with the other Mesa libraries. However, 
it seems to cause crashes on some of the sample code. Someone else may want
to attempt a more stable port.

PORTING NOTES TO AMIWIN
=======================

My strategy of porting was to leave as much of the code untouched as
possible. I surrounded any amiga specific changes with 
#ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor
symbols. The code  was ported on an Amiga 2000, with Fusion 40 accelerator
and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with
the AmiWin 2.16 X development kit.

All compilations were done for a 68040 CPU with 68882 math coprocessor for
maximum  speed. Please edit the smakefile for other compilers.
I wrote smakefiles for the directories I ported. I omitted the Windows
and Widgets directories. The former is for MS Windows and the latter 
requires Motif, which is not easily available for the Amiga.

Here are the changes I did per directory:

* mesa
Nov. 25, 1995 v 1.2.4
  - added a mklib.amiwin shell script that will make all the libraries and
    sample code for Mesa
  - created this readme file: readme.AMIGA

* mesa/include
Dec. 1, 1995 v 1.2.5
  - added the following to GL/xmesa.h 
     #ifdef AMIWIN
     #include <pragmas/xlib_pragmas.h>
     extern struct Library *XLibBase;
     #endif
NET CHANGE: xmesa.h

* mesa/src 
Nov. 25, 1995 v 1.2.4
  - added the necessary pragma calls for X functions to the following:
    xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c 
    This prevents undefined symbols errors during the linking phase for 
    X library calls
  - created smakefile
Dec.  1, 1995 v 1.2.5
  - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, 
    glx.c since they are now defined in include/GL/xmesa.h
NET CHANGE: smakefile
   
* mesa/src-tk
Nov. 25, 1995 v 1.2.4
  - added the necessary pragma calls for X functions to the following:
    private.h
  - created smakefile
Dec.  1, 1995 v 1.2.5
  - removed AMIWIN includes from private.h since it is now defined in
    include/GL/xmesa.h
NET CHANGE: smakefile

* mesa/src-glu
Nov. 25, 1995 v 1.2.4
  - created smakefile
NET CHANGE: smakefile

* mesa/src-aux
Nov. 25, 1995 v 1.2.4
  - added the necessary pragma calls for X functions to the following:
    glaux.c
  - created smakefile
NET CHANGE: glaux.c, smakefile

* mesa/demos
Nov. 25, 1995 v 1.2.4
  - added the necessary pragma calls for X functions to the following:
    xdemo.c, glxdemo.c, offset.c
  - created smakefile
  - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since 
    they are not part of AmigaDOS.
Dec.  1, 1995 v 1.2.5
  - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since
    already defined in include/GL/xmesa.h
  - modified Smakefile to include header and includes from the AmiTCP4.0
    net.lib linkable library to provide unix-compatible sys/time.h and
    the sleep() function
    - removed AMIWIN defines in xdemo.c since sleep() now defined
NET CHANGE: smakefile

* mesa/samples
Nov. 25, 1995 v 1.2.4
  - added the necessary pragma calls for X functions to the following:
    oglinfo.c
  - created smakefile
  - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c
  - removed olympic from smakefile targets since <sys/time.h> not defined
Dec.  1, 1995 v 1.2.5
  - removed AMIWIN defines from oglinfo.c, since already defined in 
    include/GL/xmesa.h
  - modified Smakefile to include header and includes from the AmiTCP4.0
    net.lib linkable library to provide unix-compatible sys/time.h and
    the sleep() function
    - removed AMIWIN defines in blendxor.c for sleep()
    - added AMIWIN defines around _MACHTEN_ in olympic.c since xrandom()
      functions are not defined in any libraries
    - added olympic back into the Smakefile targets
NET CHANGE: smakefile, olympic.c

* mesa/book
Nov. 25, 1995 v 1.2.4
- created smakefile
- removed accpersp and dof from smakefile targets since the SAS/C compile seems to
  confuse the near,far variables with near/far memory models.
NET CHANGE: smakefile

* mesa/windows
Dec.  1, 1995 v 1.2.5
- Removed directory to save space since this is only needed for Windows based 
  machines.