Merge remote branch 'vdpau/pipe-video' into pipe-video
[mesa.git] / docs / README.DJ
index 444fe8947c55ccfe02c2469ccaa6773c32243ac6..5f783ac53fb7f20421f7e20744c5072887350c11 100644 (file)
-                       Mesa 4.0 DOS/DJGPP Port v1.1\r
-                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
-\r
-\r
-\r
-Description:\r
-~~~~~~~~~~~~\r
-\r
-Well, guess what... this is the DOS port of Mesa 4.0.3, for DJGPP fans... Whoa!\r
-The driver has its origins in ddsample.c, written by Brian Paul and found by me\r
-in Mesa 3.4.2.\r
-\r
-\r
-\r
-Legal:\r
-~~~~~~\r
-\r
-Mesa copyright applies, provided this package is used within Mesa. For anything\r
-else, see GPL.\r
-\r
-\r
-\r
-Installation:\r
-~~~~~~~~~~~~~\r
-\r
-Unzip and type:\r
-\r
-       make -f Makefile.DJ [OPTIONS...]\r
-\r
-Available options:\r
-\r
-     Environment variables:\r
-       CPU             optimize for the given processor.\r
-                       default = k6\r
-       BIG_OPT=1       crazy optimizations; not very useful, though...\r
-                       default = no\r
-       GLIDE           absolute path to Glide library; used with FX.\r
-                       default = $(TOP)/include/glide3\r
-       FX=1            build for 3dfx Glide3; use it if you have the Glide\r
-                       SDK (designed for your platform), and, of course, a\r
-                       3dfx card... Note that this disables compilation of\r
-                       actual DMesa code, as Glide does all the stuff!\r
-                       default = no\r
-       HAVE_X86=1      optimize for i386.\r
-                       default = no\r
-       HAVE_MMX=1      MMX instructions; use only if you assembler/compiler\r
-                       supports MMX instruction set; backwards compatibility\r
-                       with older processors is still preserved.\r
-                       default = no\r
-       HAVE_SSE=1      (see HAVE_MMX)\r
-                       default = no\r
-       HAVE_3DNOW=1    (see HAVE_MMX)\r
-                       default = no\r
-\r
-     Targets:\r
-       all:            build everything\r
-       libgl:          build GL\r
-       libglu:         build GLU\r
-       libglut:        build GLUT\r
-       clean:          remove object files\r
-       realclean:      remove all generated files\r
-\r
-\r
-\r
-Tested on:\r
-       CPU:            K6-2 (CXT) @500(412.5) MHz\r
-       Mainboard:      ViA Apollo VP2/97 w/ 128 MB SDRAM\r
-       Video card:     PowerColor Evil King3 (Voodoo3 3000) w/ 16384 kB SDRAM\r
-       DJGPP:          djdev 2.03 + gcc v3.1 + make v3.79.1\r
-\r
-\r
-\r
-FAQ:\r
-~~~~\r
-\r
-1. Compilation\r
-\r
-   Q) I tried to run `make' and it exits because `gcc' complains it cannot find\r
-      some stupid file.\r
-   A) You need LFN support.\r
-   A) If FX is defined, pay attention to Glide path.\r
-\r
-2. Dynamic modules\r
-\r
-   Q) What are you mumbling about dynamic modules?\r
-   A) You must have the DXE2 package (available on SimTel.Net, courtesy of\r
-      Andrew Zabolotny) installed in order to build the dynamic modules.\r
-\r
-   Q) I have DXE2, but I couln'd build the `dxe2gen.exe'.\r
-   Q) I built `dxe2gen.exe', but it doesn't do the job right.\r
-   A) There is a patched version on my web page.\r
-\r
-   Q) DXE2 modules give me headaches...\r
-   A) The DXE2 modules are not compulsory. The static libraries are still built\r
-      and you can use them in the old-fashioned, classic way.\r
-\r
-   Q) Okay, DXE2 modules are built. How can I use them?\r
-   A) Usage of the dynamic modules requires three things:\r
-       - include DMESADXE.H in one of the sources, so references inside\r
-         dynamic modules will get resolved (or use `-include' directive).\r
-       - link against import libraries (libI*.a) and LIBDL.A, which will do\r
-         the dynamic linkage job for you\r
-       - put the DXEs somewhere along the library path (LD_LIBRARY_PATH) or\r
-         in the current directory\r
-      For example:\r
-       gcc -o OUT.exe -include dmesadxe.h IN.c -ligl -liglu -liglut -ldl\r
-\r
-   Q) The application dies with "Abort!" due to unresolved symbols.\r
-   A) This is bad! Extract the unresolved symbol list from this module. For\r
-      example:\r
-       dxe2gen --show-unres gl.dxe > u\r
-      Check DMESADXE.H; the symbols in `u' must either be present here or be\r
-      exported from another module that has to be loaded before your faulting\r
-      one. Then recompile.\r
-\r
-3. Using Mesa for DJGPP\r
-\r
-   Q) Does this build work in Win9x?\r
-   A) Yes.\r
-\r
-   Q) Does it work under NT (W2k, XP) core?\r
-   A) Uh... probably not!\r
-\r
-   Q) I made a simple application and it does nothing. It exits right away. Not\r
-      even a blank screen.\r
-   A) The current version supports only RGB[A] modes, for it made no sense to\r
-      me to endorse color-index (aka palette) modes.\r
-   A) Single-buffered is not allowed at all. Until I can find a way to use\r
-      *REAL* hardware acceleration, it won't get implemented.\r
-   A) Another weird "feature" is that buffer width must be multiple of 4 (I'm a\r
-      lazy programmer and I found that the easiest way to keep buffer handling\r
-      at peak performance ;-).\r
-\r
-   Q) My demo doesn't display text. I know I used the glut font routines!\r
-   A) Then you probably use GLUT as a DXE. Well, there is no direct access to\r
-      variables due to the way DXE works. Read the documentation. The author of\r
-      GLUT took this into account for _WIN32 DLL's only; I don't want to modify\r
-      his headers. The only workaround is to link GLUT the old way :-(\r
-\r
-   Q) The DJGPP port of Mesa is so SLOOOW! The Win32 OpenGL performs so much\r
-      better...\r
-   A) Is that a question? If you have a Voodoo3/Banshee card, you're lucky. The\r
-      Glide port is on my web page. If you haven't, sorry; everything is done\r
-      in software. Suggestions?\r
-\r
-   Q) I have a super/mega/ultra monitor and all you can do is 60Hz? My eyes are\r
-      leaking from the orbits...\r
-   A) If you were compiling for Glide, see Glide info. If not, be aware that\r
-      refresh rate control works only for VESA 3.0. The environment variable\r
-      DMESA_REFRESH sets the default screen refresh. For example:\r
-       set DMESA_REFRESH=75\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 many Allegro "infusions"; I deeply thank to Shawn Hargreaves et 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 ;-) NB: since the\r
-DJGPP guys ensured signal handlers won't go beyond program's space (and since\r
-dynamic modules shall) the SIGINT can't be hooked (well, it can, but it is\r
-useless), therefore you must live with the 'Exiting due to signal SIGINT'\r
-message...\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. "Borrowed" from RHIDE (Robert Hoehne) or SETEDIT (Salvador Eduardo\r
-Tropea)... I'm not sure.\r
-\r
-Window creating defaults: 640x480x16 at (0,0), 8-bit stencil, 16-bit accum.\r
-However, the video mode is chosen in such a way that first window will fit.\r
-\r
-\r
-\r
-History:\r
-~~~~~~~~\r
-\r
-v1.0   mar-2002        initial release\r
-v1.1   sep-2002        + added 3dfx Glide3 support\r
-                       + added refresh rate control\r
-                       + added fonts in glut\r
-                       * lots of minor changes\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 6.5 DOS/DJGPP Port v1.8
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+
+Description:
+~~~~~~~~~~~~
+
+Well, guess what... this is the DOS port of Mesa 6.5, for DJGPP fans... Whoa!
+The driver uses OSMesa to draw off screen, and then blits the buffer.  This is
+not terribly efficient, and has some drawbacks, but saves maintenance costs.
+
+
+
+Legal:
+~~~~~~
+
+Mesa copyright applies.
+
+
+
+Installation:
+~~~~~~~~~~~~~
+
+Unzip and type:
+
+       make -f Makefile.DJ [OPTIONS...]
+
+Available options:
+
+     Environment variables:
+       CPU             optimize for the given processor.
+                       default = pentium
+       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
+       X86=1           optimize for x86 (if possible, use MMX, SSE, 3DNow).
+                       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:
+       Video card:     Radeon 9500
+       DJGPP:          djdev 2.04 + gcc v4.1.0 + make v3.80
+       OS:             DOS, Win98SE, WinXP (using Videoport driver)
+
+
+
+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 `glide3x.dxe' can be found in
+      LD_LIBRARY_PATH (or top `lib' directory).
+
+2. Using Mesa for DJGPP
+
+   Q) Every test I tried crashes badly.
+   A) If you have compiled with SSE and you're running under plain DOS, you
+      have to disable SSE at run-time. See environment variables below.
+
+   Q) DMesa is so SLOOOW! The Win32 OpenGL performs so much better...
+   A) Is that a question? If you have a 3dfx Voodoo (any model), you're
+      lucky (check http://sourceforge.net/projects/glide for the DJGPP port).
+      If you haven't, sorry; everything is done in software.
+
+   Q) I tried to set refresh rate w/ DMesa, but without success.
+   A) Refresh rate control works only for VESA 3.0 and the 3dfx driver (in
+      which case FX_GLIDE_REFRESH will be overwritten if it is defined and
+      is not 0).
+
+   Q) I made a simple application and it does nothing. It exits right away. Not
+      even a blank screen.
+   A) Software drivers (VESA/VGA/NUL) must to be constructed as single-buffered
+      visuals.  However, DMesaSwapBuffers must be called to get any output.
+   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) I'm getting a "bad font!" fatal error.
+   A) Always use GLUT_STROKE_* and GLUT_BITMAP_* constants when dealing with
+      GLUT fonts. If you're using `glut.dxe', then make sure GLUT_STROKE_* and
+      GLUT_BITMAP_* are mapped to integer constants, not to the actual font
+      address (same mechanism used for Win32 _DLL).
+
+   Q) What is NUL driver good for, if I don't get any output at all?
+   A) For debugging. The NUL driver is very much like OSMesa. Everything is
+      done just the same as VESA/VGA drivers, only it doesn't touch your video
+      hardware. You can query the actual buffer by issuing:
+       DMesaGetIntegerv(DMESA_GET_BUFFER_ADDR, &buffer);
+      and dump it to a file.
+
+   Q) How do I query for a list of available video modes to choose as a visual?
+   A) This is an ugly hack, for which I'm sure I'll burn in hell.
+      First, query for a list of modes:
+       n = DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, NULL);
+      If `n' is strictly positive, you allocate an array of pointers to a given
+      struct (which is guaranteed to be extended only - not changed in future):
+       struct {
+               int xres, yres;
+               int bpp;
+       } **l = malloc(n * sizeof(void *));
+      Now pass the newly allocated buffer to fill in:
+       DMesaGetIntegerv(DMESA_GET_VIDEO_MODES, (GLint *)l);
+      And collect the info:
+       for (i = 0; i < n; i++) {
+           printf("%dx%d:%d\n", l[i]->xres, l[i]->yres, l[i]->bpp);
+       }
+
+   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: (0, 0, 300, 300), 16bpp. 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.
+
+
+
+Environment variables:
+~~~~~~~~~~~~~~~~~~~~~~
+       DMESA_NULDRV            - (any value) force NUL driver
+       GLUT_FPS                - print frames/second statistics to stderr
+       MESA_NO_SSE             - (any value) safe option under pure DOS
+       DMESA_GLUT_REFRESH      - set vertical screen refresh rate (VESA3)
+       DMESA_GLUT_BPP          - set default bits per pixel (VGA needs 8)
+       DMESA_GLUT_ALPHA        - set default alpha bits (8)
+       DMESA_GLUT_DEPTH        - set default depth bits (16)
+       DMESA_GLUT_STENCIL      - set default stencil bits (8)
+       DMESA_GLUT_ACCUM        - set default accum bits (16)
+
+
+
+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 (dec-2003)
+       + enabled GLUT fonts with DXE
+       + truly added multi-window support in GLUT (for Adrian Woodward)
+       * accomodated makefiles with the new sourcetree
+       * fixed some ALPHA issues
+       * minor changes to PC_HW/timer interface
+       x hacked and slashed the 3dfx driver (w/ help from Hiroshi Morii)
+
+v1.5 (jan-2004)
+       + added interface to query available "visuals" (GLFW - Marcus Geelnard)
+       + added GLUT timer callback
+       - removed Matrox Millennium MGA2064W driver
+       x more changes to the 3dfx driver
+
+v1.6 (aug-2004)
+       + implemented NUL driver
+       + added DMesaGetProcAddress and glutGetProcAddress
+       * reorganized fxMesa wrapper to handle multiple contexts
+       ! fixed a horrible bug in VGA initialization routine
+       ! fixed partial clears
+
+v1.7 (???-2005)
+       + enabled OpenGL 2.0 support
+       + added support for sw texture compression
+       + added FreeGLUT specific functions
+       * no more GLX sources in DOS GLUT
+       * made GLUT timer callbacks less accurate but safer
+
+v1.8 (apr-2006)
+       * killed lots of code, the driver is now a front-end to OSMesa
+       * fixed problem with WinNT (http://www.volny.cz/martin.sulak/)
+       - removed 3dfx Glide3 support (temporarily?)
+
+
+
+Contact:
+~~~~~~~~
+
+Name:   Daniel Borca
+E-mail: dborca@users.sourceforge.net
+WWW:    http://www.geocities.com/dborca/