home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / mesa-1.2.8 / readme < prev    next >
Text File  |  1996-05-27  |  40KB  |  1,005 lines

  1.  
  2.               The Mesa 3-D graphics library
  3.  
  4.                   Version 1.2.8
  5.  
  6.             Copyright (C) 1995-1996  Brian Paul
  7.  
  8.  
  9.  
  10. Introduction
  11. ============
  12.  
  13. Mesa is a 3-D graphics library with an API which is very similar to that
  14. of OpenGL*.  To the extent that Mesa utilizes the OpenGL command syntax
  15. or state machine, it is being used with authorization from Silicon Graphics,
  16. Inc.  However, the author makes no claim that Mesa is in any way a
  17. compatible replacement for OpenGL or associated with Silicon Graphics, Inc.
  18. Those who want a licensed implementation of OpenGL should contact a licensed
  19. vendor.  This software is distributed under the terms of the GNU Library
  20. General Public License, see the LICENSE file for details.
  21.  
  22. * OpenGL(R) is a registered trademark of Silicon Graphics, Inc.
  23.  
  24.  
  25.  
  26. Author
  27. ======
  28.  
  29. Brian Paul
  30. Space Science and Engineering Center
  31. University of Wisconsin - Madison
  32. 1225 W. Dayton St.
  33. Madison, WI  53706
  34.  
  35. brianp@ssec.wisc.edu
  36. http://www.ssec.wisc.edu/~brianp/homepage1.html
  37.  
  38.  
  39.  
  40. Status
  41. ======
  42.  
  43. I've been working on this library in my spare time since August, 1993.
  44. It's currently about 95% complete.  You'll find that most programs which
  45. use the OpenGL tk, aux or GLUT toolkits will work with Mesa without changing
  46. the source code at all.
  47.  
  48. Features which are complete:
  49.     all glBegin() primitives
  50.     all model and view transformations
  51.     clipping (against user clip planes and view volume)
  52.     lighting
  53.     smooth shading
  54.     depth buffering
  55.     accumulation buffer
  56.     alpha testing/blending
  57.     stencil buffer
  58.     dithering
  59.     logic operations
  60.     evaluators  (curves and surfaces)
  61.     feedback/selection
  62.     fog (per-pixel or per-vertex)
  63.     polygon/line stippling
  64.     read/write/copy pixels
  65.     tk and aux libraries for X11
  66.     context switching (multiple windows)
  67.     RGB mode simulated in color mapped windows
  68.     the GLX library (as close as I can get)
  69.     glPixelZoom
  70.     display lists
  71.  
  72. Features which are mostly complete:
  73.     texture mapping
  74.     the GLU library
  75.     NURBS
  76.  
  77. Missing features:
  78.     anti-aliasing
  79.     mipmapping, non-point-sampled texture mapping
  80.     glGetTexGen* functions
  81.     glGetPolygonStipple
  82.  
  83.  
  84. The primary goal of this library has been correctness, speed was secondary
  85. (but not neglected!).  Optimizations are the focus of most current work.
  86.  
  87. The core library was originally written on an Amiga using the DCC compiler.
  88. Later on it was moved to an SGI.  Current development is done on an SGI
  89. system.
  90.  
  91. Mesa works on most Unix workstations with ANSI C and X11.  There are also
  92. drivers for Amiga, Microsoft Windows, Macintosh, and NeXT systems.  See
  93. below for more information.
  94.  
  95. Please send bug reports to the author.  Include information describing
  96. your system, which version of Mesa you're using, and how to reproduce the
  97. problem.  Bug fixes are especially welcome.  Note that some parts of Mesa
  98. (widgets, GLU tesselator, NURBS, non-Unix/X11 device drivers, etc) were
  99. contributed by others and any bugs in those components should be sent to
  100. the respective author.
  101.  
  102. Anyone is welcome to contribute code to the Mesa project, provided you
  103. agree to the GNU license.
  104.  
  105. Since the OpenGL API is used, OpenGL documentation can serve as the
  106. documentation for Mesa's core functions.  Here are a few sources:
  107.  
  108.   WWW Center:   http://www.sgi.com/Technology/openGL/
  109.   Man pages:    http://www.digital.com:80/pub/doc/opengl/
  110.   Spec doc:     http://www.sgi.com/Technology/openGL/glspec/glspec.html
  111.  
  112.  
  113.  
  114.  
  115. Getting the software
  116. ====================
  117.  
  118. The primary Mesa ftp site is iris.ssec.wisc.edu in the pub/Mesa directory.
  119. Mesa is also mirrored on sunsite in the directory pub/packages/development
  120. /graphics/mesa.
  121.  
  122.  
  123. The archive file Mesa-1.2.8.tar.Z can be unpacked with:
  124.     zcat Mesa-1.2.8.tar.Z | tar xf -
  125.  
  126. The archive file Mesa-1.2.8.tar.gz can be unpacked with:
  127.     gzcat Mesa-1.2.8.tar.gz | tar xf -
  128.  
  129. After you unpacking you should have the following files in the Mesa-1.2.8
  130. directory:
  131.  
  132. README        - this file
  133. README.AMIWIN    - instructions for using Mesa on Amigas with AmiWin (X11)
  134. LICENSE        - the GNU library license
  135. IAFA-PACKAGE    - description file
  136. Makefile    - top-level Makefile
  137. Make-config    - system configurations used by the Makefiles
  138. mklib.*        - scripts for making shared libraries for some systems
  139. include/    - application include files
  140. lib/        - application libraries, created during installation
  141. src/        - source code for core library
  142. src-glu/    - source code for utility library
  143. src-tk/        - source code for tk library
  144. src-aux/    - source code for aux library
  145. demos/        - demo programs
  146. samples/    - sample OpenGL programs from SGI
  147. book/        - example programs from the OpenGL Programming Guide
  148. widgets/    - Mesa widgets for Xt/Motif
  149. windows/    - Microsoft Windows driver stuff
  150. NeXT/        - NeXT demo programs
  151. mondello/    - Cirrus Logic Mondello 3-D accelerator code
  152. amiga/        - AmigaDOS driver
  153.  
  154.  
  155.  
  156. Installation for Unix/X11
  157. =========================
  158.  
  159. To compile the library, first type 'make' alone to see the list of system
  160. configurations currently supported.  If you see your configuration on the
  161. list, type 'make <config>'.  Most popular Unix/X workstations are currently
  162. supported.
  163.  
  164. The top-level makefile will execute the makefiles in a number of sub-
  165. directories.  When finished, there should be executables in the "demos/",
  166. "samples/", and "book/" directories for you to try out.  If you only want
  167. to compile the contents of one subdirectory you can 'cd' to that directory
  168. and type 'make <config>' there.  For example, to just compile the main
  169. Mesa library:  cd src ; make <config>
  170.  
  171. If your system is not listed by 'make', you'll have to modify the top-level
  172. Makefile and Make-config files.  There are instructions in each file.
  173.  
  174. If you have compilation problems you should try to fix them and return the
  175. patches to the author.
  176.  
  177. If you want to build the Mesa widgets read the widgets/INSTALL file.
  178.  
  179. If you want to build the GLUT library read the README.GLUT file.
  180.  
  181. Note to HP users:  a Mesa user reports that the HP-UX 10.01 C compiler has
  182. a bug which effects glReadPixels.  A patch for the compiler (PHSS_5743) is
  183. available.  Otherwise be sure your compiler is version 10.13 or later.
  184.  
  185. Note to QNX users:  if you have problems running the demos try setting the
  186. stack size to 200K or larger with -N200K, for example.
  187.  
  188.  
  189.  
  190. Installation for Amigas
  191. =======================
  192.  
  193. To use Mesa on Amigas with AmiWin (an X server for the Amiga), read the
  194. README.AMIWIN file.
  195.  
  196. To use Mesa on ordinary Amigas read the README.AMIGA file.  Problems or
  197. question about the Amiga driver should be sent to Stefan Zivkovic
  198. (d94sz@efd.lth.se).
  199.  
  200.  
  201.  
  202. Installation for Microsoft Windows
  203. ==================================
  204.  
  205. See the README.WIN file for details.  Problems or questions about the Windows
  206. driver should be sent to Mark Peterson at markp@ic.mankato.mn.us
  207.  
  208.  
  209.  
  210. Installation for Macintosh
  211. ==========================
  212.  
  213. From ftp://iris.ssec.wisc.edu/pub/Mesa/contrib download these files:
  214.     mesa0.31b.sit.hqx
  215.     GLUT4Mac.sit.hqx
  216. Miklos Fazekas (boga@augusta.elte.hu) should be contacted if you have
  217. questions about the Mac driver.
  218.  
  219.  
  220.  
  221. Installation for NeXT
  222. =====================
  223.  
  224. Simply typing "make next" should compile Mesa and a number of NeXT demo
  225. programs found in the NeXT/ directory.  NeXT support was contributed by
  226. Pascal Thibaudeau (pascal@galileo.slip.u-bordeaux.fr).  It was implemented
  227. through Mesa's Off-Screen rendering interface.
  228.  
  229.  
  230.  
  231. Using the library
  232. =================
  233.  
  234. Configuration options:
  235.    The file src/config.h has many parameters which you can adjust such
  236.    as maximum number of lights, clipping planes, maximum texture size,
  237.    etc.  In particular, you may want to change DEPTH_BITS from 16 to 32
  238.    if a 16-bit depth buffer isn't precise enough for your application.
  239.  
  240.  
  241. Shared libraries:
  242.    If you compile shared libraries you may have to set an environment
  243.    variable to specify where the Mesa libraries are located.  On Linux and
  244.    Sun systems for example, set the LD_LIBRARY_PATH variable to include
  245.    /your-dir/Mesa-1.2.8/lib.   Otherwise, when you try to run a demo it
  246.    may fail with a message saying that one or more libraries couldn't be
  247.    found.
  248.  
  249.  
  250. Header and library files:
  251.    To use the library with your own applications you may want to move the
  252.    files in "include/" to "/usr/local/include/" and the libraries in "lib/"
  253.    to "/usr/local/lib/".  Then compile your graphics application with
  254.    "-I/usr/local/include" and link with "-L/usr/local/lib -lMesaGL -lMesaGLU",
  255.    for example.  Look at the demos/Makefile for an example.
  256.  
  257.    As of version 1.2.3, Mesa's header files use the same GLenum and GLUenum
  258.    values as SGI's (and most/all other vendor's) OpenGL headers.  This means
  259.    you can freely mix object files compiled with OpenGL or Mesa headers.
  260.    In fact, on systems with dynamic runtime linkers it's possible to dynam-
  261.    ically link with Mesa or OpenGL shared libraries at runtime, without
  262.    recompiling or relinking anything!
  263.  
  264.    Using IRIX 5.x as an example, you can run SGI's OpenGL demos with the
  265.    Mesa shared libraries as follows.  Let's assume you're installing Mesa
  266.    in /usr/local/Mesa and using the C-shell:
  267.        % cd /usr/local/Mesa
  268.        % make irix5-dso
  269.        % cd lib
  270.        % ln -s libMesaGL.so libGL.so
  271.        % setenv _RLD_LIST "/usr/local/Mesa/lib/libGL.so:DEFAULT"
  272.        % /usr/demos/bin/ideas_ogl      // this is a test
  273.  
  274.    You can now run OpenGL executables on almost any X display!  There may
  275.    be some problems from the fact that Mesa supports many X visual types
  276.    that an OpenGL client may not expect (grayscale for example).  In this
  277.    case the application may abort, print error messages, or just behave
  278.    strangely.  You may have to experiment with the MESA_RGB_VISUAL envi-
  279.    ronment variable.
  280.  
  281.  
  282. Toolkits (X11 only):
  283.    Initially, you may write your own Mesa programs using the aux or tk tool-
  284.    kits which are used in the OpenGL Programming Guide and in SGI's demos,
  285.    respectively.  However, these toolkits weren't meant for use in real app-
  286.    lications.  You have several alternatives:
  287.  
  288.       1. Use the GLX (simulated since Mesa doesn't implement the GLX proto-
  289.       col) functions.  These functions look like, and try to act like, the
  290.       real GLX functions used by OpenGL in conjunction with the X window
  291.       system.
  292.  
  293.       2. GLUT (OpenGL Utility Toolkit) was written by Mark Kilgard at SGI as
  294.       a replacement for aux and tk.  It provides a simple, portable, window-
  295.       system independent interface allowing you to write OpenGL applications
  296.       quickly and easily.  GLUT isn't included with Mesa but you'll find
  297.       instructions on how to get and build GLUT in the file README.GLUT.
  298.  
  299.       3. Use an Xt/Motif widget.  Look in the widgets/ directory for more info.
  300.  
  301.       4. Go directly to the X/Mesa interface using the functions described
  302.       in include/GL/xmesa.h.  This requires experience with X programming.
  303.       Using GLX is probably a better choice because it's portable.
  304.  
  305.  
  306. Performance tips:
  307.    1. Turn off smooth shading when you don't need it (glShadeModel)
  308.    2. Turn off depth buffering when you don't need it.
  309.    3. Turn off dithering when not needed.
  310.    4. Use double buffering as it's often faster than single buffering
  311.    5. Compile in the X Shared Memory extension option if it's supported
  312.       on your system by adding -DSHM to CFLAGS and -lXext to XLIBS for
  313.       your system in the Make-config file.
  314.    6. Recompile Mesa with more optimization if possible.
  315.    7. Try to maximize the amount of drawing done between glBegin/glEnd pairs.
  316.       This can be especially beneficial with Mesa 1.2.3 or later because of
  317.       its "vectorized" transformation code.
  318.    8. Use the MESA_BACK_BUFFER variable to find best performance in double
  319.       buffered mode.
  320.    9. Optimized polygon rasterizers are used when:
  321.          rendering into back buffer which is an XImage
  322.          RGB mode, not grayscale, not monochrome
  323.          depth buffering is GL_LESS, or disabled
  324.          flat or smooth shading
  325.          dithered or non-dithered
  326.          no other rasterization operations enabled (blending, stencil, etc)
  327.       Faster line drawing is also available when:
  328.          rendering into back buffer which is an XImage
  329.          RGB mode, not grayscale, not monochrome
  330.          depth buffering is GL_LESS or disabled
  331.          flat shading
  332.          dithered or non-dithered
  333.          no other rasterization operations enabled (blending, stencil, etc)
  334.    10. Mesa 1.2.7 (and later) uses an optimized lighting function when:
  335.         Two-sided lighting is disabled
  336.         GL_LIGHT_MODEL_LOCAL_VIEWER is false
  337.         GL_COLOR_MATERIAL is disabled
  338.         No spot lights are used (all GL_SPOT_CUTOFFs are 180.0)
  339.         No local lights are used (all position W's are 0.0)
  340.         All material and light coefficients are >= zero
  341.  
  342.  
  343.  
  344. Debugging:
  345.    Normally Mesa records but does not notify the user of errors.  It is up
  346.    to the application to call glGetError to check for errors.  Mesa supports
  347.    an environment variable, MESA_DEBUG, to help with debugging.  If MESA_DEBUG
  348.    is defined, a message will be printed to stdout whenever an error occurs.
  349.  
  350.    With a debugger you may set a breakpoint in gl_error() to trap upon Mesa
  351.    errors.
  352.  
  353.  
  354. X Display Modes:
  355.    Mesa supports rendering in most X visual types and depths.  When a
  356.    TrueColor or DirectColor visual isn't available dithering is used in RGB
  357.    mode.
  358.  
  359.    The glXChooseVisual function tries its best to pick an appropriate visual
  360.    for the given attribute list.  However, if this doesn't suit your needs
  361.    you can force Mesa to use any X visual you want (any supported by your
  362.    X server that is) by setting the MESA_RGB_VISUAL and MESA_CI_VISUAL
  363.    environment variables.  When an RGB visual is requested, glXChooseVisual
  364.    will first look if the MESA_RGB_VISUAL variable is defined.  If so, it
  365.    will try to use the specified visual.  Similarly, when a color index
  366.    visual is requested, glXChooseVisual will look for the MESA_CI_VISUAL
  367.    variable.
  368.  
  369.    The format of accepted values is:  <visual-class> <depth>
  370.    Here are some examples:
  371.  
  372.    using the C-shell:
  373.     % setenv MESA_RGB_VISUAL "TrueColor 8"        // 8-bit TrueColor
  374.     % setenv MESA_CI_VISUAL "PseudoColor 12"    // 12-bit PseudoColor
  375.     % setenv MESA_RGB_VISUAL "PseudoColor 8"    // 8-bit PseudoColor
  376.  
  377.    using the KornShell:
  378.     $ export MESA_RGB_VISUAL="TrueColor 8"
  379.     $ export MESA_CI_VISUAL="PseudoColor 12"
  380.     $ export MESA_RGB_VISUAL="PseudoColor 8"
  381.  
  382.  
  383. Double buffering (X11 only):
  384.    Mesa can use either an X Pixmap or XImage as the backbuffer when in
  385.    double buffer mode.  Using GLX, the default is to use an XImage.  The
  386.    MESA_BACK_BUFFER environment variable can override this.  The valid
  387.    values for MESA_BACK_BUFFER are:  Pixmap and XImage (only the first
  388.    letter is checked, case doesn't matter).
  389.  
  390.    A pixmap is faster when drawing simple lines and polygons while an
  391.    XImage is faster when Mesa has to do pixel-by-pixel rendering.  If you
  392.    need depth buffering the XImage will almost surely be faster.  Exper-
  393.    iment with the MESA_BACK_BUFFER variable to see which is faster for
  394.    your application.  
  395.  
  396.  
  397. Colormaps (X11 only):
  398.    When using Mesa directly or with GLX, it's up to the application writer
  399.    to create a window with an appropriate colormap.  The aux, tk, and GLUT
  400.    toolkits try to minimize colormap "flashing" by sharing colormaps when
  401.    possible.  Specifically, if the visual and depth of the window matches
  402.    that of the root window, the root window's colormap will be shared by
  403.    the Mesa window.  Otherwise, a new, private colormap will be allocated.
  404.  
  405.    When sharing the root colormap, Mesa may be unable to allocate the colors
  406.    it needs, resulting in poor color quality.  This can happen when a
  407.    large number of colorcells in the root colormap are already allocated.
  408.    To prevent colormap sharing in aux, tk and GLUT, define the environment
  409.    variable MESA_PRIVATE_CMAP.  The value isn't significant.
  410.  
  411.  
  412. Fortran bindings:
  413.    Mesa 1.2.4 introduces a preliminary Fortran API to Mesa.  Only a subset
  414.    of the gl* functions are supported at this time.  None of the glu*
  415.    functions are available.  Also, you'll have to write your window system
  416.    interface code in C or use the Fortan interface to GLUT since the GLX,
  417.    XMesa, and widget interfaces don't work with Fortran.
  418.  
  419.    To use Mesa from Fortran you must include Mesa/include/GL/fgl.h in
  420.    your program.  All the GL_ constants are identical in name and value
  421.    to their C counterparts.  API function names, however, are different
  422.    in that they are all prefixed with 'fgl' instead of 'gl.'
  423.  
  424.    Link your Fortran application with libMesaGL.a just like you would for
  425.    a C application.
  426.  
  427.    See the Mesa/src/fortran.c file to see how wrappers are constructed
  428.    for each gl* function.  If a function you need doesn't have a wrapper
  429.    yet, please try to implement it yourself then send the new code to
  430.    the author.
  431.  
  432.    The Fortran interface has only been tested on a few systems (IRIX,
  433.    AIX) at this time.  However, the fortran.c file structure should be
  434.    flexible enough to adapt to most other system's C/Fortran calling
  435.    conventions.  See the comments in that file for more info.
  436.  
  437.    demos/fdraw.f and demos/ftest.c is an example of using the Fortran API.
  438.    Also read include/GL/fgl.h for comments about Fortran API function
  439.    argument types.
  440.  
  441.    A new set of Fortran 77 and Fortran 90 bindings are under development
  442.    now by William F. Mitchell (william.mitchell@nist.gov).
  443.  
  444.  
  445. Gamma correction (X11 only):
  446.    To compensate for the nonlinear relationship between pixel values
  447.    and displayed intensities, there is a gamma correction feature in
  448.    Mesa.  Some systems, such as Silicon Graphics, support gamma
  449.    correction in hardware (man gamma) so you won't need to use Mesa's
  450.    gamma facility.  Other systems, however, may need gamma adjustment
  451.    to produce images which look correct.  If in the past you thought
  452.    Mesa's images were too dim, read on.
  453.  
  454.    Gamma correction is controlled with the MESA_GAMMA environment
  455.    variable.  Its value is of the form "Gr Gg Gb" or just "G" where
  456.    Gr is the red gamma value, Gg is the green gamma value, Gb is the
  457.    blue gamma value and G is one gamma value to use for all three
  458.    channels.  Each value is a positive real number typically in the
  459.    range 1.0 to 2.5.  The defaults are all 1.0, effectively disabling
  460.    gamma correction.  Examples using csh:
  461.  
  462.     % setenv MESA_GAMMA "2.3 2.2 2.4"    // separate R,G,B values
  463.     % setenv MESA_GAMMA "2.0"        // same gamma for R,G,B
  464.  
  465.    The demos/gamma.c program may help you to determine reasonable gamma
  466.    value for your display.  With correct gamma values, the color intensities
  467.    displayed in the top row (drawn by dithering) should nearly match those
  468.    in the bottom row (drawn as grays).
  469.  
  470.    Alex De Bruyn reports that gamma values of 1.6, 1.6 and 1.9 work well
  471.    on HP displays using the HP-ColorRecovery technology.
  472.  
  473.    Mesa implements gamma correction with a lookup table which translates
  474.    a "linear" pixel value to a gamma-corrected pixel value.  There is a
  475.    small performance penalty.  Gamma correction only works in RGB mode.
  476.    Also be aware that pixel values read back from the frame buffer will
  477.    not be "un-corrected" so glReadPixels may not return the same data
  478.    drawn with glDrawPixels.
  479.  
  480.    For more information about gamma correction see:
  481.    http://www.inforamp.net/~poynton/notes/colour_and_gamma/GammaFAQ.html
  482.  
  483.  
  484. Off-screen rendering:
  485.    Mesa 1.2.4 introduced off-screen rendering, a facility for generating
  486.    3-D imagery without having to open a window on your display.  Mesa's
  487.    simple off-screen rendering interface is completely operating system
  488.    and window system independent so programs which use off-screen rendering
  489.    should be very portable.  This new feature effectively enables you to
  490.    use Mesa as an off-line, batch-oriented renderer.
  491.  
  492.    The "OSMesa" API provides 3 functions for making off-screen renderings:
  493.    OSMesaCreateContext(), OSMesaMakeCurrent(), and OSMesaDestroyContext().
  494.    See the Mesa/include/GL/osmesa.h header for more information.  See the
  495.    demos/osdemo.c file for an example program.   There is no facility for
  496.    writing images to files.
  497.  
  498.    If you want to generate large images (larger than 1280x1024) you'll
  499.    have to edit the src/config.h file to change MAX_WIDTH and MAX_HEIGHT
  500.    then recompile Mesa.  Image size should only be limited by available
  501.    memory.
  502.  
  503.  
  504. Profiling:
  505.    Mesa 1.2.6 introduced a simple profiling facility.  It counts and
  506.    measures the time spent in a number of important rendering operations
  507.    and prints the information in a report before your program exits.
  508.  
  509.    By default, profiling is disabled.  To enable it, add -DPROFILE to
  510.    the appropriate CFLAGS entry in the Make-config file, then recompile
  511.    Mesa.  In general, you should only enable profiling during program
  512.    development to gain insight into Mesa's performance.  Mesa runs a bit
  513.    slower when profiling is enabled because it requires frequent polling
  514.    of the system clock.
  515.  
  516.    The profiling report will be printed when glXDestroyContext is called
  517.    _if_ the MESA_PROFILE environment variable is set.  You must be sure
  518.    glXDestroyContext is called before exiting to get the profile report.
  519.    The report will be printed to stdout and includes:
  520.  
  521.       glBegin/glEnd - number of glBegin/glEnd pairs called, total time,
  522.          and rate in pairs/second.
  523.       vertexes transformed - number of vertices transformed, lit, clip-
  524.          tested, fogged, and mapped to window coordinates, total time,
  525.          and rate in vertexes/second.
  526.       points rasterized - number of points drawn, time, and rate.
  527.       lines rasterized - number of lines drawn, time, and rate.
  528.       polygons rasterized - number of polygons drawn, time and rate.
  529.       overhead - time between glBegin/glEnd not accounted for by vertexes,
  530.          points, lines, and polygons.  This is time spent executing
  531.          glVertex, glNormal, glColor, etc, clipping, primitive assembly,
  532.          and user code between glBegin/glEnd.
  533.       glClear - number of glClears executed, total time and clears/second.
  534.       SwapBuffers - number of swaps executed, total time and swaps/second.
  535.  
  536.    Note that the real point, line, and polygon rates should be computed by
  537.       adding in the vertex transformation and overhead time factors.
  538.  
  539.  
  540. Linux SVGA driver:
  541.    Mesa 1.2.6 has a preliminary Linux SVGA driver for Mesa.  It's based
  542.    on the SVGA library included with Linux.  The driver isn't finished
  543.    yet.  I'm not too familiar with SVGA graphics so I could use some help
  544.    finishing it.  Contact Brian if you want to help.
  545.  
  546.    To enable the SVGA driver, edit the Make-config file and add -DSVGA to
  547.    the CFLAGS for Linux and add -lvga to the LIBS variable.  There are
  548.    several test programs (vtest.c, vgears.c, vindex.c) in the demos
  549.    directory.  See the include/GL/svgamesa.h and src/svgamesa.c files for
  550.    more information about the driver.
  551.  
  552.  
  553. Extensions:
  554.    The following OpenGL extensions are currently implemented:
  555.  
  556.       GL_EXT_blend_color - allows blending with a constant color
  557.       GL_EXT_blend_minmax - blend min/max operator
  558.       GL_EXT_blend_logic_op - allows glLogicOp to work in RGBA mode
  559.       GL_EXT_blend_subtract - blend subtraction operator
  560.       GL_EXT_polygon_offset - useful for drawing outlined polygons
  561.       GL_EXT_vertex_array - vertex array extension
  562.       GLX_EXT_visual_info - GLX visual and transparent pixel extension
  563.  
  564.    For detailed information about the extensions see:
  565.       ftp://sgigate.sgi.com/pub/opengl/extensions/
  566.  
  567.    There are two Mesa-specific GLX extension at this time.
  568.  
  569.    GLX_MESA_pixmap_colormap 
  570.  
  571.       This extension adds the GLX function:
  572.  
  573.          GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  574.                                            Pixmap pixmap, Colormap cmap )
  575.  
  576.       It is an alternative to the standard glXCreateGLXPixmap() function.
  577.       Since Mesa supports RGB rendering into any X visual, not just True-
  578.       Color or DirectColor, Mesa needs colormap information to convert RGB
  579.       values into pixel values.  An X window carries this information but a
  580.       pixmap does not.  This function associates a colormap to a GLX pixmap.
  581.       See the demos/glxpixmap.c file for an example of how to use this
  582.       extension.
  583.  
  584.    GL_MESA_window_pos
  585.  
  586.       This extension adds the glWindowPos*MESA() functions.  These functions
  587.       are convenient alternatives to glRasterPos*() because they set the
  588.       current raster position to a specific window coordinate, bypassing the
  589.       usual modelview, projection and viewport transformations.  This is
  590.       especially useful for setting the position for glDrawPixels() or
  591.       glBitmap() to a specific window coordinate.
  592.  
  593.       X and Y parameters (positive and negative) are directly mapped to
  594.       window coordinates.  Z is a depth value clamped to the range [0,1].
  595.       W is directly mapped.  The current raster position valid flag is
  596.       always set to true.  The current raster distance is set to zero.
  597.       The current raster color and texture coordinate are updated in the
  598.       same manner as glRasterPos().  In selection mode a hit record is
  599.       always generated.
  600.  
  601.       Programs using OpenGL, not Mesa, may also use the glWindowPos*MESA()
  602.       functions by including winpos.h from the src directory and by
  603.       compiling and linking with the winpos.c file from the src directory.
  604.  
  605.  
  606. Software alpha planes:
  607.    Many color frame buffers do not have alpha planes.  Since some
  608.    applications need them, Mesa can simulate alpha planes in software.
  609.    By default software alpha buffering is disabled.  Software alpha
  610.    buffers are enabled with the MESA_ALPHA environment variable.  The
  611.    value of this variable is a string containing either "front", "back"
  612.    or both values: "front back".  For example:
  613.  
  614.       setenv MESA_ALPHA "front"
  615.       setenv MESA_ALPHA "back"
  616.       setenv MESA_ALPHA "front back"
  617.  
  618.    Software alpha buffers are 8 bits deep; one byte of memory per pixel.
  619.    Be aware that there is a small performance penalty for using software
  620.    alpha buffers.
  621.  
  622.    This environment variable will be removed in the future.  It will be
  623.    up to the application code to request alpha planes when needed.
  624.  
  625.  
  626. Summary of environment variables:
  627.    MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode (X only)
  628.    MESA_CI_VISUAL - specifies the X visual and depth for CI mode (X only)
  629.    MESA_BACKBUFFER - specifies how to implement the back color buffer
  630.    MESA_DEBUG - if defined, error messages are printed to stderr
  631.    MESA_PRIVATE_CMAP - force aux/tk libraries to use private colormaps (X only)
  632.    MESA_GAMMA - gamma correction coefficients (X only)
  633.    MESA_PROFILE - enable reporting of performance measurements
  634.    MESA_ALPHA - enable simulated alpha buffer components in RGB mode
  635.    MESA_XSYNC - enable synchronous X behavior (for debugging only)
  636.  
  637.  
  638.  
  639. Miscellaneous
  640. =============
  641.  
  642. There is a Mesa WWW page:  http://www.ssec.wisc.edu/~brianp/Mesa.html
  643.  
  644. There is a Mesa mailing list.  To subscribe, send the following message to
  645. the address listproc@iqm.unicamp.br
  646.  
  647. subs mesa <your name>
  648.  
  649. For example:
  650.  
  651. subs mesa Brian Paul
  652.  
  653. You will receive a welcome message from the list server when you have been
  654. added to the list.  It tells you how to post messages to the list, how
  655. to unsubscribe, etc.  Thanks to Pedro Vazquez (vazquez@iqm.unicamp.br) for
  656. setting up the list.
  657.  
  658. There is a contrib/ subdirectory on the Mesa ftp site which contains
  659. contributions from Mesa users.  See the README file in that directory for
  660. more information.
  661.  
  662.  
  663.  
  664. Known Bugs
  665. ==========
  666.  
  667. 1. Evaluator automatic normal vectors are miscalculated under certain
  668.    conditions.
  669.  
  670. 2. glCopyPixels gives undefined results when source and destination regions
  671.    overlap and pixel zoom!=1.0.
  672.  
  673. 3. Mesa doesn't work too well on Crays.  The problem is that Crays do not
  674.    have the exact C data type sizes which Mesa's X driver relies on.  Better
  675.    Cray support may or may not be seen in the future.
  676.  
  677. 4. glDrawBuffer( GL_FRONT_AND_BACK ) doesn't work.
  678.  
  679.  
  680.  
  681. Future Plans
  682. ============
  683.  
  684. 1. Display list optimization:  scan for duplicate vertices and normals in
  685.    order to reduce number of transformations needed.
  686.  
  687. 2. Convert from polygon rasterizers to triangle rasterizers.
  688.  
  689. 3. Implement non-point-sampled polygon/triangle rasterizers and extend
  690.    the glHint() function with GL_MESA_POLYGON_SAMPLING such that
  691.    GL_FASTEST indicates non-point sampling and GL_NICEST/GL_DONT_CARE
  692.    indicates point sampling.  Also, an environment variable override.
  693.  
  694. 4. Implement a "generational" depth buffer which only has to be cleared
  695.    once every 'n' frames.
  696.  
  697. 5. Remove MESA_ALPHA environment variable.
  698.  
  699.  
  700.  
  701. Version History
  702. ===============
  703.  
  704. 1.0 beta   February 1995
  705.     Initial release
  706.  
  707. 1.1 beta   March 4, 1995
  708.     Many improvements:
  709.     - faster point and line drawing (2x faster)
  710.     - more systems supported, better Makefiles
  711.     - many small bug fixes
  712.     - pseudo-GLX functions added
  713.     - GLUT support
  714.     - new implementation of evaluators (eval2.c)
  715.     - Renamed lib*.a files to avoid collisions
  716.  
  717. 1.1.1 beta   March 7, 1995
  718.     Reverted from eval2.c to eval.c due to FPE on Linux
  719.     more speed improvements
  720.     more Makefile changes
  721.  
  722. 1.1.2 beta   March 14, 1995
  723.     Using eval2.c again
  724.     more FPE-prevention checks (0-length normals are OK)
  725.     a few small bug fixes
  726.     much faster pixel logic ops!
  727.     faster transformation arithmetic
  728.     implementation of SGI's blending extensions
  729.     glXUseXFont implemented
  730.     added MESA_DEBUG environment variable support
  731.  
  732. 1.1.3 beta   March 31, 1995
  733.     gluScaleImage() and gluBuild2DMipMaps() implemented
  734.     Mesa widgets for Xt/Motif
  735.     more bug fixes
  736.     blendEXT demos
  737.     added environment variables for selecting visuals
  738.     almost all GLUT demos work correctly now
  739.     faster X device driver functions
  740.  
  741. 1.1.4 beta   April 20, 1995
  742.     Bug fixes:
  743.     - missing #define SEEK_SET in src-tk/image.c
  744.     - compile glShadeModel into display lists
  745.     - fixed pow() domain error in src/light.c
  746.     - fixed "flickering bitmaps" in double buffer mode
  747.     - fixed tk.h and aux.h for C++
  748.     - state of LIGHT_MODEL_LOCAL_VIEWER was inverted
  749.     New features:
  750.     - MUCH, MUCH nicer dithering in 8-bit RGB mode
  751.     - updated widgets and widget demos
  752.     - Implemented GLXPixmap functions
  753.     - Added GLU 1.1 and GLX 1.1 functions
  754.     - Changed the X/Mesa interface API, more versatile
  755.     - Implemented gluPartialDisk()
  756.  
  757. 1.2   May 22, 1995
  758.     Bug fixes:
  759.     - IRIX 4.x makefile problem
  760.     - modified tk to share root colormap as needed
  761.     - gluLookAt normalization problem
  762.     - suppress Expose, NoExpose events in swapbuffers
  763.     - glBitmap() and glDrawPixels() clipping
  764.     New features:
  765.     - GL_BLEND, GL_MODULATE, GL_DECAL, and GL_REPLACE_EXT texture
  766.           modes implemented
  767.     - texture maps stored more efficiently
  768.     - texture maps can be compiled into display lists
  769.     - Bogdan Sikorski's GLU polygon tesselation code
  770.     - Linas Vepstas's sweep and extrusion library
  771.     - glXCreateContext()'s shareList parameter works as it's supposed to.
  772.           XMesaCreateContext() updated to accept a shareList parameter too.
  773.     - Mesa can be compiled with real OpenGL .h files
  774.     - MESA_BACK_BUFFER environment variable
  775.     - better GLX error checking
  776.  
  777. 1.2.1   June 22, 1995
  778.     Bug fixes:
  779.     - X/Mesa double buffer window resize crash
  780.     - widgets now pass PointerMotion events
  781.     - X/Mesa incorrect default clear color and drawing color
  782.     - more robust X MIT-SHM support in X/Mesa
  783.     - glTexImage( format=GL_LUMINANCE ) didn't work
  784.     - GL_LINE mode polygons with line width > 1.0 could cause a crash
  785.     - numerous feedback bugs
  786.     - glReadPixels() from depth buffer was wrong
  787.     - error prone depth and stencil buffer allocation
  788.     New features:
  789.     - Preliminary Microsoft Windows driver
  790.     - Implemented a number of missing functions: glEvalCoord[12][df]v(),
  791.         glGet...(), etc.
  792.     - Added a few missing symbols to gl.h and glu.h
  793.     - Faster rendering of smooth-shaded, RGBA, depth-buffered polygons.
  794.     - Faster rendering of lines when width=2.0
  795.     - Stencil-related functions now work in display lists
  796.     Changes:
  797.     - renamed aux.h as glaux.h (MS-DOS names can't start with aux)
  798.     - most filenames are in 8.3 format to accomodate MS-DOS
  799.     - use GLubytes to store arrays of colors instead of GLints
  800.  
  801. 1.2.2   August 2, 1995
  802.     New features:
  803.     - texture mapped points and lines
  804.     - NURBS! (but not 100% complete)
  805.     - viewports may safely extend beyond window boundaries
  806.     - MESA_PRIVATE_CMAP environment variable
  807.     - Grayscale X display support
  808.     - two new demos:  demos/gears.c and demos/shadow.c
  809.     - MachTen for Macintosh configuration
  810.     Bug fixes:
  811.     - glGet*(GL_DEPTH_BITS) returned bytes, not bits
  812.     - point, line, and bitmap rasterization suffered from roundoff errors
  813.     - fixed a division by zero error in line clippping
  814.     - occasional wrong default background color really fixed!
  815.     - glDepthFunc(GL_ALWAYS) with glDepthMask(GL_FALSE) didn't work
  816.     - gluBuild2DMipmaps malloc problem fixed
  817.     - view volume clipping of smooth shaded lines resulted in bad colors
  818.     Changes:
  819.     - new visual selection method in glXChooseVisual()
  820.     - improved GLU quadric functions
  821.     - call XSync for glFinish and XFlush for glFlush
  822.     - glVertex() calls now use a function pointer to avoid conditionals
  823.     - removed contrib directory from Mesa tar file (available on ftp site)
  824.     - AIX shared library support
  825.     - Removed GLUenum type as it's not in OpenGL
  826.  
  827. 1.2.3   September 26, 1995
  828.     New features:
  829.     - Mesa header files now equivalent to SGI OpenGL headers
  830.     - Support for HP's Color Recovery dithering displays
  831.     - Faster vertex transformation
  832.     - Faster raster operations into X windows under certain conditions
  833.     - New configurations:  HP w/ shared libs, Ultrix w/ GCC, Data General
  834.     - 4-bit visuals now supported
  835.     Bug fixes:
  836.     - glScissor bug fixed
  837.     - round-off errors in clipping lines against clip planes fixed
  838.     - byte swapping between hosts and display servers implemented
  839.     - glGetError() can be called without a current rendering context
  840.     - problem with accidentally culled polygons is fixed
  841.     - fixed some widget compilation problems
  842.  
  843. 1.2.4   November 17, 1995
  844.     New features:
  845.     - More speed improvements (lighting, fogging, polygon drawing)
  846.     - Window system and OS-independent off-screen rendering
  847.     - Preliminary Fortran bindings
  848.     - glPolygonOffsetEXT implemented
  849.     - glColorMask and glIndexMask now fully implemented
  850.     - glPixelZoom implemented
  851.     - display lists fully implemented
  852.     - gamma correction
  853.     - dithering in 8-bit TrueColor/DirectColor visuals
  854.     Changes:
  855.     - Improved device driver interface
  856.     - tk.h renamed to gltk.h to avoid conflicts with Tcl's Tk
  857.     - Dithering support moved from core into device driver
  858.     Bug fixes:
  859.     - glEnable/Disable( GL_LIGHTING ) didn't always take effect
  860.     - glReadPixels byte swapping was broken
  861.     - glMaterial with pname==GL_AMBIENT_AND_DIFFUSE was broken
  862.     - duplicate glColor4b() prototype in GL/gl.h removed
  863.     - stripes in wave -ci demo fixed
  864.     - GL_LINEAR_MIPMAP_NEAREST had wrong value
  865.     - bugs in HP Color Recovery support fixed
  866.     - fixed bug when blending lines, points, bitmaps outside of window
  867.  
  868. 1.2.5   November 30, 1995
  869.     New Features:
  870.     - updated MS Windows driver
  871.     - new implementation of StaticGray/GrayScale visual support
  872.     Bug fixes:
  873.     - pixelzooming with gamma correction or blending didn't work
  874.     - HP color recovery visual wasn't being picked by glXChooseVisual
  875.     - glClear didn't always observe glColorMask changes
  876.     - olympic and offset demos didn't compile on some Suns
  877.     - texcoord clamping wasn't correct
  878.     - a polygon optimization introduced an occasional sampling problem
  879.  
  880. 1.2.6   January 26, 1996
  881.     New Features:
  882.     - faster line and polygon rendering under certain conditions.  See
  883.       "Performance tip" number 9, above.
  884.     - profiling
  885.     - lighting is a bit faster
  886.     - better perspective corrected texture mapping
  887.     - Amiga AmiWin (X11) support
  888.     - preliminary Linux SVGA driver
  889.     Changes:
  890.     - now using a 16-bit depth buffer, faster, smaller
  891.     - GL_NORMALIZE is disabled by default
  892.     Bug fixes:
  893.     - projective texture mapping
  894.     - fixed a memory leak in the context destroy function
  895.     - GL_POLYGON with less than 3 vertices caused a crash
  896.     - glGet*() returned wrong result for GL_INDEX_MODE
  897.     - reading pixels from an unmapped X window caused a BadMatch error
  898.  
  899. 1.2.7   March 5, 1996
  900.     New:
  901.     - faster lighting
  902.     - faster 16-bit TrueColor rendering on Linux
  903.     - faster 32-bit TrueColor rendering on Linux, HP, IBM
  904.     - non-depth-buffered XImage polygons are faster
  905.     - vertex array extension
  906.     - software alpha planes
  907.     - updated Macintosh driver
  908.     - new NeXT driver
  909.     - GLU quadric functions generate texture coordinates
  910.     - reflect.c demo - reflective, textured surface demo
  911.     Changes:
  912.     - gamma correction code moved into the X driver for better performance
  913.     Bug fixes:
  914.     - multiple glClipPlane()'s didn't work reliably
  915.     - glPolygonMode() didn't always work
  916.     - glCullFace( GL_FRONT_AND_BACK ) didn't work
  917.     - texture mapping with gamma correction was buggy
  918.     - floating point exceptions in texture coordinate interpolation
  919.     - XImage byte swapping didn't always work
  920.     - polygon edge flags weren't always used correctly
  921.  
  922. 1.2.8   May 22, 1996
  923.     New:
  924.     - overlay planes on X servers with the SERVER_OVERLAY_VISUALS property
  925.     - better monochrome output
  926.     - more IRIX 6.x configurations
  927.     - more robust RGB mode color allocation
  928.     - added MESA_XSYNC environment variable
  929.     - GLX_MESA_pixmap_colormap and GLX_EXT_visual_info extensions
  930.     - GL_MESA_window_pos extension
  931.     - faster glReadPixels/glDrawPixels for GL_DEPTH and GL_UNSIGNED_SHORT
  932.       and GL_UNSIGNED_INT
  933.         - driver for prototype Cirrus Mondello 3-D board
  934.     - updated AmigaDOS driver
  935.         - a few small speed optimizations in polygon rendering
  936.     Changes:
  937.     - internal device driver interface modified to simplify device
  938.       driver implementations and to support hardware Z buffers
  939.     - several changes to the X/Mesa interface (xmesa.h)
  940.     Bug fixes:
  941.     - fixed pow(0,0) domain error triggered on some systems
  942.     - glStencilClear() in a display list caused an infinite loop
  943.     - glRasterPos*() was sometimes off by +/-0.5 in X and Y
  944.     - color masking and blending were performed in wrong order
  945.     - auxSolidCylinder() sometimes drew a wire-frame cylinder
  946.     - fixed file writing bug in osdemo.c
  947.     - pixel mapping didn't always work
  948.     - the GL_GEQUAL stencil func didn't work
  949.     - the GL_INVERT stencil op didn't work
  950.     - the stencil write mask didn't work
  951.     - glPush/PopAttrib() didn't do enough error checking
  952.     - glIsList() didn't always work correctly
  953.  
  954.  
  955.  
  956. Why is it the library called Mesa?
  957. ==================================
  958.  
  959. Why not?  More obvious names were considered but had to be rejected:
  960. FreeGL (too similar to the trademarked name OpenGL), Free3D (too similar
  961. to DEC's Open3D).  Also, I'm tired of acronyms.
  962.  
  963. [I've recently discovered that at least two other software products use the
  964. name Mesa.  A name change may be necessary in the future.  Suggestions are
  965. welcome!]
  966.  
  967.  
  968.  
  969. Thanks to
  970. =========
  971.  
  972. Erich Stefan Boleyn - for the glRotate code and testing early Mesa
  973. Joe Kiniry, Kendall Bennett - for opinions and discussion
  974. Marc Buffat - for the gluProject and gluUnproject functions
  975. Bernd Barsuhn, Volker Weiss - for the new implementation of evaluators
  976. Philip Brown - for the initial GLX, GLUT implementation
  977. Thorsten Ohl - for glXUseXFont() and glBitmap bug fixes
  978. Thomas Malik - for new invert_matrix and other xform.c code
  979. Michael Pichler - for X colormap code and numerous bug reports/fixes
  980. Thorsten Ohl, Jeroen van der Zijp - for the Xt/Motif widgets
  981. Bob Mercier - for the new 8-bit RGB dithering code
  982. Pedro Vazquez - for establishing the Mesa mailing list
  983. Bogdan Sikorski - for the GLU polygon tesselation code and NURBS
  984. Linas Vepstas - for his extrusion and swept surface library
  985. Frederic Devernay - for improved X shared memory support
  986. Asif Khan - for bringing _many_ subtle bugs to my attention
  987. Mark Peterson - for the MS Windows driver for Mesa
  988. Gene Lett and Kerris Renkin - for diagnosing several rasterization problems
  989. Alex De Bruyn - for HP Color Recovery display support
  990. Miklos Fazekas - for the Macintosh driver
  991. Frederic Devernay - for many Sun configs and lots of useful feedback
  992. Victor Ng-Thow-Hing - for the Amiga AmiWin port
  993. Bill Triggs - improved texture mapping features
  994. Martin Bernhard - added texture coordinate generation to GLU quadric functions
  995. Pascal Thibaudeau - NeXT support
  996. Jean-Luc Daems, Jacques Leroy - numerous optimization in Mesa 1.2.7
  997. Joerg Hessdoerfer - 16-bit TrueColor optimizations in Mesa 1.2.7
  998. Stefan Zivkovic - for the Amiga driver
  999. Peter McDermott - for the Cirrus Logic Mondello driver
  1000.  
  1001. Your contributions are greatly appreciated!
  1002.  
  1003.  
  1004. This file last revised:  May 22, 1996
  1005.