DOS and glide driver updates from Daniel Borca
[mesa.git] / docs / README.DJ
index c4a274cedf0fec946ade6833f262dc410bf0b9fa..0ca479163ff5f5be464a201345d21ee5e8a88c1d 100644 (file)
-                   Mesa 4.0.1 DOS/DJGPP Port version 0.1\r
-                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-\r
-\r
-\r
-First of all...\r
-~~~~~~~~~~~~~~~\r
-\r
-This is a DOS port for MESA 4.0.1. I didn't bother to consider any DOS C\r
-compiler other than gcc, so this port was written using DJGPP v2. To be more\r
-precise:\r
-       djdev 2.03\r
-       gcc v3.0.3\r
-       make v3.79\r
-\r
-Almost all demos were compiled and ran succesfully on my system:\r
-       CPU:            Intel Pentium w/ MMX @166 MHz\r
-       Mainboard:      ViA Apollo VP2 w/ 128 MB SDRAM\r
-       Video card:     Matrox Millenium I w/ 4096 kB WRAM, Matrox BIOS v3.0\r
-\r
-Since I don't have access to any accelerated video hardware, this port is\r
-entirely based on VESA/SuperVGA. My little attempt to use FreeBE/AF ended in\r
-a failure, but that's another story: it seemed to work fine with my older\r
-Matrox Millenium w/ 2MB, and then I got another Matrox Millenium w/ 4MB. The\r
-problem with latter was it had a dead BIOS; I hot-flashed it and made it work\r
-in all environments (Windows 95, VESA, etc) but FreeBE/AF.\r
-\r
-\r
-\r
-Legal:\r
-~~~~~~\r
-\r
-This software is distributed under the terms of the GNU Lesser General Public\r
-License.\r
-\r
-Source code written by others is subject to its respective copyright.\r
-\r
-\r
-\r
-libGL (the core):\r
-~~~~~~~~~~~~~~~~~\r
-\r
-Of course, MESA 4.0.1 core sources are required. It will probably work with\r
-MESA 3.5, but not a chance with earlier versions due to major changes to the\r
-MESA driver interface and the directory tree. All should compile succesfully.\r
-\r
-The driver has its origins in ddsample.c, written by Brian Paul and found by\r
-me in MESA 3.4.2. I touched almost all the functions, changing the coding\r
-style ;-( Sorry!\r
-\r
-Pitfalls:\r
-1. The current version supports only RGB[A] modes, for it made no sense to me\r
-   to endorse color-index (aka palette) modes.\r
-2. Only double-buffered is allowed because it was simpler to implement at\r
-   that moment. Single-buffered will appear soon, especially if I can find a\r
-   way to use hardware acceleration.\r
-3. Another weird "feature" is that buffer width & height must be multiple of\r
-   4 (I'm a lazy programmer and I found that the easiest way to keep buffer\r
-   handling at peak performance ;-).\r
-4. The video mode selector is tricky: it searches for the smallest mode which\r
-   will entirely contain the buffer at its current position. If you want a\r
-   small buffer in a high-res mode, try to position it very far to the right\r
-   (or down). I'd really use some ideas here!!!\r
-\r
-\r
-\r
-libGLU:\r
-~~~~~~~\r
-\r
-Mesa GLU sources are required. Everything should run smooth.\r
-\r
-\r
-\r
-libGLUT (the toolkit):\r
-~~~~~~~~~~~~~~~~~~~~~~\r
-\r
-Well, this "skeletal" GLUT implementation is not mine. Thanks should go to\r
-Bernhard Tschirren, Mark Kilgard, Brian Paul and probably others (or probably\r
-not ;-). I only changed it to be self-standing (Allegro-free). The keyboard,\r
-mouse and timer drivers were inspired from an old project of mine (D3Xl) and\r
-fixed with some Allegro "infusions"; my deeply thanks to Shawn Hargreaves and\r
-co.\r
-\r
-My keyboard driver used only scancodes, but since GLUT requires ASCII values\r
-for keys, I borrowed the translation tables (and maybe more) from Allegro.\r
-Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users) will shut down the GLUT\r
-engine unconditionally: it will raise SIGINT, which in turn will call the\r
-destructors (let's hope), thus cleaning up your/my mess ;-)\r
-\r
-The mouse driver is far from complete (lack of positioning, drawing, etc),\r
-but is enough to make almost all the demos work.\r
-\r
-The timer is pretty versatile for it supports multiple timers with different\r
-frequencies. It may not be the most accurate timer in the known universe, but\r
-I think it's OK. Take this example: you have timer A with a very high rate,\r
-and then you have timer B with very low rate compared to A; now, A ticks OK,\r
-but timer B will probably loose precision!\r
-\r
-As an addition, stdout and stderr are redirected and dumped upon exit. This\r
-means that printf can be safely called during graphics, but all messages come\r
-in bulk! A bit of a hack, I know, but I think it's better than to miss them\r
-at all.\r
-\r
-Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.\r
-\r
-\r
-\r
-Installation:\r
-~~~~~~~~~~~~~\r
-\r
-Unzip into the MESA directory, and type "make -f Makefile.DJ" to compile all\r
-libraries. Long filename support is required during compilation. The examples\r
-are not built automagically (see Pitfalls above).\r
-\r
-\r
-\r
-History:\r
-~~~~~~~~\r
-\r
-v0.1   feb-2002        initial release\r
-v0.2   ..soon..\r
-\r
-\r
-\r
-Contact:\r
-~~~~~~~~\r
-\r
-Name:   Borca Daniel\r
-E-mail: dborca@yahoo.com\r
-WWW:    http://www.geocities.com/dborca/\r
+                       Mesa 5.0.1 DOS/DJGPP Port v1.4
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+Description:
+~~~~~~~~~~~~
+
+Well, guess what... this is the DOS port of Mesa 5.0.1, for DJGPP fans... Whoa!
+The driver has its origins in ddsample.c, written by Brian Paul and found by me
+in Mesa 3.4.2.
+
+
+
+Legal:
+~~~~~~
+
+Mesa copyright applies, provided this package is used within Mesa. For anything
+else, see GPL.
+
+
+
+Installation:
+~~~~~~~~~~~~~
+
+Unzip and type:
+
+       make -f Makefile.DJ [OPTIONS...]
+
+Available options:
+
+     Environment variables:
+       CPU             optimize for the given processor.
+                       default = pentium
+       GLU=[mesa|sgi]  specify GLU directory; can be `sgi' (requires GNU/C++)
+                       or `mesa'.
+                       default = mesa
+       GLIDE           path to Glide3 SDK; used with FX.
+                       default = $(TOP)/glide3
+       FX=1            build for 3dfx Glide3. Note that this disables
+                       compilation of most DMesa code and requires fxMesa.
+                       As a consequence, you'll need the DJGPP Glide3
+                       library to build any application.
+                       default = no
+       MATROX=1        build for Matrox Millennium I (MGA2064W) cards.
+                       This is experimental and not intensively tested.
+                       default = no
+       HAVE_X86=1      optimize for i386.
+                       default = no
+       HAVE_MMX=1      allow MMX specializations, provided your assembler
+                       supports MMX instruction set. However, the true CPU
+                       capabilities are checked at run-time to avoid lockups.
+                       default = no
+       HAVE_SSE=1      (see HAVE_MMX)
+                       default = no
+       HAVE_3DNOW=1    (see HAVE_MMX)
+                       default = no
+
+     Targets:
+       all:            build everything
+       libgl:          build GL
+       libglu:         build GLU
+       libglut:        build GLUT
+       clean:          remove object files
+       realclean:      remove all generated files
+
+
+
+Tested on:
+       CPU:            AMD Athlon XP 1800+
+       Mainboard:      EP-8KTA3 w/ 128 MB SDRAM
+       Video card:     Voodoo5 5500 AGP w/ 64 MB SDRAM
+       DJGPP:          djdev 2.04 + gcc v3.2.2 + make v3.80
+       OS:             DOS and Win98SE
+
+
+
+FAQ:
+~~~~
+
+1. Compilation
+
+   Q) `make' barfs and exits because it cannot find some stupid file.
+   A) You need LFN support.
+   A) When compiling for Glide (FX=1), pay attention to Glide path.
+
+   Q) Libraries built OK, but linker complains about `vsnprintf' every time I
+      compile some demo.
+   A) Upgrade to DJGPP 2.04.
+   A) Add `vsnprintf.c' to the CORE_SOURCES in `src/Makefile.DJ' (untested!).
+   A) Patch `src/mesa/main/imports.c' with the following line:
+       #define vsnprintf(buf, max, fmt, arg) vsprintf(buf, fmt, arg)
+      This hack should be safe in 90% of the cases, but if anything goes wrong,
+      don't come back to me crying.
+
+   Q) `make' complains about DXE3 or something, yet it builds the libraries.
+   A) DXE3 refers to the DJGPP dynamic modules. You'll need either the latest
+      DJGPP distro, or download the separate package from my web page. Read the
+      DXE3 documentation on how to use them.
+   A) When compiling for Glide (FX=1), make sure `glid3.dxe' can be found in
+      LD_LIBRARY_PATH (or top `lib' directory).
+
+2. Using Mesa for DJGPP
+
+   Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
+   A) Is that a question? If you have a 3dfx Voodoo Banshee or higher card,
+      you're lucky (check http://sourceforge.net/projects/glide for the DJGPP
+      port). If you have a Matrox Millennium I card, you just MIGHT be lucky...
+      If you haven't, sorry; everything is done in software. Suggestions?
+
+   Q) I tried to set refresh rate w/ DMesa, but without success.
+   A) Refresh rate control works only for VESA 3.0. If you were compiling for
+      Glide, see Glide info. If not, sorry!
+
+   Q) I made a simple application and it does nothing. It exits right away. Not
+      even a blank screen.
+   A) The pure software drivers (VESA/VGA) support only double-buffered modes.
+   A) Another weird "feature" is that buffer width must be multiple of 8 (I'm a
+      lazy programmer and I found that the easiest way to keep buffer handling
+      at peak performance ;-).
+
+   Q) The GLUT is incomplete.
+   A) See below.
+
+
+
+libGLUT (the toolkit):
+~~~~~~~~~~~~~~~~~~~~~~
+
+Well, this "skeletal" GLUT implementation was taken from AllegGL project and
+heavily changed. Thanks should go to Bernhard Tschirren, Mark Kilgard, Brian
+Paul and probably others (or probably not ;-). GLUT functionality will be
+extended only on an "as needed" basis.
+
+GLUT talks to hardware via PC_HW package which was put together from various
+pieces I wrote long time ago. It consists from the keyboard, mouse and timer
+drivers.
+
+My keyboard driver used only scancodes; as GLUT requires ASCII values for keys,
+I borrowed the translation tables (and maybe more) from Allegro -- many thanks
+to Shawn Hargreaves et co. Ctrl-Alt-Del (plus Ctrl-Alt-End, for Windows users)
+will shut down the GLUT engine unconditionally: it will raise SIGINT, which in
+turn will (hopefully) call the destructors, thus cleaning up your/my mess ;-)
+NB: since the DJGPP guys ensured signal handlers won't go beyond program's
+space (and since dynamic modules shall) the SIGINT can't be hooked (well, it
+can, but it is useless), therefore you must live with the 'Exiting due to
+signal SIGINT' message...
+
+The mouse driver is far from complete (lack of drawing, etc), but is enough to
+make almost all the demos work. Supports the CuteMouse WheelAPI.
+
+The timer is pretty versatile for it supports multiple timers with different
+frequencies. While not being the most accurate timer in the known universe, I
+think it's OK. Take this example: you have timer A with a very high rate, and
+then you have timer B with very low rate compared to A; now, A ticks OK, but
+timer B will probably loose precision!
+
+As an addition, stdout and stderr are redirected and dumped upon exit. This
+means that `printf' can be safely called during graphics. A bit of a hack, I
+know, because all messages come in bulk, but I think it's better than nothing.
+"Borrowed" from LIBRHUTI (Robert Hoehne).
+
+Window creating defaults: 300x300x16 at (0,0), 16-bit depth, 16-bit accum,
+8-bit stencil. However, the video mode is chosen in such a way that first
+window will fit. If you need high resolution with small windows, set initial
+position far to the right (or way down); then you can move them back to any
+position right before the main loop.
+
+The following environment variables can customize GLUT behaviour:
+       GLUT_FPS                - print frames/second statistics to stderr
+       DMESA_GLUT_REFRESH      - set vertical screen refresh rate (VESA3)
+       DMESA_GLUT_BPP          - set default bits per pixel (VGA needs 8)
+       DMESA_GLUT_DEPTH        - set default depth bits
+       DMESA_GLUT_STENCIL      - set default stencil bits
+       DMESA_GLUT_ACCUM        - set default accum bits
+
+
+
+History:
+~~~~~~~~
+
+v1.0 (mar-2002)
+       initial release
+
+v1.1 (sep-2002)
+       + added 3dfx Glide3 support
+       + added refresh rate control
+       + added fonts in GLUT
+       * lots of minor changes
+
+v1.2 (nov-2002)
+       * synced w/ Mesa-4.1
+       - removed dmesadxe.h
+
+v1.3 (mar-2003)
+       + enabled OpenGL 1.4 support
+       + added MMX clear/blit routines
+       + enabled SGI's GLU compilation
+       + added samples makefile
+       + added new GLUT functions
+       + added color-index modes
+       + added Matrox Millennium MGA2064W driver
+       + added 8bit FakeColor (thanks to Neil Funk)
+       + added VGA support (to keep Ben Decker happy)
+       ! fixed some compilation errors (reported by Chan Kar Heng)
+       * optimized driver for faster callback access... yeah, right :)
+       * overhauled virtual buffer and internal video drivers
+       * better fxMesa integration
+       * revamped GLUT
+       * switched to DXE3
+
+v1.4 (aug-2003)
+       + enabled fonts with DXE
+       + truly added multi-window support in GLUT
+       * accomodated makefiles with the new sourcetree
+       * hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
+
+
+
+Contact:
+~~~~~~~~
+
+Name:   Borca Daniel
+E-mail: dborca@users.sourceforge.net
+WWW:    http://www.geocities.com/dborca/