1 Mesa 4.0 DOS/DJGPP Port v1.1
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 Well, guess what... this is the DOS port of Mesa 4.0.3, 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.03 + gcc v3.1 + 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) If FX is defined, 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 couln'd 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.
97 Q) Okay, DXE2 modules are built. How can I use them?
98 A) Usage of the dynamic modules requires three things:
99 - include DMESADXE.H in one of the sources, so references inside
100 dynamic modules will get resolved (or use `-include' directive).
101 - link against import libraries (libI*.a) and LIBDL.A, which will do
102 the dynamic linkage job for you
103 - put the DXEs somewhere along the library path (LD_LIBRARY_PATH) or
104 in the current directory
106 gcc -o OUT.exe -include dmesadxe.h IN.c -ligl -liglu -liglut -ldl
108 Q) The application dies with "Abort!" due to unresolved symbols.
109 A) This is bad! Extract the unresolved symbol list from this module. For
111 dxe2gen --show-unres gl.dxe > u
112 Check DMESADXE.H; the symbols in `u' must either be present here or be
113 exported from another module that has to be loaded before your faulting
116 3. Using Mesa for DJGPP
118 Q) Does this build work in Win9x?
121 Q) Does it work under NT (W2k, XP) core?
122 A) Uh... probably not!
124 Q) I made a simple application and it does nothing. It exits right away. Not
126 A) The current version supports only RGB[A] modes, for it made no sense to
127 me to endorse color-index (aka palette) modes.
128 A) Single-buffered is not allowed at all. Until I can find a way to use
129 *REAL* hardware acceleration, it won't get implemented.
130 A) Another weird "feature" is that buffer width must be multiple of 4 (I'm a
131 lazy programmer and I found that the easiest way to keep buffer handling
132 at peak performance ;-).
134 Q) My demo doesn't display text. I know I used the glut font routines!
135 A) Then you probably use GLUT as a DXE. Well, there is no direct access to
136 variables due to the way DXE works. Read the documentation. The author of
137 GLUT took this into account for _WIN32 DLL's only; I don't want to modify
138 his headers. The only workaround is to link GLUT the old way :-(
140 Q) The DJGPP port of Mesa is so SLOOOW! The Win32 OpenGL performs so much
142 A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The
143 Glide port is on my web page. If you haven't, sorry; everything is done
144 in software. Suggestions?
146 Q) I have a super/mega/ultra monitor and all you can do is 60Hz? My eyes are
147 leaking from the orbits...
148 A) If you were compiling for Glide, see Glide info. If not, be aware that
149 refresh rate control works only for VESA 3.0. The environment variable
150 DMESA_REFRESH sets the default screen refresh. For example:
155 libGLUT (the toolkit):
156 ~~~~~~~~~~~~~~~~~~~~~~
158 Well, this "skeletal" GLUT implementation is not mine. Thanks should go to
159 Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably
160 not ;-). I only changed it to be self-standing (Allegro-free). The keyboard,
161 mouse and timer drivers were inspired from an old project of mine (D3Xl) and
162 fixed with many Allegro "infusions"; I deeply thank to Shawn Hargreaves et co.
164 My keyboard driver used only scancodes, but since GLUT requires ASCII values
165 for keys, I borrowed the translation tables (and maybe more) from Allegro.
166 Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT
167 engine unconditionally: it will raise SIGINT, which in turn will call the
168 destructors (let's hope), thus cleaning up your/my mess ;-) NB: since the
169 DJGPP guys ensured signal handlers won't go beyond program's space (and since
170 dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is
171 useless), therefore you must live with the 'Exiting due to signal SIGINT'
174 The mouse driver is far from complete (lack of positioning, drawing, etc),
175 but is enough to make almost all the demos work.
177 The timer is pretty versatile for it supports multiple timers with different
178 frequencies. It may not be the most accurate timer in the known universe, but
179 I think it's OK. Take this example: you have timer A with a very high rate,
180 and then you have timer B with very low rate compared to A; now, A ticks OK,
181 but timer B will probably loose precision!
183 As an addition, stdout and stderr are redirected and dumped upon exit. This
184 means that printf can be safely called during graphics, but all messages come
185 in bulk! A bit of a hack, I know, but I think it's better than to miss them
186 at all. "Borrowed" from RHIDE (Robert Hoehne) or SETEDIT (Salvador Eduardo
187 Tropea)... I'm not sure.
189 Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.
190 However, the video mode is chosen in such a way that first window will fit.
197 v1.0 mar-2002 initial release
198 v1.1 sep-2002 + added 3dfx Glide3 support
199 + added refresh rate control
200 + added fonts in glut
201 * lots of minor changes
209 E-mail: dborca@yahoo.com
210 WWW: http://www.geocities.com/dborca/