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)
6 Dec.1 , 1995: Port of release Mesa 1.2.5
7 - Modifications made to minimize changes to Mesa distribution.
9 Nov.25, 1995: Port of release Mesa 1.2.4
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.
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.
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.
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.
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
44 HOW TO CREATE THE LIBRARIES AND SAMPLE CODE
45 ===========================================
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.
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().
58 HOW TO USE THE MESA LIBRARIES
59 =============================
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.
69 PORTING NOTES TO AMIWIN
70 =======================
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.
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.
85 Here are the changes I did per directory:
89 - added a mklib.amiwin shell script that will make all the libraries and
91 - created this readme file: readme.AMIGA
95 - added the following to GL/xmesa.h
97 #include <pragmas/xlib_pragmas.h>
98 extern struct Library *XLibBase;
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
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
115 Nov. 25, 1995 v 1.2.4
116 - added the necessary pragma calls for X functions to the following:
120 - removed AMIWIN includes from private.h since it is now defined in
122 NET CHANGE: smakefile
125 Nov. 25, 1995 v 1.2.4
127 NET CHANGE: smakefile
130 Nov. 25, 1995 v 1.2.4
131 - added the necessary pragma calls for X functions to the following:
134 NET CHANGE: glaux.c, smakefile
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
141 - put #ifndef AMIWIN ... #endif around sleep() calls in xdemo.c since
142 they are not part of AmigaDOS.
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
149 - removed AMIWIN defines in xdemo.c since sleep() now defined
150 NET CHANGE: smakefile
153 Nov. 25, 1995 v 1.2.4
154 - added the necessary pragma calls for X functions to the following:
157 - put #ifndef AMIWIN ... #endif around sleep() in blendxor.c
158 - removed olympic from smakefile targets since <sys/time.h> not defined
160 - removed AMIWIN defines from oglinfo.c, since already defined in
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
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
172 Nov. 25, 1995 v 1.2.4
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
180 - Removed directory to save space since this is only needed for Windows based