580228234abb8442ea6032ef27f86ef0ae96e083
[mesa.git] / docs / README.DJ
1 Mesa 5.0 DOS/DJGPP Port v1.3
2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3
4
5
6 Description:
7 ~~~~~~~~~~~~
8
9 Well, guess what... this is the DOS port of Mesa 5.0, 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 BIG_OPT=1 crazy optimizations; not very useful, though...
36 default = no
37 SGI_GLU=1 build SGI's GLU instead of Mesa's.
38 default = no
39 GLIDE absolute path to Glide library; used with FX.
40 default = $(TOP)/include/glide3
41 FX=1 build for 3dfx Glide3; use it if you have the Glide
42 SDK (designed for your platform), and, of course, a
43 3dfx card... Note that this disables compilation of
44 actual DMesa code, as Glide does all the stuff!
45 default = no
46 HAVE_X86=1 optimize for i386.
47 default = no
48 HAVE_MMX=1 MMX instructions; use only if you assembler/compiler
49 supports MMX instruction set; backwards compatibility
50 with older processors is still preserved.
51 default = no
52 HAVE_SSE=1 (see HAVE_MMX)
53 default = no
54 HAVE_3DNOW=1 (see HAVE_MMX)
55 default = no
56
57 Targets:
58 all: build everything
59 libgl: build GL
60 libglu: build GLU
61 libglut: build GLUT
62 clean: remove object files
63 realclean: remove all generated files
64
65
66
67 Tested on:
68 CPU: K6-2 (CXT) @500(412.5) MHz
69 Mainboard: ViA Apollo VP2/97 w/ 128 MB SDRAM
70 Video card: PowerColor EvilKing3 (Voodoo3 3000 PCI) w/ 16 MB SDRAM
71 DJGPP: djdev 2.04 + gcc v3.2 + make v3.79.1
72 OS: DOS and Win9x
73
74
75
76 FAQ:
77 ~~~~
78
79 1. Compilation
80
81 Q) I tried to run `make' and it exits because `gcc' complains it cannot find
82 some stupid file.
83 A) You need LFN support.
84 A) When compiling for Glide (FX=1), pay attention to Glide path.
85
86 2. Dynamic modules
87
88 Q) What are you mumbling about dynamic modules?
89 A) You must have the DXE3 package (available on my site) installed in order
90 to build the dynamic modules.
91
92 Q) DXE3 modules give me headaches...
93 A) The DXE3 modules are not compulsory. The static libraries are still built
94 and you can use them in the old-fashioned, classic way... and learn to
95 live with your huge executable size. For example:
96 gcc -o OUT.exe IN.c -lglut -lglu -lgl
97
98 Q) Okay, DXE3 modules are built. How can I use them?
99 A) Build your export object file; then link it with your application.
100 For example:
101 dxe3res -o dmesadxe.c gl.dxe glu.dxe glut.dxe
102 gcc -o dmesadxe.o -c -fno-builtin dmesadxe.c
103 gcc -o OUT.exe dmesadxe.o IN.c -liglut -liglu -ligl -ldl
104
105 3. Using Mesa for DJGPP
106
107 Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
108 A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The
109 Glide port is on my web page. If you haven't, sorry; everything is done
110 in software. Suggestions?
111
112 Q) I made a simple application and it does nothing. It exits right away. Not
113 even a blank screen.
114 A) Single-buffered is not allowed at all. Until I can find a way to use
115 *REAL* hardware acceleration, it won't get implemented.
116 A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
117 lazy programmer and I found that the easiest way to keep buffer handling
118 at peak performance ;-).
119
120 Q) My demo doesn't display text. I know I used the glut font routines!
121 A) Then you probably use GLUT as a DXE. Well, there is no direct access to
122 variables due to the way DXE works. Read the documentation. The author of
123 GLUT took this into account for _WIN32 DLL's only; I don't want to modify
124 his headers. The only workaround is to link GLUT the old way :-(
125
126 Q) I tried to set refresh rate w/ DMesa, but without success.
127 A) Refresh rate control works only for VESA 3.0. If you were compiling for
128 Glide, see Glide info. If not, sorry!
129
130 Q) The GLUT is incomplete.
131 A) See below.
132
133
134
135 libGLUT (the toolkit):
136 ~~~~~~~~~~~~~~~~~~~~~~
137
138 Well, this "skeletal" GLUT implementation is not mine. Thanks should go to
139 Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably
140 not ;-). GLUT functionality will be extended only on an "as needed" basis.
141
142 My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
143 I borrowed the translation tables (and maybe more) from Allegro -- many thanks
144 to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
145 will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
146 turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
147 NB: since the DJGPP guys ensured signal handlers won't go beyond program's
148 space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
149 can, but it is useless), therefore you must live with the 'Exiting due to
150 signal SIGINT' message...
151
152 The mouse driver is far from complete (lack of positioning, drawing, etc), but
153 is enough to make almost all the demos work.
154
155 The timer is pretty versatile for it supports multiple timers with different
156 frequencies. While not being the most accurate timer in the known universe, I
157 think it's OK. Take this example: you have timer A with a very high rate, and
158 then you have timer B with very low rate compared to A; now, A ticks OK, but
159 timer B will probably loose precision!
160
161 As an addition, stdout and stderr are redirected and dumped upon exit. This
162 means that `printf' can be safely called during graphics. A bit of a hack, I
163 know, because all messages come in bulk, but I think it's better than nothing.
164 "Borrowed" from LIBRHUTI (Robert Hoehne).
165
166 Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.
167 However, the video mode is chosen in such a way that first window will fit. If
168 you need high resolution with small windows, try to place them far to the right
169 (or way down).
170
171 The following environment variables can customize GLUT behaviour:
172 DMESA_GLUT_REFRESH - set vertical screen refresh rate
173 DMESA_GLUT_BPP - set default bits per pixel
174
175
176
177 History:
178 ~~~~~~~~
179
180 v1.0 (mar-2002)
181 initial release
182
183 v1.1 (sep-2002)
184 + added 3dfx Glide3 support
185 + added refresh rate control
186 + added fonts in GLUT
187 * lots of minor changes
188
189 v1.2 (nov-2002)
190 * synced w/ Mesa-4.1
191 - removed dmesadxe.h
192
193 v1.3 (dec-2002)
194 + enabled OpenGL 1.4 support
195 + added MMX clear/blit routines
196 + enabled SGI's GLU compilation
197 + added color-index modes
198 + added 8bit FakeColor (thanks to Neil Funk)
199 + added VGA support (to keep Ben Decker happy)
200 * fixed GLUT compilation error (reported by Chan Kar Heng)
201 * overhauled virtual buffer and internal video drivers
202 * better fxMesa integration
203 * extended GLUT functionality
204 * switched to DXE3
205
206
207
208 Contact:
209 ~~~~~~~~
210
211 Name: Borca Daniel
212 E-mail: dborca@yahoo.com
213 WWW: http://www.geocities.com/dborca/