1 Mesa 4.1 DOS/DJGPP Port v1.2
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 Well, guess what... this is the DOS port of Mesa 4.1, for DJGPP fans... Whoa!
10 The driver has its origins in ddsample.c, written by Brian Paul and found by me
18 Mesa copyright applies, provided this package is used within Mesa. For anything
28 make -f Makefile.DJ [OPTIONS...]
32 Environment variables:
33 CPU optimize for the given processor.
35 BIG_OPT=1 crazy optimizations; not very useful, though...
37 GLIDE absolute path to Glide library; used with FX.
38 default = $(TOP)/include/glide3
39 FX=1 build for 3dfx Glide3; use it if you have the Glide
40 SDK (designed for your platform), and, of course, a
41 3dfx card... Note that this disables compilation of
42 actual DMesa code, as Glide does all the stuff!
44 HAVE_X86=1 optimize for i386.
46 HAVE_MMX=1 MMX instructions; use only if you assembler/compiler
47 supports MMX instruction set; backwards compatibility
48 with older processors is still preserved.
50 HAVE_SSE=1 (see HAVE_MMX)
52 HAVE_3DNOW=1 (see HAVE_MMX)
60 clean: remove object files
61 realclean: remove all generated files
66 CPU: K6-2 (CXT) @500(412.5) MHz
67 Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM
68 Video card: PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM
69 DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1
78 Q) I tried to run `make' and it exits because `gcc' complains it cannot find
80 A) You need LFN support.
81 A) When compiling for Glide (FX=1), pay attention to Glide path.
85 Q) What are you mumbling about dynamic modules?
86 A) You must have the DXE2 package (available on SimTel.Net, courtesy of
87 Andrew Zabolotny) installed in order to build the dynamic modules.
89 Q) I have DXE2, but I couldn't build the `dxe2gen.exe'.
90 Q) I built `dxe2gen.exe', but it doesn't do the job right.
91 A) There is a patched version on my web page.
93 Q) DXE2 modules give me headaches...
94 A) The DXE2 modules are not compulsory. The static libraries are still built
95 and you can use them in the old-fashioned, classic way... and learn to
96 live with your ~2MB executable size. For example:
97 gcc -o OUT.exe IN.c -lglut -lglu -lgl
99 Q) Okay, DXE2 modules are built. How can I use them?
100 A) Build your export object file; then link it with your application.
102 dxe2res -o dmesadxe.c gl.dxe glu.dxe glut.dxe
103 gcc -o dmesadxe.o dmesadxe.c
104 gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl
106 Q) What is that `dxe2res.exe' thing?
107 A) That is an utility that generates the export file for a given set of
108 modules. If you can't find it in the DXE2 package, you must be looking at
111 3. Using Mesa for DJGPP
113 Q) Does this build work in Win9x?
116 Q) Does it work under NT (W2k, XP) core?
117 A) Uh... probably not!
119 Q) I made a simple application and it does nothing. It exits right away. Not
121 A) The current version supports only RGB[A] modes, for it made no sense to
122 me to endorse color-index (aka palette) modes.
123 A) Single-buffered is not allowed at all. Until I can find a way to use
124 *REAL* hardware acceleration, it won't get implemented.
125 A) Another weird "feature" is that buffer width must be multiple of 4 (I'm a
126 lazy programmer and I found that the easiest way to keep buffer handling
127 at peak performance ;-).
129 Q) My demo doesn't display text. I know I used the glut font routines!
130 A) Then you probably use GLUT as a DXE. Well, there is no direct access to
131 variables due to the way DXE works. Read the documentation. The author of
132 GLUT took this into account for _WIN32 DLL's only; I don't want to modify
133 his headers. The only workaround is to link GLUT the old way :-(
135 Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much
137 A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The
138 Glide port is on my web page. If you haven't, sorry; everything is done
139 in software. Suggestions?
141 Q) I have a super/mega/ultra monitor and all you can do is 60Hz? My eyes are
142 leaking from the orbits...
143 A) If you were compiling for Glide, see Glide info. If not, be aware that
144 refresh rate control works only for VESA 3.0. The environment variable
145 DMESA_REFRESH sets the default screen refresh. For example:
150 libGLUT (the toolkit):
151 ~~~~~~~~~~~~~~~~~~~~~~
153 Well, this "skeletal" GLUT implementation is not mine. Thanks should go to
154 Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably
155 not ;-). I only changed it to be self-standing (Allegro-free). The keyboard,
156 mouse and timer drivers were inspired from an old project of mine (D3Xl) and
157 fixed with many Allegro "infusions"; I deeply thank to Shawn Hargreaves et co.
159 My keyboard driver used only scancodes, but since GLUT requires ASCII values
160 for keys, I borrowed the translation tables (and maybe more) from Allegro.
161 Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT
162 engine unconditionally: it will raise SIGINT, which in turn will call the
163 destructors (let's hope), thus cleaning up your/my mess ;-) NB: since the
164 DJGPP guys ensured signal handlers won't go beyond program's space (and since
165 dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is
166 useless), therefore you must live with the 'Exiting due to signal SIGINT'
169 The mouse driver is far from complete (lack of positioning, drawing, etc),
170 but is enough to make almost all the demos work.
172 The timer is pretty versatile for it supports multiple timers with different
173 frequencies. It may not be the most accurate timer in the known universe, but
174 I think it's OK. Take this example: you have timer A with a very high rate,
175 and then you have timer B with very low rate compared to A; now, A ticks OK,
176 but timer B will probably loose precision!
178 As an addition, stdout and stderr are redirected and dumped upon exit. This
179 means that printf can be safely called during graphics, but all messages come
180 in bulk! A bit of a hack, I know, but I think it's better than to miss them
181 at all. "Borrowed" from RHIDE (Robert Hoehne) or SETEDIT (Salvador Eduardo
182 Tropea)... I'm not sure.
184 Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.
185 However, the video mode is chosen in such a way that first window will fit.
192 v1.0 mar-2002 initial release
194 v1.1 sep-2002 + added 3dfx Glide3 support
195 + added refresh rate control
196 + added fonts in glut
197 * lots of minor changes
199 v1.2 nov-2002 * synced w/ Mesa-4.1
208 E-mail: dborca@yahoo.com
209 WWW: http://www.geocities.com/dborca/