DOS updates for new tree (Daniel Borca)
[mesa.git] / docs / README.DJ
1 Mesa 5.0.1 DOS/DJGPP Port v1.4
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4
5
6 Description:
7 ~~~~~~~~~~~~
8
9 Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa!
10 The driver has its origins in ddsample.c, written by Brian Paul and found by me
11 in Mesa 3.4.2.
12
13
14
15 Legal:
16 ~~~~~~
17
18 Mesa copyright applies, provided this package is used within Mesa. For anything
19 else, see GPL.
20
21
22
23 Installation:
24 ~~~~~~~~~~~~~
25
26 Unzip and type:
27
28 make -f Makefile.DJ [OPTIONS...]
29
30 Available options:
31
32 Environment variables:
33 CPU optimize for the given processor.
34 default = k6
35 GLU=[mesa|sgi] specify GLU directory; can be `sgi' (requires GNU/C++)
36 or `mesa'.
37 default = mesa
38 GLIDE path to Glide3 SDK include files; used with FX.
39 default = $(TOP)/include/glide3
40 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
52 capabilities are checked at run-time to avoid crashes.
53 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
69 Tested on:
70 CPU: AMD Duron @800 MHz
71 Mainboard: EP-8KTA3 w/ 128 MB SDRAM
72 Video card: Voodoo5 5500 AGP w/ 64 MB SDRAM
73 DJGPP: djdev 2.04 + gcc v3.2.2 + make v3.79.1
74 OS: DOS and Win98SE
75
76
77
78 FAQ:
79 ~~~~
80
81 1. Compilation
82
83 Q) I tried to run `make' and it exits because `gcc' complains it cannot find
84 some stupid file.
85 A) You need LFN support.
86 A) When compiling for Glide (FX=1), pay attention to Glide path.
87
88 Q) Libraries built OK, but linker complains about `vsnprintf' every time I
89 compile some demo.
90 A) Upgrade to DJGPP 2.04.
91 A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!).
92 A) The following hack should be safe in 90% of the cases, but if anything
93 goes wrong, don't come back to me crying. Anyway, patch `src/imports.c'
94 with the following line:
95 #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg)
96
97 Q) `make' complains about DXE3 or something, yet it builds the libraries.
98 A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest
99 DJGPP distro, or download the separate package from my web page. Read the
100 DXE3 documentation on how to use them.
101 A) When compiling for Glide (FX=1), make sure `glid3.dxe' can be found in
102 LD_LIBRARY_PATH (or top `lib' directory).
103
104 2. Using Mesa for DJGPP
105
106 Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
107 A) Is that a question? If you have a 3dfx Voodoo Banshee or higher card,
108 you're lucky (check http://sourceforge.net/projects/glide for the DJGPP
109 port). If you have a Matrox Millennium I card, you just MIGHT be lucky...
110 If you haven't, sorry; everything is done in software. Suggestions?
111
112 Q) I tried to set refresh rate w/ DMesa, but without success.
113 A) Refresh rate control works only for VESA 3.0. If you were compiling for
114 Glide, see Glide info. If not, sorry!
115
116 Q) I made a simple application and it does nothing. It exits right away. Not
117 even a blank screen.
118 A) The pure software drivers (VESA/VGA) support only double-buffered modes.
119 A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
120 lazy programmer and I found that the easiest way to keep buffer handling
121 at peak performance ;-).
122
123 Q) My demo doesn't display text. I know I used the GLUT font routines!
124 A) Then you probably use GLUT as a DXE. Well, there is no direct access to
125 variables due to the way DXE works. Read the documentation. The author of
126 GLUT took this into account for _WIN32 DLL's only; I don't want to modify
127 his headers. The only workaround is to link GLUT the old way :-(
128
129 Q) The GLUT is incomplete.
130 A) See below.
131
132
133
134 libGLUT (the toolkit):
135 ~~~~~~~~~~~~~~~~~~~~~~
136
137 Well, this "skeletal" GLUT implementation was taken from AllegGL project and
138 heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian
139 Paul and probably others (or probably not ;-). GLUT functionality will be
140 extended only on an "as needed" basis.
141
142 GLUT talks to hardware via PC_HW package which was put together from various
143 pieces I wrote long time ago. It consists from the keyboard, mouse and timer
144 drivers.
145
146 My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
147 I borrowed the translation tables (and maybe more) from Allegro -- many thanks
148 to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
149 will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
150 turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
151 NB: since the DJGPP guys ensured signal handlers won't go beyond program's
152 space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
153 can, but it is useless), therefore you must live with the 'Exiting due to
154 signal SIGINT' message...
155
156 The mouse driver is far from complete (lack of drawing, etc), but is enough to
157 make almost all the demos work. Supports the CuteMouse WheelAPI.
158
159 The timer is pretty versatile for it supports multiple timers with different
160 frequencies. While not being the most accurate timer in the known universe, I
161 think it's OK. Take this example: you have timer A with a very high rate, and
162 then you have timer B with very low rate compared to A; now, A ticks OK, but
163 timer B will probably loose precision!
164
165 As an addition, stdout and stderr are redirected and dumped upon exit. This
166 means that `printf' can be safely called during graphics. A bit of a hack, I
167 know, because all messages come in bulk, but I think it's better than nothing.
168 "Borrowed" from LIBRHUTI (Robert Hoehne).
169
170 Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum,
171 8-bit stencil. However, the video mode is chosen in such a way that first
172 window will fit. If you need high resolution with small windows, set initial
173 position far to the right (or way down); then you can move them back to any
174 position right before the main loop.
175
176 The following environment variables can customize GLUT behaviour:
177 DMESA_GLUT_REFRESH - set vertical screen refresh rate (VESA3)
178 DMESA_GLUT_BPP - set default bits per pixel (VGA needs 8)
179 GLUT_FPS - print frames/second statistics to stderr
180
181
182
183 History:
184 ~~~~~~~~
185
186 v1.0 (mar-2002)
187 initial release
188
189 v1.1 (sep-2002)
190 + added 3dfx Glide3 support
191 + added refresh rate control
192 + added fonts in GLUT
193 * lots of minor changes
194
195 v1.2 (nov-2002)
196 * synced w/ Mesa-4.1
197 - removed dmesadxe.h
198
199 v1.3 (mar-2003)
200 + enabled OpenGL 1.4 support
201 + added MMX clear/blit routines
202 + enabled SGI's GLU compilation
203 + added samples makefile
204 + added new GLUT functions
205 + added color-index modes
206 + added Matrox Millennium MGA2064W driver
207 + added 8bit FakeColor (thanks to Neil Funk)
208 + added VGA support (to keep Ben Decker happy)
209 ! fixed some compilation errors (reported by Chan Kar Heng)
210 * optimized driver for faster callback access... yeah, right :)
211 * overhauled virtual buffer and internal video drivers
212 * better fxMesa integration
213 * revamped GLUT
214 * switched to DXE3
215
216 v1.4 (jun-2003)
217 * accomodated makefiles with the new sourcetree
218
219
220
221 Contact:
222 ~~~~~~~~
223
224 Name: Borca Daniel
225 E-mail: dborca@yahoo.com
226 WWW: http://www.geocities.com/dborca/