Brian Paul | ecc88c1 | 1999-02-23 03:41:13 +0000 | [diff] [blame] | 1 | AMIGA AMIWIN PORT of MESA: THE OPENGL SOFTWARE EMULATION |
| 2 | ======================================================== |
| 3 | Port by Victor Ng-Thow-Hing (victorng@dgp.toronto.edu) |
| 4 | Original Author (Brian Paul (brianp@ssec.wisc.edu) |
| 5 | |
| 6 | Dec.1 , 1995: Port of release Mesa 1.2.5 |
| 7 | - Modifications made to minimize changes to Mesa distribution. |
| 8 | |
| 9 | Nov.25, 1995: Port of release Mesa 1.2.4 |
| 10 | |
| 11 | |
| 12 | HISTORY |
| 13 | ======= |
| 14 | As a 3D graphics progammer, I was increasingly frustrated to see OpenGL |
| 15 | appearing on so many platforms EXCEPT the Amiga. Up to now, the task |
| 16 | of porting OpenGL directly from native Amiga drawing routines seemed like |
| 17 | a daunting task. However, two important events made this port possible. |
| 18 | |
| 19 | First of all, Brian Paul wrote Mesa, the OpenGL software emulator that |
| 20 | can be found on many platforms - except the Amiga and Atari (who cares |
| 21 | about the latter!). This was pretty ironic considering that Mesa was |
| 22 | originally prototyped on an Amiga! The second great event was when |
| 23 | Holger Kruse developed AmiWin, the X11R6 server for the Amiga (definitely |
| 24 | register for this great piece of software) and released a development kit |
| 25 | so one could compile X programs with SAS/C. |
| 26 | |
| 27 | Since Mesa had X routines as its primitive drawing operations, this made |
| 28 | a marriage of Mesa and Amiwin feasible. I copied over the sources from |
| 29 | an ftp site, played with the code, wrote some Smakefiles, and voila, |
| 30 | I had OpenGL programs displaying on my Amiga. |
| 31 | |
| 32 | Although the speed is nothing to be impressed about, this port can be |
| 33 | potentially useful to those who want to quickly test their code in |
| 34 | wireframe or perhaps learn more about programming with the OpenGL API. |
| 35 | |
| 36 | I hope Amiga developers will continue to write excellent software for |
| 37 | their machine, especially more X clients for Amiwin. If you have any |
| 38 | solutions so some of my problems in the porting notes, please send me |
| 39 | some email! |
| 40 | |
| 41 | See you around, |
| 42 | Vic. |
| 43 | |
| 44 | HOW TO CREATE THE LIBRARIES AND SAMPLE CODE |
| 45 | =========================================== |
| 46 | |
| 47 | Just run the shell script mklib.amiwin in the mesa directory. This will |
| 48 | make all the libraries and copy them into the mesa/lib directory. If you |
| 49 | don't want to compile everything, just go to the desired directory and |
| 50 | type smake in that directory. |
| 51 | |
| 52 | Change any of the variables in the smakefiles as necessary. You will REQUIRE |
| 53 | the Amiwin development kit to compile these libraries since you need X11.LIB |
| 54 | and the shareable X libraries. Some examples require the AmiTCP4.0 |
| 55 | net.lib static link library and related header files for unix related |
| 56 | header files and functions like sleep(). |
| 57 | |
| 58 | HOW TO USE THE MESA LIBRARIES |
| 59 | ============================= |
| 60 | |
| 61 | Study the Smakefiles in the demos, samples and book directories for the |
| 62 | proper SAS/C options and linkable libraries to use. Basically aux calls |
| 63 | require Mesaaux.LIB, gl calls require MesaGL.LIB, glu calls MesaGLU.LIB, |
| 64 | tk calls Mesatk.LIB. There is a preliminary port of MesaGLUT.LIB toolkit |
| 65 | available in the lib directory with the other Mesa libraries. However, |
| 66 | it seems to cause crashes on some of the sample code. Someone else may want |
| 67 | to attempt a more stable port. |
| 68 | |
| 69 | PORTING NOTES TO AMIWIN |
| 70 | ======================= |
| 71 | |
| 72 | My strategy of porting was to leave as much of the code untouched as |
| 73 | possible. I surrounded any amiga specific changes with |
| 74 | #ifdef AMIWIN ... #endif or #ifndef AMIWIN ... #endif preprocessor |
| 75 | symbols. The code was ported on an Amiga 2000, with Fusion 40 accelerator |
| 76 | and a Picasso II graphics card. The SAS/C 6.56 compiler was used, with |
| 77 | the AmiWin 2.16 X development kit. |
| 78 | |
| 79 | All compilations were done for a 68040 CPU with 68882 math coprocessor for |
| 80 | maximum speed. Please edit the smakefile for other compilers. |
| 81 | I wrote smakefiles for the directories I ported. I omitted the Windows |
| 82 | and Widgets directories. The former is for MS Windows and the latter |
| 83 | requires Motif, which is not easily available for the Amiga. |
| 84 | |
| 85 | Here are the changes I did per directory: |
| 86 | |
| 87 | * mesa |
| 88 | Nov. 25, 1995 v 1.2.4 |
| 89 | - added a mklib.amiwin shell script that will make all the libraries and |
| 90 | sample code for Mesa |
| 91 | - created this readme file: readme.AMIGA |
| 92 | |
| 93 | * mesa/include |
| 94 | Dec. 1, 1995 v 1.2.5 |
| 95 | - added the following to GL/xmesa.h |
| 96 | #ifdef AMIWIN |
| 97 | #include <pragmas/xlib_pragmas.h> |
| 98 | extern struct Library *XLibBase; |
| 99 | #endif |
| 100 | NET CHANGE: xmesa.h |
| 101 | |
| 102 | * mesa/src |
| 103 | Nov. 25, 1995 v 1.2.4 |
| 104 | - added the necessary pragma calls for X functions to the following: |
| 105 | xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, glx.c |
| 106 | This prevents undefined symbols errors during the linking phase for |
| 107 | X library calls |
| 108 | - created smakefile |
| 109 | Dec. 1, 1995 v 1.2.5 |
| 110 | - removed AMIWIN includes from xmesa1.c, xmesa2.c, xmesa3.c, xfonts.c, |
| 111 | glx.c since they are now defined in include/GL/xmesa.h |
| 112 | NET CHANGE: smakefile |
| 113 | |
| 114 | * mesa/src-tk |
| 115 | Nov. 25, 1995 v 1.2.4 |
| 116 | - added the necessary pragma calls for X functions to the following: |
| 117 | private.h |
| 118 | - created smakefile |
| 119 | Dec. 1, 1995 v 1.2.5 |
| 120 | - removed AMIWIN includes from private.h since it is now defined in |
| 121 | include/GL/xmesa.h |
| 122 | NET CHANGE: smakefile |
| 123 | |
| 124 | * mesa/src-glu |
| 125 | Nov. 25, 1995 v 1.2.4 |
| 126 | - created smakefile |
| 127 | NET CHANGE: smakefile |
| 128 | |
| 129 | * mesa/src-aux |
| 130 | Nov. 25, 1995 v 1.2.4 |
| 131 | - added the necessary pragma calls for X functions to the following: |
| 132 | glaux.c |
| 133 | - created smakefile |
| 134 | NET CHANGE: glaux.c, smakefile |
| 135 | |
| 136 | * mesa/demos |
| 137 | Nov. 25, 1995 v 1.2.4 |
| 138 | - added the necessary pragma calls for X functions to the following: |
| 139 | xdemo.c, glxdemo.c, offset.c |
| 140 | - created smakefile |
| 141 | - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since |
| 142 | they are not part of AmigaDOS. |
| 143 | Dec. 1, 1995 v 1.2.5 |
| 144 | - removed AMIWIN defines from xdemo.c, glxdemo.c, offset.c since |
| 145 | already defined in include/GL/xmesa.h |
| 146 | - modified Smakefile to include header and includes from the AmiTCP4.0 |
| 147 | net.lib linkable library to provide unix-compatible sys/time.h and |
| 148 | the sleep() function |
| 149 | - removed AMIWIN defines in xdemo.c since sleep() now defined |
| 150 | NET CHANGE: smakefile |
| 151 | |
| 152 | * mesa/samples |
| 153 | Nov. 25, 1995 v 1.2.4 |
| 154 | - added the necessary pragma calls for X functions to the following: |
| 155 | oglinfo.c |
| 156 | - created smakefile |
| 157 | - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c |
| 158 | - removed olympic from smakefile targets since <sys/time.h> not defined |
| 159 | Dec. 1, 1995 v 1.2.5 |
| 160 | - removed AMIWIN defines from oglinfo.c, since already defined in |
| 161 | include/GL/xmesa.h |
| 162 | - modified Smakefile to include header and includes from the AmiTCP4.0 |
| 163 | net.lib linkable library to provide unix-compatible sys/time.h and |
| 164 | the sleep() function |
| 165 | - removed AMIWIN defines in blendxor.c for sleep() |
| 166 | - added AMIWIN defines around _MACHTEN_ in olympic.c since xrandom() |
| 167 | functions are not defined in any libraries |
| 168 | - added olympic back into the Smakefile targets |
| 169 | NET CHANGE: smakefile, olympic.c |
| 170 | |
| 171 | * mesa/book |
| 172 | Nov. 25, 1995 v 1.2.4 |
| 173 | - created smakefile |
| 174 | - removed accpersp and dof from smakefile targets since the SAS/C compile seems to |
| 175 | confuse the near,far variables with near/far memory models. |
| 176 | NET CHANGE: smakefile |
| 177 | |
| 178 | * mesa/windows |
| 179 | Dec. 1, 1995 v 1.2.5 |
| 180 | - Removed directory to save space since this is only needed for Windows based |
| 181 | machines. |