blob: 722218cfda7c45ff737697ae45b230fd608a0f6f [file] [log] [blame]
Brian Paula75246f2003-10-02 17:36:43 +00001 Mesa 5.1 DOS/DJGPP Port v1.4
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Brian Paul642699a2003-06-16 14:32:44 +00003
4
5
6Description:
7~~~~~~~~~~~~
8
Brian Paula75246f2003-10-02 17:36:43 +00009Well, guess what... this is the DOS port of Mesa 5.1, for DJGPP fans... Whoa!
Brian Paul642699a2003-06-16 14:32:44 +000010The driver has its origins in ddsample.c, written by Brian Paul and found by me
11in Mesa 3.4.2.
12
13
14
15Legal:
16~~~~~~
17
18Mesa copyright applies, provided this package is used within Mesa. For anything
19else, see GPL.
20
21
22
23Installation:
24~~~~~~~~~~~~~
25
26Unzip and type:
27
28 make -f Makefile.DJ [OPTIONS...]
29
30Available options:
31
32 Environment variables:
33 CPU optimize for the given processor.
Brian Paul9ec58c22003-08-19 15:52:51 +000034 default = pentium
Brian Paul642699a2003-06-16 14:32:44 +000035 GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
36 or `mesa'.
37 default = mesa
Brian Paul9ec58c22003-08-19 15:52:51 +000038 GLIDE path to Glide3 SDK; used with FX.
39 default = $(TOP)/glide3
Brian Paul642699a2003-06-16 14:32:44 +000040 FX=1 build for 3dfx Glide3. Note that this disables
41 compilation of most DMesa code and requires fxMesa.
42 As a consequence, you'll need the DJGPP Glide3
43 library to build any application.
44 default = no
45 MATROX=1 build for Matrox Millennium I (MGA2064W) cards.
46 This is experimental and not intensively tested.
47 default = no
48 HAVE_X86=1 optimize for i386.
49 default = no
50 HAVE_MMX=1 allow MMX specializations, provided your assembler
51 supports MMX instruction set. However, the true CPU
Brian Paul44c69992003-07-11 16:33:43 +000052 capabilities are checked at run-time to avoid lockups.
Brian Paul642699a2003-06-16 14:32:44 +000053 default = no
54 HAVE_SSE=1 (see HAVE_MMX)
55 default = no
56 HAVE_3DNOW=1 (see HAVE_MMX)
57 default = no
58
59 Targets:
60 all: build everything
61 libgl: build GL
62 libglu: build GLU
63 libglut: build GLUT
64 clean: remove object files
65 realclean: remove all generated files
66
67
68
69Tested on:
Brian Paul4e28d962003-06-30 21:51:31 +000070 CPU: AMD Athlon XP 1800+
Brian Paul642699a2003-06-16 14:32:44 +000071 Mainboard: EP-8KTA3 w/ 128 MB SDRAM
72 Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM
Brian Paul9ec58c22003-08-19 15:52:51 +000073 DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.80
Brian Paul642699a2003-06-16 14:32:44 +000074 OS: DOS and Win98SE
75
76
77
78FAQ:
79~~~~
80
811. Compilation
82
Brian Paul44c69992003-07-11 16:33:43 +000083 Q) `make' barfs and exits because it cannot find some stupid file.
Brian Paul642699a2003-06-16 14:32:44 +000084 A) You need LFN support.
85 A) When compiling for Glide (FX=1), pay attention to Glide path.
86
87 Q) Libraries built OK, but linker complains about `vsnprintf' every time I
88 compile some demo.
89 A) Upgrade to DJGPP 2.04.
90 A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!).
Brian Paul44c69992003-07-11 16:33:43 +000091 A) Patch `src/mesa/main/imports.c' with the following line:
Brian Paul642699a2003-06-16 14:32:44 +000092 #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg)
Brian Paul44c69992003-07-11 16:33:43 +000093 This hack should be safe in 90% of the cases, but if anything goes wrong,
94 don't come back to me crying.
Brian Paul642699a2003-06-16 14:32:44 +000095
96 Q) `make' complains about DXE3 or something, yet it builds the libraries.
97 A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest
98 DJGPP distro, or download the separate package from my web page. Read the
99 DXE3 documentation on how to use them.
Brian Paul76096002003-08-28 16:57:01 +0000100 A) When compiling for Glide (FX=1), make sure `glide3x.dxe' can be found in
Brian Paul642699a2003-06-16 14:32:44 +0000101 LD_LIBRARY_PATH (or top `lib' directory).
102
1032. Using Mesa for DJGPP
104
105 Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
106 A) Is that a question? If you have a 3dfx Voodoo Banshee or higher card,
107 you're lucky (check http://sourceforge.net/projects/glide for the DJGPP
108 port). If you have a Matrox Millennium I card, you just MIGHT be lucky...
109 If you haven't, sorry; everything is done in software. Suggestions?
110
111 Q) I tried to set refresh rate w/ DMesa, but without success.
112 A) Refresh rate control works only for VESA 3.0. If you were compiling for
113 Glide, see Glide info. If not, sorry!
114
115 Q) I made a simple application and it does nothing. It exits right away. Not
116 even a blank screen.
117 A) The pure software drivers (VESA/VGA) support only double-buffered modes.
118 A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
119 lazy programmer and I found that the easiest way to keep buffer handling
120 at peak performance ;-).
121
Brian Paul642699a2003-06-16 14:32:44 +0000122 Q) The GLUT is incomplete.
123 A) See below.
124
125
126
127libGLUT (the toolkit):
128~~~~~~~~~~~~~~~~~~~~~~
129
130Well, this "skeletal" GLUT implementation was taken from AllegGL project and
131heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian
132Paul and probably others (or probably not ;-). GLUT functionality will be
133extended only on an "as needed" basis.
134
135GLUT talks to hardware via PC_HW package which was put together from various
136pieces I wrote long time ago. It consists from the keyboard, mouse and timer
137drivers.
138
139My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
140I borrowed the translation tables (and maybe more) from Allegro -- many thanks
141to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
142will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
143turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
144NB: since the DJGPP guys ensured signal handlers won't go beyond program's
145space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
146can, but it is useless), therefore you must live with the 'Exiting due to
147signal SIGINT' message...
148
149The mouse driver is far from complete (lack of drawing, etc), but is enough to
150make almost all the demos work. Supports the CuteMouse WheelAPI.
151
152The timer is pretty versatile for it supports multiple timers with different
153frequencies. While not being the most accurate timer in the known universe, I
154think it's OK. Take this example: you have timer A with a very high rate, and
155then you have timer B with very low rate compared to A; now, A ticks OK, but
156timer B will probably loose precision!
157
158As an addition, stdout and stderr are redirected and dumped upon exit. This
159means that `printf' can be safely called during graphics. A bit of a hack, I
160know, because all messages come in bulk, but I think it's better than nothing.
161"Borrowed" from LIBRHUTI (Robert Hoehne).
162
Brian Paul76096002003-08-28 16:57:01 +0000163Window creating defaults: (0, 0, 300, 300), 16bpp. However, the video mode is
164chosen in such a way that first window will fit. If you need high resolution
165with small windows, set initial position far to the right (or way down); then
166you can move them back to any position right before the main loop.
Brian Paul642699a2003-06-16 14:32:44 +0000167
168The following environment variables can customize GLUT behaviour:
Brian Paul9ec58c22003-08-19 15:52:51 +0000169 GLUT_FPS - print frames/second statistics to stderr
Brian Paul642699a2003-06-16 14:32:44 +0000170 DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
171 DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
Brian Paul76096002003-08-28 16:57:01 +0000172 DMESA_GLUT_ALPHA - set default alpha bits (8)
173 DMESA_GLUT_DEPTH - set default depth bits (16)
174 DMESA_GLUT_STENCIL - set default stencil bits (8)
175 DMESA_GLUT_ACCUM - set default accum bits (16)
Brian Paul642699a2003-06-16 14:32:44 +0000176
177
178
179History:
180~~~~~~~~
181
182v1.0 (mar-2002)
183 initial release
184
185v1.1 (sep-2002)
186 + added 3dfx Glide3 support
187 + added refresh rate control
188 + added fonts in GLUT
189 * lots of minor changes
190
191v1.2 (nov-2002)
192 * synced w/ Mesa-4.1
193 - removed dmesadxe.h
194
195v1.3 (mar-2003)
196 + enabled OpenGL 1.4 support
197 + added MMX clear/blit routines
198 + enabled SGI's GLU compilation
199 + added samples makefile
200 + added new GLUT functions
201 + added color-index modes
202 + added Matrox Millennium MGA2064W driver
203 + added 8bit FakeColor (thanks to Neil Funk)
204 + added VGA support (to keep Ben Decker happy)
205 ! fixed some compilation errors (reported by Chan Kar Heng)
206 * optimized driver for faster callback access... yeah, right :)
207 * overhauled virtual buffer and internal video drivers
208 * better fxMesa integration
209 * revamped GLUT
210 * switched to DXE3
211
Daniel Borcaef563d02003-11-18 12:18:13 +0000212v1.4 (nov-2003)
Brian Paul4778beb2003-08-22 13:47:08 +0000213 + enabled GLUT fonts with DXE
Brian Paul76096002003-08-28 16:57:01 +0000214 + truly added multi-window support in GLUT (for Adrian Woodward)
Brian Paul642699a2003-06-16 14:32:44 +0000215 * accomodated makefiles with the new sourcetree
Brian Paul76096002003-08-28 16:57:01 +0000216 * fixed some ALPHA issues
Daniel Borcaef563d02003-11-18 12:18:13 +0000217 * minor changes to PC_HW/timer interface
Brian Paul76096002003-08-28 16:57:01 +0000218 x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
Brian Paul642699a2003-06-16 14:32:44 +0000219
220
221
222Contact:
223~~~~~~~~
224
225Name: Borca Daniel
Brian Paul9ec58c22003-08-19 15:52:51 +0000226E-mail: dborca@users.sourceforge.net
Brian Paul642699a2003-06-16 14:32:44 +0000227WWW: http://www.geocities.com/dborca/